Thousands of cars are being stolen every day around the globe. So it is really important to protect and secure your car. In this tutorial we will use the SIM808 module to build a GPS car tracker.
If you are not willing to use a GPS read this article to find out how to detect location by GSM modules: (Using GSM with Arduino as an alternative for GPS).
What You Will Learn
What is GPS and how does it work?
GPS stands for Global Positioning System, which designed and built in 1973 by the United States Department of Defense. Today, the use of GPS has become so common that almost all of us use this system daily.
The GPS system includes 24 satellites. For the car tracker project (or any other project) you need a GPS receiver to receive information sent from this satellite. All your GPS receiver has to do is identify four satellites and read information from them to calculate your position with a series of geometric relationships.
GPS can provide your position with very high accuracy, but the satisfaction of this accuracy depends on your GPS receiver, typical GPS modules have an accuracy of between 2 and 5 meters.
The most important information we can get from the GPS system are: longitude, latitude, speed, height and time in Greenwich Mean Time.
Ublox is a leading company in the industry of manufacturing GPS modules, but to receive GPS information, we can also use the SIM808 module manufactured by SIMCOM.
What is SIM808 module?
We usually used a series of SIM modules for sending and receiving SMS, making calls, using GPRS, etc., but the SIM808 module has a special feature and that is GPS receiver. This feature makes this module very useful for making all kinds of trackers. In this tutorial, you will learn how to connect SIM808 module and Arduino and make a car tracker.
This module is provided in a package with GPS and GSM antennas as shown below.
SIM808 Module Pinout
SIM808 module uses serial communication protocol to interface with Arduino. This module has 10 pins. 4 are the main pins and the rest are connected to those 4 pins.
4 Main Pins on the Left Side:
- TX: Transmitting Data
- RX: Receiving Data
- VIN: Input voltage (this pin is connected to the jack plug, and if the adapter is connected, no power needs to be supplied here.)
- GND: Ground
You can see the pinout of this module in the image below.
Interfacing SIM808 Module with Arduino
Connect GPS and GSM antennas and adapter to the module as shown below.
Insert the SIM card in the card slot in the back of the module.
The following circuit shows how you should connect Arduino to SIM808 module. Connect wires accordingly.
After connecting the power supply, you must press the vertical button as shown below for at least one second.
Biuld a Car Tracker with Arduino and SIM808 Module
After completing the previous steps, now we are ready to build a tracker. In this project, we have used AT commands to write the code for the car tracking system. We have also used the TinyGPS ++ library to analyze the GPS data received from the SIM808 module.
In this project, the car tracking system first waits to receive a message. After that, it matches the received text with the predefined password. Then, if the password is correct, the tracker system will be activated, and it will obtain the vehicle location data. Finally, the Google Maps link will be sent to you.
Upload the following code to Arduino.
/* Made on Jan 9, 2021 By MehranMaleki @ Electropeak
At the beginning of this code, the password is specified. By sending the correct password to the car tracking system, a text message will be sent to you including the car Google Maps link.
The Google Maps link is similar to this:
Click on the link, then you can see the car location in the Google Maps website.
If the password is incorrect, a text message will be sent to you including: “The password is incorrect.”
- Upload the received information to the server.