Send SMS with SM5100B-D on Mega 2560 / Arduino 1.0

Hi, I started recently to learn arduino hardware and arduino software environment. That's why I used Arduino 1.0, latest development platform. I got to the point of sending a simple SMS using GSM shield SM5100B-D on an Arduino Mega 2560 with a piece of code written in Arduino 1.0. I found some starting point in the article of John Boxall (, but the article wasn't updated with new platform changes and was unusable in Arduino 1.0 It helped me that I worked before with AT commands language in a more complex software project and I was able to inspect the AT commands and optimize them. I received help to make this job by many members like PaulS from this forum and in my own way I want to also be able to contribute. The function listed bellow works perfectly out of the box:

void send_sms(char* gsm_number, String sms_text)
Serial.print(“start SMS send…”);
Serial1.println(“AT”); //query gsm shield status, make sure we are ready to go
delay(200); //allow time to process
Serial1.println(“AT+CMGF=1?); // set SMS mode to text
delay(200); //allow time to process
Serial1.write((byte)34);   // ASCII equivalent of ”
Serial1.print(gsm_number); //use international format: 0040742900800
Serial1.write((byte)34);   // ASCII equivalent of ”
delay(200); // give the module some thinking time
Serial1.print(sms_text); // “sms content”
Serial1.write((byte)26); //ASCII equivalent of Ctrl-Z, tell the gsm module we finished the message transmission
delay(15000); // wait the OK status, usually a sms send takes up to 10-12 sec, but we add an extra 3-5 sec for safety
Serial.print(“end SMS send”);


I haven't managed to get as far as you have. I can't get cellular service at all on my SM5100B. Can you please have a look at my blog post and see if you can suggest anything to help?

Thanks in advance! Chris.

Thansks, very good.