I am trying to alter the instructions posted on http://tronixstuff.wordpress.com/2011/01/19/tutorial-arduino-and-gsm-cellular-part-one/ to be able to send SMS messages to my phone from a SM5100B cellular module from Sparkfun. I'm using an UNO R2 and writing the sketch using IDE 1.0. I have an AT&T SIM card that I activated at the local AT&T store (Virginia, USA). Since the tronixstuff instructions are using a Mega board along with programming with v 23 the example sketch needs to be updated. I have stacked the SM5100B shield on the Uno and I'm using a 9V battery to power the board due to the extra current to send each message. See the resultant sketch after modifying from the one on their website below. Please review my sketch and the steps I conduct and let me know if anyone sees my issue. I'm not familiar with using AT commands so it wouldn't surprise me if I have this setup incorrectly. Please advise.
I do the following steps:
- Compile and upload the sketch to the Uno without the 9V battery attached
- Stack the SM5100B onto the Uno
- Plug in the 9V battery via the barrel connection
- Press reset button on the SM5100B shield
- Wait 3-4 minutes for a SMS to my phone
- Never receive the message
/* Example 26.3 GSM shield sending a SMS text message
Arduino Tutorials | tronixstuff.com > chapter 26 */
#include <SoftwareSerial.h>
SoftwareSerial cell(2,3); // We need to create a serial port on D2/D3 to talk to the GSM module
void setup()
{ //Initialize serial ports for communication.
Serial.begin(9600);
delay(60000); // give the GSM module time to initialise, locate network, etc.
}
void loop()
{
Serial.print("AT+CMGF=1"); // set SMS mode to text
Serial.print("AT+CMGS="); // now send message...
Serial.write(34); // ASCII equivalent of "
Serial.print("15557771212"); not my actual phone number
Serial.write(34); // ASCII equivalent of "
delay(500); // give the module some thinking time
Serial.print("They call me the count... because I like to count! Ah ha ha ha"); // our message to send
Serial.write(26); // ASCII equivalent of Ctrl-Z
delay(15000); // the SMS module needs time to return to OK status
do // You don't want to send out multiple SMSs.... or do you?
{
delay(1);
}
while (1>0);
}