Arduino in at the deep end
I purchased the Arduino Duemilanove and GSM shield back in 2011 with the sole intention of building an alarm system for my Garage. The method was quite simple. Use Arduino to sense for break-in using IR and magnetic operated (reed) switches and send text messages to a preset phone number . I also wanted to arm and disarm the system using text messages.
So my first test was to see if I could get the GSM shield to communicate with our phone provider which is O2 in the UK.
These are the two modules I’m using. A Seeedstudio “Seeeduino V3” which is an Arduino Duemilanove clone and a iteadtdudio IComSat GSM shield.
Much to my annoyance the GSM board is updated whilst mine is still in the post from China. Pictured above is the V1.0 version but the V1.1 currently on sale now has Audio in and out. This would be quite useful as having been alerted to a break-in, you could then dial up the alarm system and listen in on the scum or record to SD card the audio transcript.
Sounds simple really but blindly plugging this lot together and uploading some sample Arduino sketches did not produce any favourable results. Long story short was that Arduino 1.0 was released and the IComSat GSM library only worked in Arduino v0.23 or below. That foxed me for a while. Secondly, just inserting an O2 pay as you go sim card seemed to do nothing. At least the serial monitor was showing the Arduino booting up and the GSM shield failing to register the sim. Mind you it failed to register any kind of sim I placed into the device.
Success!
Two years later (other projects and kids) I dusted off the modules and tried again. Here is what I used to make this work and the same can be used for the IComSat v1.1 board too.
- Installed Arduinio v1.05
- Added some credit to the prepay Sim card. It just would not repond at all unless the card had some credit on it.
- Grabbed the latest GSM library from here:
- ftp://imall.iteadstudio.com/IM120417009_IComSat/Lib_GSM_Shield.zip
- this one also works well too http://gsm-shield-arduino.googlecode.com
- Ignore the GSM shield documentation on baud rate
- Ignore the GSM shield documentation on the Tx/Rx pins to use
Baud rate
After loading the example sketch from whichever library you use, you will find the baud rate for serial monitoring to be set to 9600. That’s fine. It’s the next line that sets the baud between the Arduino and GSM shield that is wrong. This will be down to experimentation. Some people on the Internet have found 19200 to work but for me on my v1.0 shield it had to be set to 2400. Can it be changed to a higher speed? I don’t know yet.
Serial.begin(9600); //baud rate to serial monitor gsm.TurnOn(2400); //module power on with 2400 baud rate set
or
//Serial connection.
Serial.begin(9600);
Serial.println("GSM Shield testing.");
//Start configuration of shield with baudrate.
gsm.begin(2400)
Above are the two snippets of code depending on the library you use.
Tx/Rx pins
The documentation says pins 0 and 1. Nope! Doesn’t work for me and again according to the Internet blogs, the pins to use are 2 and 3.
So setup Tx to pin 2 and Rx to pin 3 using the jumpers on the GSM shield and it will all kick into life.
Time
Now that I have a bit of time on my hands, I can start to work on the detection side of this project…


