Build Your Own Vehicle Tracking System using Arduino (Start with Sim808 )
This article describes SIM808 hardware interface in great detail. This article can help user to quickly understand SIM808 interface specifications, electrical and mechanical details. With the help of this articles and other SIM808 application notes, user guide, users can use SIM808 to design various applications quickly.
Designed for a global market, SIM808 is integrated with a high-performance GSM/GPRS engine, a GPS engine and a BT engine. SIM808 is a quad-band GSM/GPRS module that works on frequencies GSM 850MHz, EGSM 900MHz, DCS 1800MHz and PCS 1900MHz. SIM808 features GPRS multi-slot class 12/ class 10 (optional) and supports the GPRS coding schemes CS-1, CS-2, CS-3 and CS-4. The GPS solution offers best-in-class acquisition and tracking sensitivity, Time-To-First-Fix (TTFF) and accuracy.
With a tiny configuration of 24242.6mm, SIM808 can meet almost all space requirements in users’ applications, such as M2M, smartphone, PDA, tracker and other mobile devices.
Why with SIM808?
SIM808 has 68 SMT pads, which provide all hardware interfaces between the module and customers’ boards.
- Support 4*4keypads by default
- One full modem serial port (UART interface)
- One USB, which support debug and firmware upgrading.
- Audio channels which include a microphone input and a receiver output.
- One SIM card interface.
- Charging interface.
- Programmable general purpose input and output (GPIO).
- Support Bluetooth function.
- Support GPS function.
- Support two PWMs and two ADCs.
- PCM/SPI interface.
- SIM808 is designed with power saving technique so that the current consumption is as low as 1.2mA in sleep mode (with GPS engine powered down).
- SIM808 integrates TCP/IP protocol and extended TCP/IP AT commands which are very useful for data transfer applications.
How to connect SIM 808 Module with Arduino UNO?
Hardware and Software Required
SIM 808 Module ( Buy here )
The SIM808 module has to be connected to Uno as follows:
Vcc to 5V
Gnd to Gnd
RXD to digital pin 10
TXD to digital pin 11
When the board is power on, the LED (PWR) will light up. After a long press (about 2 second) on this button, the other three LEDs(D3, D4,D5) will be light. And one of them starts to flash, this suggests that SIM808 is beginning to work now. When the power supply, GSM and GPS antenna and SIM card are connected to the module correctly, the LED will be flash slowly (3Second delay), that indicates that the module is registered to the network, and the user can make a call or do something else.
AT Commands for using the SIM808 Module
AT Commands for GSM
AT Press ENTER
Checking the Operation and Connection of GSM Shield. This would print OK which signifies of working connection and operation of the GSM shield.
ATD+ (country code) mobile number; Press ENTER
Making a Voice Call
ATH Press ENTER
Disconnecting the Active Call
ATA Press ENTER
Receiving the Call
AT+CMGF=1 Press ENTER
For sending SMS in text Mode
AT+CMGS=” mobile number” Press ENTER
Once the AT commands is given’ >’ prompt will be displayed on the screen. Type the message to be sent via SMS. After this, Press CTRL+Z to send the SMS. If the SMS sending is successful, “OK” will be displayed along with the message number.
AT+CMGF = 1 Press ENTER
For reading SMS in the text mode
AT+CMGR = num
Number (num.) is the message index number stored in the SIM card. For new SMS, URC will be received on the screen as + CMTI: SM ‘num’. After this AT+CMGR=1 Press ENTER. This displays the message on the screen along with sender details, number and timing too. For more AT commands, visit here
AT Commands for Bluetooth
Send pairing request to other Bluetooth device
Power on BT radio
Inquiring surrounding BT device
Try to pair the sixth BT device in the view list.(0,6 denotes the 6th BT device)
Answer to the pairing request in passkey mode
Accept request from other BlueTooth device
Power on BT radio
Accept pairing request, and paired successfully
Accept pairing request, and paired successfully. Default passkey of other BT device is 0000.
Connect with the second profile service of first paired device.
Accept file from paired device
Accept file (stored in internal memory card by default, input “AT+BTOPPACPT=1,1” if want it stored in external memory
Send file to other paired BT device
LETS Program with Arduino UNO
Note: if you are Beginner please follow my previous article so then you can learn how to setup Arduino UNO Beginner Guide for Adruino
Upload this Code
#define MESSAGE_LENGTH 160
int messageIndex = 0;
#define PIN_TX 10
#define PIN_RX 11
DFRobot_SIM808 sim808(&mySerial);//Connect RX,TX,PWR,
//******** Initialize sim808 module *************
Serial.print(“Sim808 init error\r\n”);
Serial.println(“Open the GPS power success”);
Serial.println(“Open the GPS power failure”);
Serial.println(“Init Success, please send SMS message to me!”);
//*********** Detecting unread SMS ************************
messageIndex = sim808.isSMSunread();
//*********** At least, there is one UNREAD SMS ***********
if (messageIndex > 0)
sim808.readSMS(messageIndex, message, MESSAGE_LENGTH, phone, datetime);
//***********In order not to full SIM Memory, is better to delete it**********
Serial.print(“From number: “);
Serial.print(“Recieved Message: “);
float la = sim808.GPSdata.lat;
float lo = sim808.GPSdata.lon;
float ws = sim808.GPSdata.speed_kph;
dtostrf(la, 6, 2, lat); //put float value of la into char array of lat. 6 = number of digits before decimal sign. 2 = number of digits after the decimal sign.
dtostrf(lo, 6, 2, lon); //put float value of lo into char array of lon
dtostrf(ws, 6, 2, wspeed); //put float value of ws into char array of wspeed
sprintf(MESSAGE, “Latitude : %s\nLongitude : %s\nWind Speed : %s kph\nMy Module Is Working. Mewan Indula Pathirage. Try With This Link.\nhttp://www.latlong.net/Show-Latitude-Longitude.html\nhttp://maps.google.com/maps?q=%s,%s\n”, lat, lon, wspeed, lat, lon);
Serial.println(“Sim808 init success”);
Serial.println(“Start to send message …”);
//************* Turn off the GPS power ************
After upload code to Arduino via Arduino IDE open the Serial Monitor in 9600 Serial Monitor so you can get the information that hardware their and send the text to the SIM808 and it will text back you with the longitude and latitude of real time location, as well as you will get the google map link in the return text. As the mention image Below
Here is the video tutorial let me know if you face any problem with it
Hope my article “Build Your Own Vehicle Tracking System using Arduino (Start with Sim808 )” helps you to Start with Sim808 with Arduino UNO/How to Build Vehicle Tracking System.