Vous êtes sur la page 1sur 3

Landline Dialup Modem

My current Arduino project involves replacing an existing antiquated device with Arduino processors.
The existing system (without going into too much detail) covers a large geographic area and
communicates via landline phone lines and dialup fax modems. When my project came to the point
that I needed to address my communications issues, I searched all over the web and found very little
help because the preferred method for connecting Arduinos through the telephone system is wireless.
So with some help from a co-worker, we figured it out and I’m posting this topic to help others who are
in need of a similar solution.

The board that I am using is the Arduino MEGA 2560. It is connected to a MAX232 chip which is in turn
soldered via cable to a male DB9 connector. Next is an adapter (female DB9 to male 25 pin) which
serves at the input for a 56K Faxmodem…which connects the system to the phone line. The Faxmodem I
used was USRobitics Model 5686G which is available through PROVANTAGE.com for $77.80 and can be
seen at the following link: http://www.provantage.com/usrobotics-usr5686g~7USR901M.htm

Ok, let’s get into the wiring diagram.

On the DB9 connector pins 4 and 6 are shorted and pins 7 and 8 are shorted. The wiring of the MAX232
is pretty straight forward except that since we are connecting to a male DB9, pins 13 and 14 of the chip
connect to pins 2 and 3 respectively of the DB9. This is backwards from what most online wire diagrams
show (I assume because they are connection the chip to a female DB9). A cheap toggle switch is placed
between Vcc and a grounded 10K resistor to turn the function on and off. I realize this could be a push
button but I already had the toggle in place so that’s what I used. Lastly is a light emitting diode
between ground and pin 13 of the MEGA to show you that S1 is either open or closed.

Now let’s look at the sketch. I used the example sketch labeled Digital Button and just modified it where
needed

const int buttonPin = 5; // the number of the S1 pin


const int ledPin = 13; // the number of the LED pin

int buttonState = 0; // variable for reading the S1 status


int a = 0; // variable for keeping the program from looping repeatedly

void setup() {
// initialize the LED pin as an output:

pinMode(ledPin, OUTPUT);
// initialize the S1 pin as an input:
pinMode(buttonPin, INPUT);
Serial.begin(9600); //MEGA comunicates with PC at 9600
Serial3.begin(9600); //MEGA comunicates with Faxmodem at 9600
}

void loop(){
// read the state of the S1 value:
buttonState = digitalRead(buttonPin);

// check if the S1 is closed.


// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
if (a == 0) //so we only run PrintToFax() one time per cycle
{
PrintToFax();
a = 1;
}
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
a = 0;
}
}
void PrintToFax(){
Serial3.print (F(" ")); //required to wake-up the Faxmodem
delay(200);
Serial3.println(F("ATD1234567890")); //replace numbers 1-0 with the number to be dialed
delay(20000); //if monitoring the receiving modem via Hyper Term
Serial3.println(F(“testing”)); //if you are monitoring the receiving modem via Hyper Term
}

One other thing is that there are a series of 8 dip switches on the modem; switches 1, 3, and 8 need to
be in the down position and all the rest are left in the up position.

And there you have it. I know that there are less expensive modems available and someone more
experienced than me who may be able to do this better, cheaper or faster. This was my initial shot at it
with available parts. This code only causes the modem to dial out but I am confident that sketching the
function of answering an incoming call will not be difficult. From there it’s just a matter of control and
you can set this to call you from your home phone during vacation when your house temp gets too hot
or cold, or when your front door opens, or when your….well anything you can put a sensor on happens.

Vous aimerez peut-être aussi