Build Your Smart GPS Tracker System Using Arduino
GPS Tracker Using Arduino
Introduction
GPS System is very commonly used in every field Like Vehicle Tracking, Human Tracking, Ship Tracking, And Bicycle Tracking System. In this tutorial, I will also create a small GPS tracker device to find the latitude and Longitude (GPS Coordinates) And Speed.
Small GPS Tracker uses component’s GPS Neo-6m, Sim800l, Arduino Nano,16×2 LCD Display, Push Button And Buzzer.
We Have Also built many types Of Vehicle Tracking Systems If You are Interested Plz Check Out
Bill Of Materials
S.N | Component's | Quantity | Link To Buy |
1 | Arduino Nano | 1 | |
2 | GPS Neo-6m Module | 1 | |
3 | GSM Sim800l Module | 1 | |
4 | 16x2 LCD Display | 1 | |
5 | I2C Module | 1 | |
6 | 10k Pot | 1 | |
7 | Push Button | 1 | |
8 | Buzzer | 1 | |
9 | Zero PCB | 1 | |
10 | 12V DC Supply | 1 |
All impotent Component Are Required To Do This Project
Arduino Nano
This one is the Pin Diagram of Arduino nono microcontroller
GSM Sim800l Module
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.
The 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.
GPS Neo-6m 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
Push Button
10K Resister
Zero PCB
Block Diagram
PCB Design
Circuit Diagram
In this circuit diagram, we connect the all components properly Like…
- Sim800l GSM Module connected to the PIN D7 And D8.
- Neo-6m GPS Module connected to the PIN Rx.
- I used Two push buttons and is connected to the PIN D4 And D5.
Here I used the 3.7v lithium-ion battery to power up the whole circuit and also connected the TP4056 Charging Module to charge the lithium-ion battery.
Because the Sim800l GSM Module Is working from 3.6v to 4.2v That’s why I used the Battery if I gave the more power it did not work properly.
Code
Select the Arduino Nano Board And Upload the code.
Before uploading the code just Change the number
1 |
char phone_no[] = "+91xxxxxxxxxx"; |
……………………………………………………..
This code is valid for SMS & Call
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 83 84 85 86 |
//Prateek //www.justdoelectronics.com #include <TinyGPS.h> #include <SoftwareSerial.h> #include <Wire.h> SoftwareSerial Gsm(7, 8); char phone_no[] = "+9188305848xx"; //For SMS TinyGPS gps; int state; String textMessage; void setup() { Serial.begin(9600); Gsm.begin(9600); delay(2000); Serial.print("AT+CMGF=1\r"); delay(100); Serial.print("AT+CNMI=2,2,0,0,0\r"); delay(100); pinMode(4, INPUT); pinMode(5, INPUT); } void loop() { bool newData = false; unsigned long chars; unsigned short sentences, failed; for (unsigned long start = millis(); millis() - start < 1000;) { while (Serial.available()) { char c = Serial.read(); Serial.print(c); if (gps.encode(c)) newData = true; } } if (Gsm.available() > 0) { textMessage = Gsm.readString(); textMessage.toUpperCase(); delay(10); } state = digitalRead(4); if (state == 1) //When Button is Press { float flat, flon; unsigned long age; gps.f_get_position(&flat, &flon, &age); Gsm.print("AT+CMGF=1\r"); delay(400); Gsm.print("AT+CMGS=\""); Gsm.print(phone_no); Gsm.println("\""); Gsm.println("Alert I need help............."); Gsm.print("http://maps.google.com/maps?q=loc:"); Gsm.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6); Gsm.print(","); Gsm.print(flon == TinyGPS ::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6); delay(200); Gsm.println((char)26); delay(200); Gsm.println(); delay(10000); } else { delay(10); } state = digitalRead(5); if (state == 1) //When Button is Press { Serial.println("OK"); delay(20000); Gsm.println("ATD+9188305848xx;"); //For Call delay(150000); Gsm.println("ATH"); delay(1000); } else { delay(10); } Serial.println(failed); } |
This Code Is valid for Only Text SMS
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 |
//Prateek //www.justdoelectronics.com #include <SoftwareSerial.h> #include <TinyGPS.h> #include <Wire.h> SoftwareSerial Gsm(7, 8); // RX, TX pins for GSM module char phone_no[] = "+91883058xxxx"; // Put Your phone number TinyGPS gps; int buttonState; unsigned long buttonPressTime; bool isSMSsent = false; void setup() { Serial.begin(9600); Gsm.begin(9600); Gsm.print("AT+CMGF=1\r"); delay(100); Gsm.print("AT+CNMI=2,2,0,0,0\r"); delay(100); pinMode(4, INPUT_PULLUP); } void loop() { bool newData = false; unsigned long chars; unsigned short sentences, failed; for (unsigned long start = millis(); millis() - start < 1000;) { while (Serial.available()) { char c = Serial.read(); Serial.print(c); // Output GPS data to the Serial Monitor if (gps.encode(c)) newData = true; // Check if there is new GPS data } } buttonState = digitalRead(4); if (buttonState == LOW) { // Button is pressed if (!isSMSsent) { buttonPressTime = millis(); float flat, flon; unsigned long age; gps.f_get_position(&flat, &flon, &age); Gsm.print("AT+CMGF=1\r"); delay(400); Gsm.print("AT+CMGS=\""); Gsm.print(phone_no); Gsm.println("\""); Gsm.println("Alert I Need help..."); Gsm.print("http://maps.google.com/maps?q=loc:"); Gsm.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6); Gsm.print(","); Gsm.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6); delay(200); Gsm.println((char)26); delay(200); Serial.println("SMS Sent"); isSMSsent = true; } } else { isSMSsent = false; delay(10); } Serial.println(failed); } |
Demo Of Project
- When you press the push button after a few seconds the GSM sends the text message with the proper GPS coordinates.
- Then you receive the call at the same number if you want to receive the call at a different number then change the code.
Video Tutorial
This project is not working I have did exact same connection also uploaded the code its not working please help
This code is not working please help
How to wireing in women safety project in GPS tracker give a video
Why code is not working
used the 2 code is work properly
used the 2 code is work properly
Please I would like to ask if you design and sale pc boards. If yes am interested and would like some samples for my prototype project. My regards
can u give me the pcb file?? mail it at ajmalsworkshop@gmail.com
hello sir, i used code 2, but it is not working.. plz reply
ardino doesnt consist of wire.h library