GSM/GPRS/GPS Shield

From Waveshare Wiki
Jump to: navigation, search
GSM/GPRS/GPS Shield
GSM/GPRS/GPS Shield, Phone Module, Arduino Shield Based on SIM908
GSM-GPRS-GPS-Shield l.jpg
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Primary Attribute
Category: Modules, GPS/GSM, Arduino
{{{userDefinedInfo}}}: {{{userdefinedvalue}}}
Brand: Waveshare
Website
English: Waveshare website
Chinese: 官方中文站点
Onboard Interfaces
Related Products

Introduction

GSM/GPRS/GPS Shield, Phone Module, Arduino Shield Based on SIM908

More

Hardware configuration

GSM-GPRS-GPS-Shield-UserManual-1.png
Figure 1. Hardware configuration
  1. PC connection: connect to a PC via a mini USB cable (tab 1);
  2. Power connection: connect to a 6V~9V DC power supply (tab 2);
  3. Switch to ON (tab 3)
  4. SIM card slot: press the SIM card slot, and push the plastic sheet aside to open the slot, then, place a SIM card into it and close the slot (tab 4);
  5. SIM908 network indicator : blinking slowly when network registration is successful (tab 5);
  6. Connect GPS antenna (tab 6);
  7. Arduino reset button (tab 7);
  8. NOKIA original speaker : SIM908 1st analog voice channel output (tab 8);
  9. Connect 3.5mm earphone (tab 9); Non-essential, you can monitor from the speaker (tab 8).
  10. Connect with a GSM signalenhancement antenna (tab 10);
  11. Set the jumpers (tab 11):
    • Connect PWRKEY to GND, see the Remarks in this section for more details.
    • Control the serial selection of SIM908.
      CP2102 chip controlling: Connect the jumpers between USB_RX and CTL_RX, USB_TX and CTL_TX.
      Arduino serial settings: Connect the jumpers between Duino_RX and CTL_RX, Duino_TX and CTL_TX.
  12. mic: SIM908 1st analog voice channel input.


Remarks: The power control of SIM908 module can be controlled by PWRKEY pin. The switching between on and off states of the module can be controlled by connecting PWRKEY to GND for 1-2 sec and then disconnecting them.
For example, when SIM908 module is on, connecting PWRKEY to GND for 1-2 sec and then disconnecting will make the module switch to off.
If SIM908 module is off, tying PWRKEY to GND for 1-2 sec and then disconnecting will make the module switch to on as well (similar to a warm-boot). When PWRKEY pin is always connected to GND, SIM908 module will remain on.

Manual debugging jumper settings

Image004.jpg
Figure 2. Manual debugging jumper settings
  • Tab 1: Serial transmitter selection CTL_TX
Set to CP2102 chip control: Connect USB_TX and CTL_TX with a jumper.
Set to Arduino serial: Connect Duino_TX and CTL_TX with a jumper.
  • Tab 2: Serial receiver selection CTL_RX
Set to CP2102 chip control: Connect USB_RX and CTL_RX with a jumper.
Set to Arduino serial: Connect Duino_RX and CTL_RX with a jumper.
  • Tab 3: Connect the NCP2890 enable pin (SPK_EN) and earphone checking pin with a jumper.
When the Earphone socket is plugged in with a earphone cable, CHK is pulled high. It will cause SPK_EN to be pulled high and NCP2890 not enabled.
When the Earphone socket is not plugged, CHK is pulled low. It will cause SPK_EN to be pulled low and and NCP2890 enabled.
If the SPK_EN is connected to the A3 port from an Arduino board, the A3 port can enable/disable the NCP2890 chip.
  • Tab 4: SIM908 start up.
  • Tab 5: Motor control port (Motor), active-low. The RI (Ring indicator) port is low while the board is ringing.
If the Motor port is connected to the RI port, the board will vibrate in the case of receiving a phone call.
If the Motor port is connected to the A4 port from an Arduino board, the board vibration is controlled by A4 port.
  • Tab 6: GPS/GSM Serial mode selection
GSM_EN: if GSM_EN = 0, the GSM serial port is selected, high level by default.
GPS_EN: if GSP_EN = 0, the GPS serial port is selected, high level by default.
  • The GSM_EN and GPS_EN port cannot be connected to GND at the same time. Default: suspended and no serial output.

Getting started

Preparations

  • GSM/GPRS/GPS_Shield
  • SIM card
  • 5V TTL to serial board
  • PC serial monitor software
  • PC u-center software
  • 9V DC power supply

1. After powering up, the power indicator PWR LED will light up.

2. Select the serial chip CP2102 to control SIM908

  • Connect USB_RX to CTL_RX. (Figure 2. Manual debugging jumper settings. The tab 1).
  • Connect USB_TX to CTL_TX. (Figure 2. Manual debugging jumper settings. The tab 2).

Basic operations

We will illustrate the usage of the module with an example of how to operate under GSM mode in the following section.

  1. Connect GSM_EN to GND via a jumper, and keep GPS_EN suspended(Figure 2. Manual debugging jumper settings. The tab 6), to select GSM serial control port.
  2. Tie PWRKEY to GND (Figure 2. Manual debugging jumper settings. The tab 4). Then, you can see that STATUS indicator remains on, and NET indicator keeps blinking, of which fast blinking means the module is trying to register to the network, and slow blinking means network registration is done successfully.
  3. Start the TCP232 serial tool on PC, and perform operations as followed.
GSM-GPRS-GPS-Shield-UserManual-3.jpg
Figure 3. TCP232 Settings
  • Serial port settings
PortNum: Set to the corresponding serial port (*)
Baud rate: 115200
Parity: NONE
Data bit: 8 bit
Stop bit: 1 bit
  • In this example, the PortNum is set to COM1. In practical application, please right click the icon My Computer->Property->Device Manager, in order to check corresponding port number.
  • Check the option Auto Checksum. Then, an Appendix bits setting option box will pop up. Select the option Fixed Byte Checksum, and fill in the small box on the right of the option with 0D, since the ASCII code of CR is 0D, so that there will be an auto CR for each command transmission. The detailed settings are shown in Figure 4.
GSM-GPRS-GPS-Shield-UserManual-4.png
Figure 4. Data transmission settings
  • Fill in the transmission box with AT+GSV, and click the button Send to transmit the command.
  • The data receive box displays the return values from the corresponding serial port, as the figure shows:
GSM-GPRS-GPS-Shield-UserManual-5.png
Figure 5. Sending AT command for module verification testing

GSM debugging

Select GSM serial control port

It can be done by connecting GSM_EN to GND with a jumper, and keeping GPS_EN suspended (see the tab 6 of Figure 2).

GSM command description

  • Common command descriptions for message transmission
Commands Descriptions Return values
AT Make sure the module is working properly AT OK
AT+CMGF=1 Select SMS message format AT+CMGF=1 OK
AT+CMGS="13612345678" Set the message transmission number and send SMS message. After receiving the symbol >, the message Hello World!(*) can be sent out >
0x1A This is a terminator. Before sending it out, you should check the option Send As Hex Hello World!

(*)After sending the message Hello World!, you should check the option Send As Hex, then send the command 1A to indicate the message to be sent is end. In this case, the message you input will be delivered actually.

  • Common command descriptions for dialing and answering a call
Commands Descriptions Return values
ATD13612345678; Set the dialing number: 13612345678,and end with the symbol (;). Now, you can make a call ATD13612345678 ok
ATA Answer an incoming call RING
ATH Disconnect existing connection

For more detailed information about AT commands, please refer to File:SIM908_AT-Command-Manual.pdf

GPS debugging

Switching to GPS mode from GSM mode

  • Configure GPS: first you should set the board to GSM mode (because commands should be sent under the GSM mode) and then send the commands to switch to GPS mode. Take these steps: connecting GSM_EN to GND via a jumper, and keeping GPS_EN suspended, to select GSM serial control port. Send the following commands:
  • AT+CGPSPWR=1 (turn on GPS power supply)
  • AT+CGPSRST=1 (reset to GPS mode)

Return OK.

  • GPS signal output: connecting GPS_EN to GND via a jumper, and keeping GSM_EN suspended, to select GPS serial control port. TCP232 receives relative messages, as figure 6 shows.
GSM-GPRS-GPS-Shield-UserManual-6.png
Figure 6. Serial message receiving under GPS mode

Checking GPS information with the software u-center

  • Start the software u-center2, as Figure 7 shows.
GSM-GPRS-GPS-Shield-UserManual-7.png
Figure 7. u-center
  • Open Receiver COM port: setting -> port Setting, and set the port and Baud rate: 115200 (If the Baud rate of the module is modified to a certain value by sending AT+CGPSIPR command, the modified Baud rate should be used in here).
GSM-GPRS-GPS-Shield-UserManual-8.png
Figure 8. COM and baud settings
  • Select Player to check the GPS information, as Figure 9 shows.
GSM-GPRS-GPS-Shield-UserManual-9.png
Figure 9. Checking GPS information
GSM-GPRS-GPS-Shield-UserManual-10.png
Figure 10. GPS locating

Please refer to File:u-Center-GPS-evaluation-software-User-Guide.pdf for more usage information about u-center.

GPS command descriptions

Commands Descriptions Common values
AT+CGPSPWR GPS power control Value=1, GPS is on
AT+CGPSRST GPS mode reset 0 is for cold start
AT+CGPSINF Get current GPS location information Common value: 32
AT+CGPSOUT GPS NMEA data output control Set to 255, GSM_DEBUG is selected as data output pin
AT+CGPSSTATUS Check GPS status
AT+CGPSIPR Set GPS Baud rate 115200

For more detailed information about AT commands, please refer to File:SIM908_AT-Command-Manual.pdf

GPRS debugging

Selecting GSM serial control port

Connect GSM_EN and GND via a jumper, and keep GPS_EN suspended(tab 6), to select GSM serial control port。

Local virtual servers settings

Virtual servers can be used for setting up public services on your LAN. A virtual server is defined as a service port, and all requests from Internet to this service port will be redirected to the computer specified by the server IP. Please see your router's guide.

GSM-GPRS-GPS-Shield-UserManual-11.png
Figure 11. Local virtual servers settings
  • Service Ports setting: set to a no conflict port. In this example, the service port is set as 12345.
  • IP Address setting: Run CMD in the PC, and execute the 'ipconfig' command to confirm your IPv4 address. In this example, the IP address is 192.168.1.104.

GPRS commands descriptions

  • The GPRS configuration can be performed by sending out following commands sequentially:
Commands AT Commands Descriptions
AT+CSQ Signal quality report
AT+CSTT="CMNET" Set wireless access point to CMNET
AT+CIICR Bring up wireless connection with GPRS or CSD
AT+CIFSR Get local IP address
AT+CDNSGIP=www.sim.com Query the IP address of the given domain name
  • Debugging GPRS:

Find out the PC's WAN IP, which can be obtained by searching "IP" in a search engine, or inquiring your Internet service providers directly. In this example, the WAN IP address is 222.125.175.28. Then send out following commands sequentially:

Commands AT Commands Descriptions
AT+CIPSTART="TCP", "222.125.175.28", "12345" The WAN IP address should be set according to actual condition. In this example, the WAN IP address is 222.125.175.28, and port number is 12345.
AT+CIPSEND Send SMS message. After receiving the symbol >, the message ABCDEF 0x1A can be sent out (0x1A is the completed symbol)
AT+CIPCLOSE Close TCP or UDP connection
AT+CIPSHUT Deactivate GPRS PDP context
  • After sending the message ABCDEF, you should check the option Send As Hex, and then send the command 1A to indicate the message to be sent is end. In this case, the message you input will be delivered actually.

For more detailed information about AT commands, please refer to File:SIM908_AT-Command-Manual.pdf

  • The running state of GPRS is shown as Figure 12.
GSM-GPRS-GPS-Shield-UserManual-12.png
Figure 12. GPRS running state

Used with Arduino UNO R3

Preparations

  • GSM/GPRS/GPS_Shield
  • Arduino UNO R3
  • SIM card
  • USB Type-B cable
  • PC serial monitor software
  • PC u-center software
  • 9V DC power supply

Hardware connection

GSM-GPRS-GPS-Shield-UserManual-13.jpg
Figure 13. Jumper settings for used with Arduino UNO R3
  • Tab 1: Serial transmitter selection CTL_TX
Set to CP2102 chip control: Connect USB_TX and CTL_TX with a jumper.
Set to Arduino serial: Connect Duino_TX and CTL_TX with a jumper.
  • Tab 2: Serial receiver selection CTL_RX
Set to CP2102 chip control: Connect USB_RX and CTL_RX with a jumper.
Set to Arduino serial: Connect Duino_RX and CTL_RX with a jumper.
  • Tab 3: Connect the NCP2890 enable pin (SPK_EN) and earphone checking pin with a jumper.
When the Earphone socket is plugged in with a earphone cable, CHK = 1. A3 stands for Arduino port A3.
  • Tab 4: SIM908 start up.
  • Tab 5: Motor control port (Motor)
RI: Ring indicator.
A4: Arduino port A4.
  • Tab 6: GPS Serial mode selection
GPS_EN: if GSP_EN = 0, the GPS serial port is selected, high level by default.
  • Tab 7: GSM Serial mode selection
GSM_EN: if GSM_EN = 0, the GSM serial port is selected, high level by default.
  • Plug in 6V~9V DC power supply
  • Plug in Arduino, of which serial port cable should be connected.

Software debugging

In this example, GPS mode is used for demonstration.

  • Open GPS.ino in the Arduino software.
  • Verify and upload the program to the Arduino R3 development board, and then run the Serial Monitor.
  • Press the DUINO RST button and the Serial Monitor will print:

GSM-GPRS-GPS-Shield-UserManual-16.png

  • u-center can also be used, instead of Arduino Serial Monitor, for serial communication.

Resources

Datasheets

Software

FAQ

Support

Mail.png Contact your seller (fast response and most recommended)

or send emails to service@waveshare.com (not fast enough but please be patient) for help.

Our working time: 09:00-18:00 (UTC+8 Monday to Saturday)