Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Communication between Arduino with Wavecom Q2303A GSM modem

Status
Not open for further replies.

xemse89

Newbie level 2
Joined
Mar 15, 2012
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,297
Guys,i need help with my project
I have connected my arduino AtMega328 to Wavecom Q2303A GSM Modem using rs232 level converter(**broken link removed** i still can't configure my gsm modem to send SMS to my desired phone number.I'm using arduino 1.0 btwFollowing is my coding for the project:


Code:
#include <SoftwareSerial.h>

const int rxpin = 2; // pin used to receive 
const int txpin = 3; // pin used to transmit 
SoftwareSerial gsm(rxpin, txpin); // new serial port on pins 2 and 3
char phoneNumber[] = "60128950630";
void setup()
{
Serial.begin(9600); // 9600 baud for the built-in serial port
gsm.begin(9600); //initialize the software serial port also for 9600
delay(35000);
}
void loop()
{  

gsm.println("AT");
while(gsm.available())
    Serial.write((byte)gsm.read());
delay(500);
Serial.println();
gsm.println("AT+CMGF=1"); // set SMS mode to text
while(gsm.available())
    Serial.write((byte)gsm.read());
delay(500);
Serial.println();
gsm.print("AT+CMGS="); // now send message...
gsm.write((byte)34);// ASCII equivalent of "
gsm.print(phoneNumber);
gsm.write((byte)34); // ASCII equivalent of "
gsm.println();
while(gsm.available())
    Serial.write((byte)gsm.read());
delay(500);
Serial.println();
gsm.print("Hello, This is your Arduino"); // our message to send
gsm.write((byte)26); // ASCII equivalent of Ctrl-Z
// this will send the following to the GSM module
// on the Cellular Shield: AT+CMGS=”phonenumber”<CR>
// message<CTRL+Z><CR>
gsm.println();
while(gsm.available())
    Serial.write((byte)gsm.read());
delay(500);
Serial.println();
delay(15000); // The GSM module needs to return to an OK status



}

I have connected Tx and Rx wire from the rs232 level converter to pin 2 and pin 3 of the arduino respectively,is this correct? Can anyone point out what's wrong with my coding? I have also connected pin rts and cts at rs232 level converter together.
This is the manual for my modem http://www.ozeki.hu/attachments/588/M1206B_Manual.pdf
 

Code:
gsm.println("AT");

//you need to send 'Enter' at this line

while(gsm.available())
    Serial.write((byte)gsm.read());
delay(500);
As I comment above, I think you need to send AT then 'ENTER', so that GSM will response.
 

Erm...not the case....nevertheless i have solved it,it is related to my rs232 connection :)
 

Erm...not the case....nevertheless i have solved it,it is related to my rs232 connection :)

Hi, how did u solve your Problem?
Can you send a final example of your code and the wiring how it works please?

Thanks
robschu
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top