This innovative DIY Arduino GPS Tracker project helps you in creating a compact emergency GPS tracking device using an Arduino Nano, which is suitable for carrying along with you and also in vehicles such as cars, bicycles, or motorcycles. This GPS system includes a small button that, when pressed, initiates the tracking process by sending your current location as an SMS to a predefined phone number. The location can be easily viewed on a map using a Google Maps web link from the SMS received.
Table of Contents
Key Components for Your DIY GPS Tracking System
- Arduino Nano: A cost-effective microcontroller for processing GPS data and managing alerts.
- GPS Module: Captures precise latitude, longitude, and altitude coordinates via satellite signals.
- GSM Module: Sends SMS alerts and initiates calls using a standard SIM card.
- Trigger Button: A tactile switch to activate tracking or emergency calls.
- Power Source: Typically a rechargeable lithium-ion battery, ensuring portability and reliability.
How It Works
-
Initialization: The device is powered on and waits for the button to be pressed.
-
Tracking Initiation: When the button is pressed, the GPS module acquires the vehicle’s location by locking onto satellite signals. With data from at least three satellites, it can determine latitude, longitude, and altitude.
-
SMS Alert: The GSM module sends an SMS containing the GPS coordinates to the preset phone number. This message includes a link to view the location on Google Maps.
-
Extended Button Press: If the button is pressed for more than five seconds, the GSM module initiates a call to the same preset phone number, providing an additional layer of alert functionality.
-
Compact & Portable Design: The use of Arduino Nano makes the tracker lightweight and small, allowing it to be discreetly installed in any vehicle. It can be powered by a rechargeable battery, making it a wireless and mobile solution.
Related project: GPS Tracker with GSM/GPRS using blynk with SMS and calling features
Required components
Product Name | Quantity | ![]() | ![]() |
---|---|---|---|
Arduino NANO | 1 | https://amzn.to/3jVNZON | https://amzn.to/3KpUQry |
GPS NEO 6M Module | 1 | https://amzn.to/4bZa31P | https://amzn.to/4bFgyqy |
SIM 800L Module | 1 | https://amzn.to/4iCemSV | https://amzn.to/3DBzwlu |
Sim Card | 1 | ||
Push button | 1 | https://amzn.to/3uc4gRh | https://amzn.to/3ubrLdc |
10kΩ Resistor | 1 | https://amzn.to/3hBlqlq | https://amzn.to/3sXBKmI |
5V power supply (USB or External). | 1 | https://amzn.to/3s1a8g3 | https://amzn.to/364yInH |
Few Connecting Wires | https://amzn.to/3H2BV4e | https://amzn.to/3J0WVu2 |
NEO-6M GPS Module: Precision Tracking for DIY Projects
The NEO-6M GPS module, engineered by u-blox, is a game-changer for location-based projects. Leveraging a constellation of 31 Global Positioning System (GPS) satellites, this compact powerhouse delivers real-time geographic coordinates with military-grade accuracy. Designed for seamless integration with microcontrollers like Arduino, it’s the ultimate tool for hobbyists and developers building tracking systems, drones, or IoT devices.
Key Features of the NEO-6M GPS Module
- 22 Satellite Tracking: Locks onto up to 22 satellites across 50 channels for pinpoint accuracy (within 2.5m).
- Ultra-Low Power Modes:
- Active Mode: Draws just 45mA during operation.
- Power-Saving Mode: Slashes consumption to 11mA, ideal for battery-powered projects.
- LED Position Fix Indicator:
- Steady Off: Scanning for satellite signals.
- 1-Second Blink: Successfully locked onto 3+ satellites, ready to relay coordinates.
SIM800L GSM/GPRS Module:
The SIM800L module by SimCom bridges your projects to cellular networks worldwide. Operating at 3.4V–4.4V (compatible with LiPo batteries) and supporting 5V logic via built-in regulators, this quad-band module is a must-have for SMS alerts, voice calls, and IoT applications.
SIM800L Module Breakdown: Specs & Functionality
- Global Quad-Band Support: Works on 850/900/1800/1900MHz frequencies for cross-continent reliability.
- Antenna Flexibility: Switch between compact PCB antennas or high-gain suction cup antennas via the IPX interface.
- Auto Baud Detection: Eliminates manual configuration—plug, play, and transmit.
- LED Network Status:
- 1-Second Blink: Powered on, searching for network.
- 2-Second Blink: GPRS active (data transfer enabled).
- 3-Second Blink: Network connected (SMS/call-ready).
Circuit Diagram
After grabbing all the required components connect them according to the below circuit diagram.
Connect every component according to the above schematic or circuit diagram. Here we also added a li-ion 18650 battery to power the circuit remotely and a TP4056 li-ion battery charger module to charge the battery using latest USB type C cable. As we all know the battery operates between 3.7 to 4.2v which is not sufficient to power the Arduino, SIM800l and GPS module so we added MT3608 DC to DC boost converter module through which we can draw stable 5v. We also added a slide switch so we can turn On and Off the project when not in use.
If you don’t need it battery operated remove the battery, TP4056 and Mt3608 modules and directly power it from USB power supply.
Transform Your DIY Arduino GPS Tracker into a Professional-Grade Device with PCBWay!
Bring your emergency GPS tracking system to life with PCBWay, the world’s leading PCB manufacturing and assembly service! Our platform empowers makers, engineers, and hobbyists to turn innovative prototypes—like this Arduino-based GPS tracker—into sleek, reliable devices ready for real-world use.
Why This Project is Perfect for PCBWay:
This DIY GPS tracker combines a custom PCB, GSM/GPS modules, and compact design—all areas where PCBWay excels. By partnering with it, you’ll unlock:
- High-Quality PCBs: Fabricate durable, 4-layer boards for noise reduction in GPS/GSM signal routing.
- Fast Turnaround: Receive boards in 24 hours to accelerate prototyping.
- SMT Assembly: Let they solder tiny components (e.g., SIM800L, SAM-M10Q) for flawless connections.
- 3D Printing: Encase your tracker in weatherproof ABS cases for outdoor use.
PCBWay Enhances Your Design:
- Signal Integrity: Their Rogers 4350B substrates minimize interference between GSM/GPS antennas.
- Miniaturization: Shrink the tracker with HDI (high-density interconnect) PCBs.
- Battery Management: Add a PCBWay-manufactured charging circuit for safe battery operation.
Order your Custom PCB now at PCBway.com
Upload the Program code:
After connecting everything we need to upload the program code into Arduino nano using Arduino IDE. First install the required libraries given below and then copy the below code and paste it in IDE, do some required changes and upload the code. If you don’t have have IDE check How to Install Arduino IDE on Your PC.
Required libraries:
- TinyGPS: link
- SoftwareSerial : Already included in Arduino IDE
Program code:
//DIY ARDUINO GPS tracker 2025: Sends location and SOS call [Circuitschools.com] #include <TinyGPS.h> #include <SoftwareSerial.h> #include <Wire.h> SoftwareSerial Gsm(3, 2); // RX, TX pins for GSM module char phone_no[] = "+91xxxxxxxx"; // Your phone number +91 is for India TinyGPS gps; int buttonState; unsigned long buttonPressTime; bool isSMSsent = false; void setup() { Serial.begin(9600); Gsm.begin(9600); // Set GSM module to text mode Gsm.print("AT+CMGF=1\r"); delay(100); // Configure the GSM module to display incoming SMS Gsm.print("AT+CNMI=2,2,0,0,0\r"); delay(100); pinMode(13, INPUT_PULLUP); // Set pin 13 as input for a button or sensor } void loop() { bool newData = false; unsigned long chars; unsigned short sentences = 0, failed = 0; // Reading GPS data 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(13); // Read the state of the input pin if (buttonState == LOW) { // Button is pressed if (!isSMSsent) { buttonPressTime = millis(); // Record the time when the button was first pressed // Send SMS with GPS location float flat, flon; unsigned long age; gps.f_get_position(&flat, &flon, &age); // Check if GPS data is valid if (flat != TinyGPS::GPS_INVALID_F_ANGLE && flon != TinyGPS::GPS_INVALID_F_ANGLE) { Gsm.print("AT+CMGF=1\r"); delay(400); Gsm.print("AT+CMGS=\""); Gsm.print(phone_no); Gsm.println("\""); Gsm.println("Emergency! this is my location!..."); Gsm.print("http://maps.google.com/maps/?q=loc:"); Gsm.print(flat, 6); Gsm.print("%2C"); Gsm.print(flon, 6); delay(200); Gsm.println((char)26); // End of SMS character delay(200); Serial.println("SMS Sent"); isSMSsent = true; // Mark SMS as sent to avoid resending } else { Serial.println("Invalid GPS data, SMS not sent."); } } // Check if the button is held down for more than 5 seconds if (millis() - buttonPressTime > 5000) { Serial.println("Button held for 5 seconds, making a call..."); // Make a phone call Gsm.print("ATD"); Gsm.print(phone_no); Gsm.println(";"); delay(20000); // Wait for the call to go through Gsm.println("ATH"); // Hang up the call delay(1000); Serial.println("Call ended"); isSMSsent = false; // Reset SMS sent flag for future button presses } } else { isSMSsent = false; // Reset SMS sent flag when button is released delay(10); // Wait before the next loop } Serial.println(failed); // Output the number of failed GPS sentences }
Code Explanation: DIY Arduino GPS Tracker
This code implements a DIY GPS tracker using an Arduino, which can send location data via SMS and make an SOS call when a button is pressed. Here’s a brief overview of its functionality:
Libraries and Setup
-
Libraries Used:
TinyGPS
: For handling GPS data.SoftwareSerial
: To communicate with the GSM module.Wire
: Included but not used in this code.
-
GSM Module:
- Configured to use pins 3 (RX) and 2 (TX) for communication.
- A phone number is defined for sending SMS.
Setup Function
- Initializes serial communication for both the Arduino and the GSM module.
- Sets the GSM module to text mode and configures it to display incoming SMS.
- Configures pin 13 as an input for a button or sensor.
Loop Function
-
GPS Data Reading:
- Continuously reads GPS data for 1 second and checks if new data is available.
-
Button Press Handling:
- Monitors the state of the button connected to pin 13.
- If the button is pressed:
- Records the time of the button press.
- Retrieves the GPS coordinates (latitude and longitude).
- If the GPS data is valid, it sends an SMS with the location link.
- If the button is held for more than 5 seconds, it initiates a phone call to the specified number.
-
SMS Sending:
- Constructs an SMS message with the current location and sends it via the GSM module.
-
Call Functionality:
- If the button is held down for 5 seconds, it makes a call to the specified phone number and hangs up after 20 seconds.
Error Handling
- The code checks for valid GPS data before sending the SMS.
- It resets the SMS sent flag when the button is released or after a call is made, allowing for repeated use.
Output
- The code prints messages to the Serial Monitor for debugging purposes, including whether an SMS was sent or if the GPS data was invalid.
This code effectively combines GPS tracking and emergency communication features, making it suitable for personal safety applications.
Expected Output:
When the GPS Module Receives Data
- GPS module prints raw NMEA sentences (e.g.,
$GPGGA
,$GPRMC
). - If valid data is found, it extracts latitude and longitude.
When the Button is Pressed (Short Press)
Serial Monitor Output
Emergency! This is my location!... http://maps.google.com/maps?q=loc:37.774929%2C-122.419418 SMS Sent
SMS Received on Phone
Message from GSM Module:
Emergency! This is my location!... http://maps.google.com/maps?q=loc:37.774929%2C-122.419418
(Where 37.774929, -122.419418
is the GPS location)
When the Button is Held for 5+ Seconds (Long Press)
Serial Monitor Output
Button held for 5 seconds, making a call... Call ended
Phone Call Behavior
- Incoming call from GSM module.
- Call lasts 20 seconds, then disconnects.
When GPS Data is Unavailable
Serial Monitor Output
Invalid GPS data, SMS not sent.