(HELP) Interfacing GSM Modem with Arduino

Problems encountered

  • System unable to send out an SMS

Parts list

Arduino Uno


Sparkfun RS-232 Shifter


Wavecom GPRS Modem

Connections
USB Powered for Arduino
RX (Shifter) - TX (Arduino)
TX (Shifter) - RX (Arduino)
GND (Shifter) - GND (Arduino)
VCC (Shifter) - 5V (Arduino)

My connection is exactly like this video

Query

  • How much voltage is needed to be pumped into the RS-232 Shifter VCC
  • Do I have to use an external power source for the arduino like the video?

Help needed urgently! Appreciate it very much and thanks a million in advance for looking thru this problem of mine.

Clement,

The modem is powered by a 7.5V DC adapter. I tested out the modem on the hyperterminal and its working fine.
RS-232 (logic 1 is -12V and logic 0 is +12V) So i have to pump a 12V??

This is my software code. Using Arduino to program.

void setup(){
Serial.begin(9600);
delay(3000);
Serial.println("AT");
delay(500);
Serial.println("ATE0");
delay(500);
}

void loop(){

Serial.println("AT+CMGF=1");
delay(1500);
Serial.println("AT+CMGS=........");
delay(1500);
Serial.print("Test");
delay(500);
Serial.print(0x1A,BYTE);

delay(5000);
}

DB 9 pins connected to the wavecom. Rx to Tx of arduino and Tx to Rx of arduino. Connected Gnd to the arduino and powered it up with 5V from arduino.

Yes it's the one with the RX and TX Led on it and when I run my program the Rx on the shifter will start to blink but somehow after that the data isn't going to the modem.

Yeah I have one of those old PC with rs232 port the modem sends out the SMS when using the program. What do you mean by testing arduino with hyperterminal??

AT
ATE0
AT+CMGF=1
AT+CMGS=+65........
Hello

This are the things that are sent to the modem.
I've used a MAX3232 to convert the Arduino TTL signals to RS232 signals but the voltage of the converted
signals are measured at +8 to 9 volts for low and -8 to 9 for high. Will it affect the the system???

Are you powering the GSM modem in the same way when connected to the PC and connected to the Arduino?

The GSM modem is self powered up with a 7.5V DC Adapter.
The test and hello is the SMS message.
AT+CMGS=.... ( its the handphone number that i'm sending to )

I skip the shifter board because the converted signals aren't the signals that i'm aiming to get

http://www.cutedigi.com/pub/Arduino/arduino_RS232.pdf
This is the schematic diagram of my connection

This is the datasheet for MAX3232 Chip. It steps up or down the signal voltages using a voltage pump.

I've changed the program thus changing the output of the hyperterminal.
I'm very sure my hardware connections are all good.

Things that i noticed after troubleshooting

  • Modem uses 115200 baud rate to communicate and i changed the baud rate of my arduino program.
  • AT commands must have a enter button to read in the code for the modem

I've tested the modem using AT commands on hyperterminal to send out an sms and it works well.
But the thing that i'm not sure is that when arduino Serial.println(........) does it have a enter at the end of the command?
I've tried adding a ASCII equivalent "Enter key or Carriage Return" in the program using Serial.print(0x0D) but it doesn't work still.

I think my problem comes from the programming


New program code

int timesToSend = 1; // Numbers of SMS to send
int count = 0;

void setup()
{
Serial.begin(115200);
delay(3000);
Serial.println("AT");
Serial.print(0x0D,BYTE);
delay(500);
Serial.print(0x0D,BYTE);
Serial.println("ATE0");
delay(500);
}

void loop(){

while (count < timesToSend)
{

Serial.println("AT+CMGF=1");
Serial.print(0x0D,BYTE);
delay(1500);
Serial.println("AT+CMGS=********"); // recipient's number
Serial.print(0x0D,BYTE);
delay(1500);
Serial.print("Hello..."); // the SMS body
delay(500);
Serial.print(0x1A,BYTE); // end of message command 1A (hex)

delay(5000);

count++;
}
}

Shot in the dark - Have you tried a CR + line feed? 0x0A

Yep it doesn't work too.

Is it possible that you need to tack "\r\n" on the end of each AT command instead of the hex?

I did that too and sad to say it's still not working T.T

Are your power supply grounds connected together?

Yep the circuit all have a common ground.

KE7GKP - I posted the schematic diagrams instead of my wirings its for easier troubleshooting.
I'll post the picture of my wiring on the breadboard if you want to see it in awhile.

Blue (arduino right side) - TX
Black (arduino right side) - RX
Red (arduino left side) - 5V
Black (arduino left side) - GND

DB9
Pin 5 - GND
Pin 2 - RX ( Pin 14 of MAX3232)
Pin 3 - TX ( Pin 13 of MAX3232)

Anyone know whats the problem of my system??

Here is a code snippet of mine that sends a text message of two temperature measurements to my phone.

Serial.println("AT+CMGF=1");
        delay(2000);
        Serial.println("AT+CMGS=1XXXXXXXXXX,129");
        delay(500);
        Serial.print("High Temp = "); Serial.print(hightemp, DEC);
        Serial.print(" Low Temp = "); Serial.print(lowtemp, DEC);
        Serial.println(26,BYTE);

You do need to append either a "129" or "145" on the CMGS command to indicate national or international dialing. I am not sure what your "Serial.print(0x0D,BYTE)" is intended to do. The correct message terminator is a "control-z", which is represented by: "Serial.println(26,BYTE)." You do need the println format to send a carriage return/line feed.

Thanks i'll try that out.
But from what i've tested the computer requires a 5wire connection (RX, TX, RTS, CTS and GND) and the arduino can only support 3.
Anyone can enlighten me on how to interface it with a arduino?

nixorous:
Thanks i'll try that out.
But from what i've tested the computer requires a 5wire connection (RX, TX, RTS, CTS and GND) and the arduino can only support 3.
Anyone can enlighten me on how to interface it with a arduino?

RTS and CTS are for flow control. They are not absolutely required, and you can configure the PC UART not to require them (I believe that is the default condition).