Hookup Guide and AT Commands Simple Test

As we know, this Duinopeak SIM808 Shield design for use as an extension board of Peakduino/Arduino UNO, and it requires a external power supply.

Prepare

Hardware

Required hardware as below:

  • Duinopeak SIM808 GPRS/GSM+GPS+Bluetooth all in one Shield
  • GSM/GPRS Antenna 
  • SIM Card converter set
  • Your A Smart phone headset(with microphone)
  • Your SIM card
  • An Peakduino UNO or Arduino UNO
  • USB cable for your Peakduino UNO or Arduino UNO
  • 12V/9V/1.5A Power supply

Software

  • Arduino IDE(recommended version 1.56r2 or above)
  • Libraries for Duinopeak SIM808 Shield (For GPRS libarary please download here, or on github)

Make sure your got everyting, let's get started.

First of all we need hook up the hardware as below.

Hook up the shield. Insert the SIM card and make sure the power pin solder jumper closed.

Remember to plug the external power supply to your Arduino/Peakduino UNO, if you use Peakduino the VIN led should be light up.

Now setup the programming environment. You need install the libarary files first, then load the test sketch and upload to your Peakduino/Arduino UNO.

#include "SIM900.h"
#include <SoftwareSerial.h>
//#include "inetGSM.h"
//#include "sms.h"
//#include "call.h"

//To change pins for Software Serial, use the two lines in GSM.cpp.

//GSM Shield for Arduino
//www.duinopeak.com
//this code is based on the example of Arduino Labs.

//Simple sketch to communicate with SIM900 through AT commands.

//InetGSM inet;
//CallGSM call;
//SMSGSM sms;

int numdata;
char inSerial[40];
int i=0;

void setup()
{
     //Serial connection.
     Serial.begin(9600);
     Serial.println("GSM Shield testing.");
     //Start configuration of shield with baudrate.
     //For http uses is raccomanded to use 4800 or slower.
     if (gsm.begin(9600))
          Serial.println("\nstatus=READY");
     else Serial.println("\nstatus=IDLE");
};

void loop()
{
     //Read for new byte on serial hardware,
     //and write them on NewSoftSerial.
     serialhwread();
     //Read for new byte on NewSoftSerial.
     serialswread();
};

void serialhwread()
{
     i=0;
     if (Serial.available() > 0) {
          while (Serial.available() > 0) {
               inSerial[i]=(Serial.read());
               delay(10);
               i++;
          }

          inSerial[i]='\0';
          if(!strcmp(inSerial,"/END")) {
               Serial.println("_");
               inSerial[0]=0x1a;
               inSerial[1]='\0';
               gsm.SimpleWriteln(inSerial);
          }
          //Send a saved AT command using serial port.
          if(!strcmp(inSerial,"TEST")) {
               Serial.println("SIGNAL QUALITY");
               gsm.SimpleWriteln("AT+CSQ");
          } else {
               Serial.println(inSerial);
               gsm.SimpleWriteln(inSerial);
          }
          inSerial[0]='\0';
     }
}

void serialswread()
{
     gsm.SimpleRead();
}

Open the serial monitor when upload done, you will see the SIM808 shield automatic powering on and the status LED(important) light up, as below image.

Try a command "AT" it returns "OK" as narmal response.

 

 

Now, this simple test can verify evething is OK and ready to use, congratulations!

Book type: