I started playing around with this GPRS shield that I recently purchased from Amazon for a mere $30:
The MFG’s website is here
and the WIKI for the device is here:
Some other good reference sites I found are:
After I received it, I ordered a GSM SIM card from my cellular carrier (I don’t know how this works with a CDMA carrier like Verizon – my guess is it doesn’t). The GPRS shield is just another handset on my wireless plan and uses the same shared voice/text/data. I simply plugged in the new SIM card and it worked on the first try.
I attached the GSM/GPRS shield to an Arduino Uno and wired the ublox GPS ontop of that using a breadboard shield. The wiring diagram is:
(Feb 2016 update: going back to set the GPRS field up again but put it on a Mega – the shield does not work directly connected to a Mega because the softwareSerial doesn’t support pins 7&8 on the Mega. To use the mega, you cannot directly connect the shield onto the mega).
The first thing I did was setup a test sketch like this that lets you type AT commands into the GPRS shield thru the arduino:
I was then able to determine I had connectivity with the shield.
Then I found the AT command set for the SIM900 chip that is used:
I went thru the manual and figured out some of the commands that I would want to use such as
send text at+cmgs="8005551212" > this is a test > ctl-d
get all waiting texts at+cmgl="ALL" +CMGL: 1,"REC UNREAD","18005551212","","15/03/06,22:25:53-32" Test reply
delete all msgs: at+cmgda="DEL ALL" OK
Once I was sure I could send/list/receive/delete SMS messages, I was ready to get the GPS running.
I implemented the TinyGPSPlus library as I had earlier in Connecting u-blox NEO-6M GPS to Arduino. But I was seeing a lot of checksum errors and further research into that indicated I was having way too many buffer overflows. The GPS’s default baud rate of 9600 baud was too fast for the TinyGPSPlus library to decode so I had to change the baud rate to 4800 baud as outlined here: High Checksum Errors with u-blox NEO-6M GPS and Arduino.
I am using the SoftwareSerial library to communicate with both the GPS and the GPRS. It turns out that this library will not allow you to listen to both devices at the same time. You must indicate which device you want to listen to with the xxx.listen() method.
Most of the time, my code will be listening to the GPS and decoding the serial stream coming from the GPS. This is done by calling gps.listen(). When I’m ready to check for SMS messages, I then use gprs.listen(). This works reasonably well. I do get some checksum errors because of incomplete GPS messages, and if I wait too long before reading the GPS again, the locational data can get stale (especially if the GPS were in a car moving fast).
Once I had this figured out, I fleshed out the code to listen for ANY SMS message. I don’t try to determine what the message may say, I just assume if my GPS/GPRS is getting a message, I need to respond with the location. So I format a text message as a google maps URL, and transmit it to a fixed phone # (this is, after all, just a demonstration program).
The final result worked quite nicely. I send the arduino a text message, and get back a URL of its location. Here is a google voice log of a message to the Arduino, and its response:
I use code::blocks as my IDE most of the time rather than the Arduino IDE, so you will see somethings you might not see in the Arduino IDE, such as having to define forward references to all of my functions. However, it will compile fine in the Arduino IDE.