I am using an Arduino nano 328p and sim900A A6 GPRS/GSM module.I want to send an sms from the module to my phone.I have connected the tx of arduino to u_rxd of gsm module , rx of arduino to u_txd of module and gnd of arduino to gnd of module.I am powering both the arduino and gsm modules using usb cables.The code I am using is this:
char phone_no[]="+91xxxxxxxxxx";
void setup() {
Serial.begin(9600);
delay(300);
Serial.println("AT+CMGF=1");
delay(2000);
Serial.print("AT+CMGS=\"");
Serial.print(phone_no);
Serial.write(0x22);
Serial.write(0x0D); // hex equivalent of Carraige return
Serial.write(0x0A); // hex equivalent of newline
delay(2000);
Serial.print("GSM A6 test message!");
delay(500);
Serial.println (char(26));//the ASCII code of the ctrl+z is 26
}
void loop()
{
}
The serial monitor shows the AT commands being typed but neither is there any response to the commands nor is sms received by my phone.When I try to upload a blank sketch to the arduino and send AT commands through the serial monitor,the commands simply vanish after I press enter.Please help!!!!