DIYmall GPRS/GPS SIM908 Module - AT Commands

DIYmall GPRS/GPS SIM908 Module - AT Commands

Directions on how to setup your DIYmall GPRS/GPS SIM908 Module so that you can issue AT commands from your computer.

  • 9,294 views
  • 5 comments
  • 14 respects

Components and supplies

About this project

Background

The purpose of this project is to provide directions on how to setup the DIYmall GPRS/GPS SIM908 Module so that you can issue AT commands and begin to play around with the functionality of the board.

For Arduino connectivity, I lay out two options.  The first option makes the UNO act like a USB to TTL converter basically so you can communicate directly, but the UNO itself doesn't run any code.  The second option uses SoftwareSerial to communicate between the computer and board.


GPRS/GPS Board Preparation

- Insert SIM card ( from what I can tell the board will NOT respond without a SIM card

- Connect antennas

- Connect power, leave power switch off for now  


Option 1 - Direct ( Arduino UNO as TTL converter )

Disclaimer: I know this works, but I can't promise it will not cause any long term problems.


Arduino Preparation (Option 1)

- Load an empty sketch onto your UNO (just to clear out any existing code)

- On the Arduino UNO, connect RESET to GND with a jumper.  This basically makes the board act like a USB to TTL converter.


Wiring (Option 1)

NOTE: On the SIM908 board, there are two 4-pin headers next to the DC power jack labeled J5 and J6.   The two GPRS pins are on the same row.

Sim908 board <> UNO

GPRS TX (J6) <> D1

GPRS RX (J5) <> D0

VCC_MCU (J5) <> 5V

GND (J5) <> GND


Test the setup (Option 1)

1) Connect UNO to computer USB for power and data

2) Open Arduino IDE serial monitor, set baud to 115200

3) On the SIM908 board, turn on the power switch (one red LED should light up)

4) On the SIM908 board, press the power button for a few seconds

5) Notice there is a blinking LED near the GSM antenna, this will blink slower (once every 3 seconds I think) once the board is connected

6) You might see a few status updates in the serial monitor.  Type "AT" in the box and hit "Send" the board should respond "OK".

If you see the "OK" response, congratulations your board is responding!  At this point I would recommend sending the following commands:

AT+IPR? // This command will show you the baud rate of the serial connection.  It should be 115200, the default.

AT+IPR=0 // This command will set the board to automatically negotiate rate

AT+IPR? // Confirm the command worked.


Option 2 - SoftwareSerial

NOTE: SoftwareSerial doesn't seem stable at 115200 baud, so I went with 57600.


Arduino Preparation (Option 2)

NOTE: If you did option 1, remove the GND <> RESET jumper.  

Load my sample code on your board.  My code issues the "AT+IPR=0" command mentioned in option 1 to set the baud rate to "auto".


Wiring (Option 2) 

NOTE: On the SIM908 board, there are two 4-pin headers next to the DC power jack labeled J5 and J6. The two GPRS pins are on the same row.  

Sim908 board <> UNO  

GPRS TX (J6) <> D2

GPRS RX (J5) <> D3

VCC_MCU (J5) <> 5V

GND (J5) <> GND


Test the setup (Option 2)

1) Connect UNO to computer USB for power and data  

2) Open Arduino IDE serial monitor, set baud to 57600.  You will probably see a message in the serial monitor, don't worry about that for now.

3) On the SIM908 board, turn on the power switch (one red LED should light up)

4) On the SIM908 board, press the power button for a few seconds

5) Notice there is a blinking LED near the GSM antenna, this will blink slower (once every 3 seconds I think) once the board is connected

6) Press the reset button on your Arduino.

7) Type "AT" in the box and hit "Send" the board should respond "OK".


If you see the "OK" response, congratulations your board is responding!  


What next?

After you completed option 1 and/or option 2, you hopefully are able to issue AT commands to your board.  You should be able to find documentation for the AT commands for this SIM908 to play around with various options.


Online AT Command Tester

I ran across an online (Java based) site that lets you issue AT commands to your board.

Link: http://m2msupport.net/m2msupport/module-tester/


From the page above, you can set your COM port and baud to connect.  You should be able to use 57600 baud.  Once you click "Connect" , the "Connection" in the top right will populate with the following (or something similar):

Device Model: SIMCOM_SIM908>Manufacturer: SIMCOM_Ltd>Status: Connected

Under "Diagnostics" you can play around with various commands, but be careful I don't know what all of these do!  I was able to send an SMS which was a good way to ensure my GSM connection was working.

Code

Arduino UNO CodeC/C++
Use for option 2
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX

void setup()
{
  // Open serial communications to computer
  Serial.begin(57600);

  mySerial.begin(115200); // Default for the board
  mySerial.println("AT+IPR=0");  // Set baud to auto connect
  delay(100); // Let the command run
  mySerial.begin(57600); // Reconnect at lower baud, 115200 had issues with SoftwareSerial
  
  //Clear out any waiting serial data
  while (mySerial.available())
  {
    mySerial.read();
  }  
}

void loop()
{
  /*
   * This loop just takes whatever comes in from the console and sends it to the board
   */
  if (Serial.available())
  {
    mySerial.write(Serial.read());
  }
  if (mySerial.available())
  {
    Serial.write(mySerial.read());
  }
}

Comments

Similar projects you might like

LED Emergency Lights using WS2812 RGB LED Module

Project tutorial by bigboystoys13

  • 10,004 views
  • 5 comments
  • 20 respects

Air Meter Making #1: Use The Arduino Wi-Fi Module ESP-01

by 4 developers

  • 4,205 views
  • 1 comment
  • 11 respects

Air Meter Making #2: Use the Arduino DHT 11 Module

by 4 developers

  • 3,528 views
  • 4 comments
  • 10 respects
Add projectSign up / Login