Getting Started with Duinopeak SIM808 GPRS/GSM+GPS Shield-GPS Positioning

Prepare

Hardware

Required hardware as below:

  • Duinopeak SIM808 GPRS/GSM+GPS+Bluetooth all in one Shield
  • Active GPS Antenna
  • 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 Duinopeak_Arduino_SIMCom 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.

Note:

  • Make sure your external antenna has a good sight to receive the GPS signal, put the antenna outside the window of your room is need for this step.
  • The sketch use Software Serial PIN_TX 2,PIN_RX 3, so make sure you set the Serial jumper in correct postion.
  • 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 Duinopeak_Arduino_SIMCOM libarary files first, then load the test sketch and upload to your Peakduino/Arduino UNO.

Here’s a quick example, which uses the Duinopeak_Arduino_SIMCom library to parse NMEA strings for position, altitude, time, and date.

#include “SIM900.h”
#include <SoftwareSerial.h>
//#include “inetGSM.h”
//#include “sms.h”
//#include “call.h”
#include “gps.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 start a connection as client.

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

char lon[15];
char lat[15];
char alt[15];
char time[20];
char vel[15];
char msg1[5];
char msg2[5];

char stat;
char inSerial[20];
int i = 0;
boolean started = false;
#define BAUDRATE  9600

void setup()
{
//Serial connection.
Serial.begin(BAUDRATE);
Serial.println(“SIM808 Shield GPS testing.”);
//Start configuration of shield with baudrate.
//For http uses is raccomanded to use 4800 or slower.
if (gsm.begin(BAUDRATE)) {
Serial.println(“\nstatus=READY”);
gsm.forceON();    //To ensure that SIM908 is not only in charge mode
started = true;
} else Serial.println(“\nstatus=IDLE”);

if (started) {
if (gps.attachGPS()) //GPS attach
Serial.println(“status=GPSREADY”);
else Serial.println(“status=ERROR”);
stat = gps.getStat();
while (stat != 3 && stat != 2) {
stat = gps.getStat();
if (stat == 1)
Serial.println(“NOT FIXED”);
else if (stat == 0)
Serial.println(“GPS OFF”);
else if (stat == 2)
Serial.println(“2D FIXED”);
else if (stat == 3)
Serial.println(“3D FIXED”);
delay(3000);
}
delay(3000);
//Get data from GPS
gps.getPar(lon, lat, alt, time, vel);
Serial.println(lon);
Serial.println(lat);
Serial.println(alt);
Serial.println(time);
Serial.println(vel);
}
};

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(“BATTERY TEST 1”);
//      gps.getBattInf(msg1,msg2);
//      Serial.println(msg1);
//      Serial.println(msg2);
//      Serial.println(“BATTERY TEST 2”);
//      gps.getBattTVol(msg1);
//      Serial.println(msg1);
stat = gps.getStat();
if (stat == 1)
Serial.println(“NOT FIXED”);
else if (stat == 0)
Serial.println(“GPS OFF”);
else if (stat == 2)
Serial.println(“2D FIXED”);
else if (stat == 3)
Serial.println(“3D FIXED”);
}
//Read last message saved.
if (!strcmp(inSerial, “MSG”)) {
Serial.println(msg1);
} else {
Serial.println(inSerial);
gsm.SimpleWriteln(inSerial);
}
inSerial[0] = ‘\0’;
}
}

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

Open Arduino IDE and load the KZB_0030_SIM808_GPS sketch and upload to your Peakduino/Arduino.

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.

If not check the pwr jumper location on the shield back side.

Then the program wait for 2D/3D fixing signal, this will taken 20 seconds-5 mins depending on your GPS signal strength. A successful fixed GPS postioning will look something like this:

Getting Started with Duinopeak SIM808 GPRS/GSM+GPS Shield-Call up

Make sure your got everyting ready, if not see Hookup Guide and AT Commands Simple Test, 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 open the Arduino IDE and load the GPRS Call Up Test sketch and upload to your Peakduino/Arduino UNO.

/*
GPRS Call Up Test

This sketch is used to test seeeduino GPRS_Shield’s callUp function.
to make it work, you should insert SIM card to Duinopeak GPRS
and replace the phoneNumber,enjoy it!

create on 2015/12/5, version: 0.1
by kevin liu(lryain.master@gmail.com)
*/

#include “SIM900.h”
#include <SoftwareSerial.h>
//We don’t need the http functions. So we can disable the next line.
//#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 call up

//We have to create the classes for SMSs and calls.
CallGSM call;
SMSGSM sms;

char number[20];
char phoneNumber[20] = “10086”;
byte stat = 0;
int value = 0;
int pin = 1;
char value_str[5];
#define BAUDRATE  9600

void setup()
{
//Serial connection.
Serial.begin(BAUDRATE);
Serial.println(“SIM808 Shield Call up testing.”);
//Start configuration of shield with baudrate.
//For http uses is raccomanded to use 4800 or slower.
if (gsm.begin(BAUDRATE))
Serial.println(“\nstatus=READY”);
else Serial.println(“\nstatus=IDLE”);
delay(3000);
Serial.println(“start to call …”);
call.Call(phoneNumber);
delay(30000);
Serial.println(“end up the call …”);

}

void loop() {
//nothing to do
}

O

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.

 

Now, you should hear the ring up tones.

Getting Started with Duinopeak SIM808 GPRS/GSM+GPS Shield-Hookup and 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!

Getting Started with Duinopeak SIM808 GPRS/GSM+GPS Shield-Overview

Introduction

SIM808 shield is a GSM and GPS plus Bluetooth three-in-one function shield for Peakduino/Arduino. It is based on the latest GSM/GPS/Bluetooth(optional) module SIM808 from SIMCOM, supports GSM/GPRS Quad-Band network and combines GPS technology for satellite navigation.It has high GPS receive sensitivity with 22 tracking and 66 acquisition receiver channels. Besides, it also supports A-GPS that available for indoor localization and bluetooth 3.0.

The GPRS/GSM Shield is configured and controlled via its UART using simple AT commands. Based on the SIM900 module from SIMCOM, it is like a cell phone. Besides the communications features, the GPRS/GSM Shield has 6 GPIOs, 2 PWMs and an ADC.

The module is controlled by AT command via UART and supports 3.3V and 5V logical level.

Feature

  • Quad-band 850/900/1800/1900MHz
  • GPRS multi-slot class12 connectivity: max. 85.6kbps(down-load/up-load)
  • GPRS mobile station class B
  • Controlled by AT Command (3GPP TS 27.007, 27.005 and SIMCOM enhanced AT Commands)
  • Supports Real Time Clock
  • Supply voltage range 5V ~ 12V
  • Integrated GPS/CNSS and supports A-GPS
  • Support Bluetooth 3.0
  • Onboard 3.0V to 5.0V logic level converter
  • Low power consumption, 1mA in sleep mode
  • Supports GPS NMEA protocol
  • Standard Micro SIM Card
  • Onboard USB port for firmware upgrade only(not for serial debug)

For details please refer to the SIM808 SPEC_V1507 doc.

Applications

  • M2M (Machine 2 Machine) Applicatoions – To transfer control data using SMS or GPRS between two machines located at two different factories.
  • Remote control of appliances – Send SMS while you are at your office to turn on or off your washing machine at home.
  • Remote Weather station or a Wireless Sensor Network – Make it with Peakduino and create a sensor node capable of transferring sensor data (like from a weather station – temperature, humidity etc.) to a web server (like pachube.com).
  • Vehicle Tracking System – Install GPRS+GSM+GPS Shield in your car and publish your location live on the internet. Can be used as a automotive burglar alarm.

Cautions

  • Make sure your SIM card is unlocked.
  • The product is provided as is without an insulating enclosure. Please observe ESD precautions specially in dry (low humidity) weather.
  • The factory default setting for the GPRS Shield UART is 19200 bps 8-N-1. (Can be changed using AT commands).

Here’s a quick overview of each pin mapping:

Pin Label In/Out Board Connection Pin Description
GND In Ground SIM808 module ground (0V reference)
SIM_RST In Arduino D9 Reset the SIM808 module
SIM_DTR In Arduino D8 Data terminal ready
SIM_PWR In Arduino D7 Enable or Disable the SIM module
RX In Arduino D0-D4 Serial data input
TX Out Arduino D0-D4 Serial data output
SIM_RI Out Arduino D6 Ring indicator – Output Low when incoming calls
VRTC In The button battery Backup power – keeps the RTC running (2.7-3.3V input range)
VBAT In On-board 4.0V regulator 4.0V power supply input

Layout:

Resources