xemse89
Newbie level 2
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:
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
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