GPS Tracker using Arduino and SIM800L
The GPS Tracker using Arduino and SIM800L project is a device that allows you to track the location of a vehicle or any other object in real-time. The project is built using an Arduino board and a SIM800L module, which is a GSM/GPRS module that can be used to send and receive SMS messages and make phone calls.
The project uses the GPS module to get the location coordinates (latitude and longitude) of the device and sends it to the SIM800L module. The SIM800L module then sends the location coordinates to a designated phone number using the GPRS feature of the module.
Here is a basic outline of how the project works:
The Arduino board is connected to the GPS module and the SIM800L module.
The GPS module is used to get the location coordinates of the device.
The Arduino board reads the location coordinates and sends them to the SIM800L module.
The SIM800L module uses the GPRS feature to send the location coordinates to a designated phone number.
The user can track the location of the device by receiving the location coordinates on their phone.
The project can be easily customized to suit your needs. For example, you can add a button to the device to send the location coordinates on demand, or you can set a time interval for the device to send the location coordinates automatically.
To build this project you will need an Arduino board, a SIM800L module, a GPS module and a power source such as a battery. You will also need a SIM card with GPRS and SMS services enabled, and a phone number to receive the location coordinates.
It is important to note that the project requires some basic knowledge of programming and electronics. Additionally, you may need to consult the documentation of the specific modules and components you are using to properly wire and program them.
shematic:

code:
#include <SoftwareSerial.h>
#include <TinyGPS++.h>
SoftwareSerial gpsSerial(2, 3); // RX, TX
TinyGPSPlus gps;
#define SIM800L_RX 4
#define SIM800L_TX 5
SoftwareSerial sim800lSerial(SIM800L_RX, SIM800L_TX);
void setup() {
Serial.begin(9600);
gpsSerial.begin(9600);
sim800lSerial.begin(9600);
// Send AT command to SIM800L to ensure it is awake
sim800lSerial.println("AT");
delay(1000);
sim800lSerial.flush();
// Send AT command to SIM800L to enable GPS
sim800lSerial.println("AT+CGNSPWR=1");
delay(1000);
sim800lSerial.flush();
// Send AT command to SIM800L to get GPS data
sim800lSerial.println("AT+CGNSINF");
delay(1000);
sim800lSerial.flush();
}
void loop() {
// Read data from GPS module
while (gpsSerial.available()) {
gps.encode(gpsSerial.read());
}
// Read data from SIM800L
while (sim800lSerial.available()) {
String gpsData = sim800lSerial.readString();
if (gpsData.indexOf("+CGNSINF:") >= 0) {
// Extract latitude, longitude, and time
int latStart = gpsData.indexOf(",") + 1;
int latEnd = gpsData.indexOf(",", latStart);
String latitude = gpsData.substring(latStart, latEnd);
int lonStart = latEnd + 1;
int lonEnd = gpsData.indexOf(",", lonStart);
String longitude = gpsData.substring(lonStart, lonEnd);
int timeStart = gpsData.lastIndexOf(",") + 1;
int timeEnd = gpsData.length();
String time = gpsData.substring(timeStart, timeEnd);
// Print latitude, longitude, and time to serial monitor
Serial.print("Latitude: ");
Serial.println(latitude);
Serial.print("Longitude: ");
Serial.println(longitude);
Serial.print("Time: ");
Serial.println(time);
}
}
delay(1000);
}