GSM/GPRS/GPS Shield (B)

From Waveshare Wiki
Jump to: navigation, search
GSM/GPRS/GPS Shield (B)
GSM/GPRS/GPS Shield (B), Arduino Shield Based on SIM808
GSM-GPRS-GPS-Shield-B-3.jpg

SIM868 module supports GSM, GPRS, GNSS, Bluetooth
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

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

Introduction

GSM/GPRS/GPS Shield (B), Arduino Shield Based on SIM808

More

How to use

Hardware description

Hardware connection
  1. SIM808 module
  2. MIC29302 power chip
  3. CP2102: USB TO UART converter
  4. SMF05C: TVS diode
  5. 1N5408: onboard rectifier
  6. SIM808 functional pins
  7. Arduino expansion connector
  8. USB TO UART interface
  9. DC power jack
  10. GPS antenna connector
  11. Bluetooth antenna connector
  12. Firmware upgrade interface
  13. GSM antenna connector
  14. SIM card slot
  15. 3.5mm earphone/mic jack
  16. GPS status indicator
  17. CP2102 UART Tx/Rx indicator
  18. NET indicator:
    flashes fast when the module starts up
    flashes slowly after GSM register succeed
  19. Power indicator
  20. Power switch
  21. SIM808 control button: press the button and hold for 1s, to startup/shutdown the SIM808
  22. Reset button
  23. UART selection switch, select controlling the SIM808 via:
    CP2102
    UART pins of Arduino interface
  24. SIM808 UART configuration:
    SIM_TX: SIM808 UART TX
    SIM_RX: SIM808 UART RX
  25. IOREF power selection: configure the UART voltage level

Getting started

Preparation

  • GSM/GPRS/GPS Shield (B) (this product)
  • SIM card
  • 5V TTL UART module
  • Serial monitor software (installed on your PC)
  • u-center software (of course also installed on your PC)
  • GSM antenna
  • GPS antenna
  • Bluetooth antenna
  • Micro USB cable
  • 9V DC adapter

Basic operation

We will demonstrate some basic operation by GSM mode in this section.

  1. Power up and the power indicator lights up.
  2. Switch to CP2102 (UART selection switch).
    Toggle the switch to the side of USB port by which setting communication between CP2102 and SIM808.
  3. Press the SIM808 control button and hold for 1s to startup the SIM808 until the NET indicator flashes.
  4. Run a serial monitor software and set as:
UART settings

a) UART settings

PortNum choose a COM Port (*)
BaudR 115200
Dpaity NONE
DataB 8 bit
StopB 1 bit

(*) You shall choose the COM Port listed in the Device Manager (This PC -> Properties -> Device Manager).

Configuration of sending
Send AT command to verify the module

b) Check the Auto Checksum and then an Apendix bits setting box pops up. Check the Fixed Byte Checksum and input 0D into the following box.

c) Input AT+GSV into the Sending box then click the button Send.

d) You can get the received information from the COM port data receive box.

GSM Debugging

GSM Commands Description

Frequently used commands for sending SMS

Command Description Response
AT Make sure the module is working properly. AT OK
AT+CNMI New SMS message indications, e.g. send: AT+CNMI=2,1 to setup new SMS message indications. When a new message is received and SIM card is not full, the SIM808 module will response via serial port, e.g. received: +CMTI:"SM",1 means a new message received was stored into the position 1 of the SIM card.
AT+CMGF=1 SMS Configuration AT+CMGF=1 OK
AT+CSCS Select TE Character Set
Send: AT+CSCS="GSM" to use GSM 7 bits default alphabet; Send: AT+CSCS="UCS2" to use 16-bit universal multiple-octet coded character set.
AT+CMGR Read SMS message
AT+CSMP Set SMS Text Mode Parameters. It should be set as AT+CSMP=17,167,2,25 for using UCS2 format.
AT+CMGS="phone number" Set the message transmission number and send SMS message. After receiving the symbol >, a message (end with 0x1A) can be sent out. >
0x1A This is a terminator. Before sending it out, you should check the option Send As Hex

(*) After sending the message, you should check the option Send As Hex, then send the command 1A which means to send a message. Besides, you can send 1B, ESC's ASCII, to cancel sending.

Sending English message
  • Sending messages using GSM default alphabet
Command Description
AT Make sure the module is working properly.
AT+CMGF=1 SMS Configuration.
AT+CMGS="phone number" Set the message transmission number and send SMS message. After receiving the symbol >, a message (end with 0x1A) can be sent out.
0x1A This is a terminator. Before sending it out, you should check the option Send As Hex
Receiving English message
  • Receiving messages using GSM default alphabet
command description
AT Make sure the module is working properly.
AT+CMGF=1 SMS Configuration.
AT+CSCS="GSM" Use GSM alphabet
AT+CNMI=2,1 Setup new SMS message indications
AT+CMGR=num Read SMS message. The num means the storage location of a message.
  • Sending messages using UCS2 character set
command description
AT Make sure the module is working properly.
AT+CMGF=1 SMS Configuration.
AT+CSMP=17,168,2,25 Set SMS Text Mode Parameters.
AT+CSCS="UCS2" Use UCS2 character set.
Use the software Unicode Converter Use a software to convert phone number and messages to Unicode.
AT+CMGS="a phone number in unicode" Set the phone number (in unicode). After receiving the symbol >, a message (end with 0x1A) can be sent out.
0x1A This is a terminator. Before sending it out, you should check the option Send As Hex
  • Receiving messages using UCS2 character set
command description
AT Make sure the module is working properly.
AT+CMGF=1 SMS Configuration.
AT+CSCS="GSM" Use GSM alphabet
AT+CNMI=2,1 Setup new SMS message indications
AT+CMGR=2 Read SMS message
Use the software Unicode Converter Use a software to convert messages to Unicode.
Unicode Converter
  • Frequently used commands for making and receiving calls.
command description Response
ATD13612345678; Dial 13612345678, end with semicolon(;). You can make a call. ATD13612345678 ok
AT+CLIP Calling line identification presentation AT+CLIP=1 OK
ATA Answer an Incoming Call RING
ATH Disconnect Existing Connection

(Please see SIM808_AT+Command+Manual_V1.01 for more details of AT commands)

GPS Debugging

Switching to GPS mode from GSM mode

Serial message receiving under GPS mode

1) Send the following commands:

  • AT+ CGNSPWR =1 (GPS power up)
  • AT+ CGNSTST =1 (GPS reset)

Return OK.

2) GPS signal output: Choose the GPS serial port.

See GPS information by u-center

u-center software
Set the port and baud
See GPS information
GPS location

1) Open u-center software.

2) Click the button Receiver to set Port or Baudrate. Baudrate is 12500 by default which can be set by the command AT+CGPSIPR. "Port" is the serial port in use.

3) Click Player to check the GPS information.

Remark: Please see the User Guide PDF for more details of u-center.

GPS Command Description

AT+CGNSPWR GPS power control =1, GPS power up
AT+CGNSINF Get current GPS location info often 32
T+CGPSSTATUS GPS status

(Please see SIM808_AT+Command+Manual_V1.01 for more details of AT commands)

GPRS Debugging

Local virtual servers settings

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.

  • 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 Command Description

1) The GPRS configuration can be performed by sending out following commands sequentially:

command Description
AT+CSQ Signal quality report
AT+CSTT="CMNET" Set APN as "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 Given Domain Name

2) GPRS debugging:

GPRS running state

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:

Command Description
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 >, a message (end with 0x1A) can be sent out
0x1A This is a terminator. Before sending it out, you should check the option Send As Hex
AT+CIPCLOSE Close TCP or UDP Connetion
AT+CIPSHUT Deactivate GPRS PDP Context

(*) After sending the message, you should check the option Send As Hex, then send the command 1A which means to send a message.

(Please see SIM808_AT+Command+Manual_V1.01 for more details of AT commands)

Bluetooth Debugging

Bluetooth Debugging

AT commands for Bluetooth debugging

Command Description
AT+BTPOWER=1 BT power control. =1, BT power up
AT+BTHOST? Inquiry and set host BT device name. Response: Name and MAC address
AT+BTSCAN=1,10 Scan surrounding BT device. Scanning time 10-60s (10s here)
AT+BTPAIR=1,1 Set BT pairing mode. To connect with a BT device, you need input

AT+BTPAIR=1,1 to confirm pairing request.

AT+BTACPT=1 There is a request that tries to build a SPP’s

connection.

AT+BTATD=10086 Dial up a voice call using BT device. Here 10086 is a phone number to be dialed.

How to use with Arduino UNO R3

Preparation

  • GSM/GPRS/GPS Shield (B) (this product)
  • Arduino UNO R3
  • SIM card
  • USB cable (type B)
  • Serial monitor software (installed on your PC)
  • u-center software (of course also installed on your PC)
  • GSM antenna
  • GPS antenna
  • Bluetooth antenna
  • 9V DC adapter

1) Operation

Arduino hardware connection
  • Tag 1: Connect a USB cable (type B) to your Arduino.
  • Tag 2: Connect a micro USB cable to the module.
  • Tag 3: DC power supply (6-9V).
  • Tag 4: Power up your board.
  • Tag 5: Set the VREF for your Arduino.
  • Tag 6: Connect a GPS antenna.
  • Tag 7: SIM808 control button.
    press the button and hold for 1s, to startup/shutdown the SIM808
  • Tag 8: Connect a BT antenna.
  • Tag 9: Connect a GSM antenna.
  • Tag 10: SIM808 UART configuration
    SIM_TX: SIM808 UART TX
    SIM_RX: SIM808 UART RX
  • Tag 11: Set the UART communication port, select controlling the SIM808 via:
    CP2102
    UART pins of Arduino interface

Software Debugging

Open GNSS.ino
Verify the program and open a serial monitor
Press RESET

For example, we use GPS by the steps:

  • Set the UART communication port to Arduino.
  • Press PWRKEY and hold for 1s to startup the SIM808.
  • Upload the program to your Arduino R3
  • Open Arduino's Serial Monitor.
  • Press RESET

Or use the software u-center instead of Serial Monitor.

How to use with NUCLEO-F401RE

Preparation

  • GSM/GPRS/GPS Shield (B) (this product)
  • NUCLEO-F401RE
  • ST-LINK Debugger
  • Micro USB cable
  • Serial monitor software (installed on your PC)
  • u-center software (of course also installed on your PC)
  • 9V DC adapter

1) Operation

NUCLEO-F401RE hardware connection
  • Tag 1: SIM808 UART configuration
    SIM_TX: SIM808 UART TX
    SIM_RX: SIM808 UART RX
  • Tag 2: Connect a micro USB cable to the serial port of Nucleo board.
  • Tag 3: DC power supply (6-9V).
  • Tag 4: Jumper settings: Enable the communication between STM32 MCU and this product.
    RX---PA3
    TX---PA2
  • Tag 5: Jumper settings: Enable the communication between CP2102 and STM32 MCU.
    RX---PC7
    TX---PC6
  • Tag 6: Power up your board.
  • Tag 7: Set the VREF for your Nucleo.
  • Tag 8: Connect a GPS antenna.
  • Tag 9: SIM808 control button.
    press the button and hold for 1s, to startup/shutdown the SIM808
  • Tag 10: Connect a BT antenna.
  • Tag 11: Connect a GSM antenna.
  • Tag 12: SIM808 UART configuration
    SIM_TX: SIM808 UART TX
    SIM_RX: SIM808 UART RX

Software Debugging

For example, we use GPS by the steps:

  • Download the program to your NUCLEO-F401RE using ST-LINK.
  • Press the RESET button.
  • Download the program to your Nucleo.
  • Open serial monitor software. Choose the serial port and set the baudrate as 115200. Press RESET and get info.
  • Or use the software u-center instead of serial monitor software.
  • Compile and download the project GSP.uvproj by Keil MDK
  • Get the serial information using a serial monitor software
  • See GPS information by u-center

Resources

Datasheets

GSM808 Related

Other chips

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)