Introduction
In this article, I create a powerful GPS tracking device using Arduino and the Sim800L GSM module. This simple yet effective project allows you to track the location of any object in real time using SMS alerts.
Bill of Material
S.N | Component | Quantity |
1 | Arduino Nano | 1 |
2 | Sim800l GSM Module | 1 |
3 | Neo 6M GPS Module | 1 |
4 | Push button | 1 |
5 | 10k resister | 1 |
6 | 3.7v lithium ion Battery | 1 |
7 | Switch | 1 |
SIM800l GSM Module, designed by Simcom. This module operates at a voltage of 3.4v to 4.4v, it is powered directly with a lithium-ion battery and LM2596 step-down converter.
- it also features auto baud rate detection.
- it supports both GSM And GPRS features.
- it comes with an IPX antenna interface that allows switching between a PCB antenna and a suction cup antenna.
Note – The Module is compatible with any 2G-3G SIM card.
Led status indicator
The sim800l module has an LED indicator that shows the network conduction.
Blinking every 1 second – The module is powered on but not connected to the network.
Blinking every 2 seconds – The GPRS data connection is active and ready for data Transfer.
Blinking every 3 seconds – The Module is connected to a network and ready to send/receive SMS messages And Calls.
Neo 6M GPS Module
The Neo-6M GPS module is developed by U-blox.
The GPS Module in Full form is (the Global Positioning System) it uses 31 satellites orbiting Earth to transmit location and date/time.
Led indicator
on the neo-6M GPS Module Board, there’s is a small LED that shows the condition of communication status with satellite:
- No, blinking means the GPS module is searching for satellites.
- Blinking Every 1 Second Means the position is fixed and is connected to the satellite.
Check awesome GPS Based Projects
3.7v Battery
Push Button
Circuit Diagram
- In this circuit diagram, we connect all the components properly Like the Neo-6M GPS Module connected to the PINs D10 And D11.
- Sim800l GSM Module connected to the Pin Numbers D2 And D3.
- Push button Connected to the Pin Number D5.
NOTE– Here I used the 3.7v lithium-ion Battery to separate the power source of the sim800l GSM Module Because the sim800l module required only 3.4v to 4.4v.
Code
Before uploading the code just add the TinyGPS++ library
Now Select the proper board and upload the Code…..
Now Change the Mobile Number Select the proper board and upload the Code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
//Prateek //www.justdoelectronics.com #include <TinyGPS++.h> #include <SoftwareSerial.h> SoftwareSerial GSM(2, 3); SoftwareSerial neo(10, 11); String textMessage; String lampState; String lati = ""; String longi = ""; int led = 13; int state; TinyGPSPlus gps; void setup() { pinMode(led, OUTPUT); pinMode(5, INPUT); Serial.begin(9600); GSM.begin(9600); neo.begin(9600); GSM.listen(); delay(5000); digitalWrite(led, HIGH); Serial.print("GSM ready...\r\n"); GSM.print("AT+CMGF=1\r\n"); delay(1000); GSM.print("AT+CNMI=2,2,0,0,0\r\n"); delay(1000); digitalWrite(led, LOW); } void loop() { delay(2); while (GSM.available() > 0) { digitalWrite(led, HIGH); textMessage = GSM.readString(); Serial.print(textMessage); delay(10); digitalWrite(led, LOW); } neo.listen(); state = digitalRead(5); if (state == 0) { smartDelay(1000); Serial.println("GPS data Recived\r\n"); textMessage = ""; GSM.println("AT+CMGS=\"+9188305848xx\""); //put correct mobile number delay(500); String pesan = "https://maps.google.com/?q=" + lati + "," + longi; GSM.print(pesan); GSM.write(0x1a); delay(1000); GSM.println("AT+CMGD=1,4"); } if (textMessage.indexOf("GETLOC") >= 0) { smartDelay(1000); Serial.println("GPS data Recived\r\n"); textMessage = ""; GSM.println("AT+CMGS=\"+9188305848xx\""); delay(500); String pesan = "https://maps.google.com/?q=" + lati + "," + longi; GSM.write(0x1a); delay(1000); GSM.println("AT+CMGD=1,4"); } } static void smartDelay(unsigned long ms) { unsigned long start = millis(); do { delay(2); while (neo.available()) gps.encode(neo.read()); } while (millis() - start < ms); lati = String(gps.location.lat(), 8); longi = String(gps.location.lng(), 6); Serial.println(lati); Serial.println(longi); } |
Full Project Report
Overview
when I press the SOS Button Then The SMS Will Received
when I Send the GETLOC Text message to GSM Module Then The SMS Will Received
Hello, please provide a link to download the library!