Pages: [1] 2   Go Down
Author Topic: (HELP) Interfacing GSM Modem with Arduino  (Read 4604 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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,

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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);  
}
« Last Edit: September 12, 2011, 11:09:13 am by nixorous » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.sgbotic.com/index.php?dispatch=products.view&product_id=461

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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??
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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???
Logged

Chester, UK
Offline Offline
Sr. Member
****
Karma: 2
Posts: 489
Trying to return the love to none logic level MOSFETS
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

If your system involves lethal voltages/life critical/flamable elements - you probably shouldn't need to ask.
The Arduino != PC.

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

https://docs.google.com/viewer?pid=explorer&srcid=0B2_rhDNAxM4sY2IzMDhkN2MtNTc4Yi00ZGYyLWFlYmEtZmJlODAzZjk3NDEw&chrome=false&docid=17f908969bd2d14b26670d3513671bad|d73c8e47dcebad24c7b9d5aba7e505e9&chan=EgAAAFNqudoIJL2UH5v1HJsIevbhFAhJv7T%2BlmHMKQSpt2l7&a=v&rel=rar;r2;MAX3232.pdf
This is the datasheet for MAX3232 Chip. It steps up or down the signal voltages using a voltage pump.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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++;
   }
}

 
Logged

Chester, UK
Offline Offline
Sr. Member
****
Karma: 2
Posts: 489
Trying to return the love to none logic level MOSFETS
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

If your system involves lethal voltages/life critical/flamable elements - you probably shouldn't need to ask.
The Arduino != PC.

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yep it doesn't work too.
Logged

Chester, UK
Offline Offline
Sr. Member
****
Karma: 2
Posts: 489
Trying to return the love to none logic level MOSFETS
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

If your system involves lethal voltages/life critical/flamable elements - you probably shouldn't need to ask.
The Arduino != PC.

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are your power supply grounds connected together?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1] 2   Go Up
Jump to: