Shields – GPRS Shield

With the Libelium Arduino GPRS Shield you can:

  1. Make and receive calls with an Arduino.
  2. Send and receive SMS messages with an Arduino
  3. Connect your Arduino board to the Internet via a GPRS connection

Tutorial and sample code for the GPRS Shield.

Using the GPRS Shield

Testing the AT Commands

1. We will first test the AT commands on a computer. For that you will need an Arduino board without the ATMega microcontroller chip. Arduino 0018 in the lab should be like this already. If you need to take out the chip from your Arduino, do it carefully with a screwdriver and be careful not to bend any of the pins of the ATMega.

2. Plug the GPRS Shield to the Arduino and insert a SIM card.

3. Connect a small speaker to the speaker pins on the shield. This is really useful for debugging your process.

4. Set the Serial com. jumpers on the shield to USB gateway and the power jumper to Arduino 5V. Use the schematic image above for reference.

5. Connect the USB cable of the Arduino to your computer and also connect an external power supply to your Arduino. Libelium recommends a 12 V / 2 A power supply. The external power supply is needed because most USB ports do not provide enough current for the shield when it tries to connect to a network.

6. We are going to use CoolTerm to test the shield. Download and install it.

7. Launch CoolTerm. Click on Options. Make sure you are using the following settings:

  • Port: The serial port of your Arduino
  • Baud Rate: 115200
  • Terminal Mode: Raw Mode
  • Enter Key Emulation: CR+LF

8. Click OK and then Connect. You should now be connected to the Arduino board.

9. Turn the shield on by pressing the ON/OFF button for two seconds. The speaker should beep two times.

10. In CoolTerm, type the following command and hit enter:


You should get a reply of OK.

11. If you have a PIN code on your SIM card, use the following command:


Where **** is you PIN number. You should get OK as a reply. NOTE! I recommend disabling the asking of the PIN code on your SIM card. I find that it causes some problems connecting to the network.

12. Wait for a message like this:

*PSSTK: "SETUP MENU",1,4,"Saunalahti",0,0,1,0,1,4

This means that the module is able to read the SIM card.

11. Wait for another sound from the speaker. Two slightly longer beeps. Be patient, this might take over 60 seconds

If you don’t hear the sound. Disconnect CoolTerm, disconnect the USB cable and disconnect the power supply. Connect them back and try again.

12. Use this command:


This will query the mobile network name. You should get a reply like:

+COPS: 0,0,"FL elisa"

If you get +COPS: 0, it means that the module is not connected to the network. Wait for it to connect or restart it.

13. Now we should be connected and we can start testing all the fun stuff. Try calling someone with the command:

ATD**********; (********* is the number to call)

Or try sending an SMS:

AT+CMGS="*********" (********* is the number to send the SMS)
This is test message! (Type your message here. Do not hit enter. Press ctrl+z to send the message)

Some useful commands:

Download this .pdf for a complete list of all of the available commands.

Calling a number:

ATD**********; (********* is the number to call)

Hang up call:


Extended format for incoming call indication (meaning that it will show you the number that is calling):



AT+CSCA? (you get the SMS service center address)
AT+CMGF=1 (select the SMS format (1=text mode))
AT+CMGL="ALL" (Lists all SMS messages on the card. Set the SMS format to text before this)

Sending SMS:

AT+CMGS="*********" => ********* is the number to send the SMS
Text of the message .................
1A(hex) => end of message.
// In CoolTerm you can enter the 1A hex code by pressing ctrl+z on your keyboard at the end of your message text.

Reading phonebook entries:

AT+CPBR=* (you get the number and name of the * position in the phonebook)


If you have problems getting the serial communication to work properly, try uploading the code with an older version of the Arduino software, such as Arduino 0016.