Portable GPS Tag Using ESP32 satellite tracking
Portable GPS tag using ESP32

As the demand for real-time tracking and asset management increases, GPS-based tracking devices are finding widespread applications in personal, industrial, and IoT environments. In this article, we’ll guide you through building a Portable GPS tag using ESP32 using a microcontroller, NEO-6M GPS module, and the SIM800 GSM module, all housed in a compact 3D-printed enclosure. This project not only collects geolocation data but also transmits it over cellular networks, making it a powerful and flexible IoT solution.

Connecting the NEO-6M GPS module to the ESP32 is straightforward—simply establish serial communication with the sensor to begin receiving data.

The accuracy of the GPS readings depends largely on the placement of the module and the quality of the antenna. For optimal performance, put the sensor outdoors or near a window, away from narrow streets or areas obstructed by tall buildings. A greater number of visible satellites results in more precise location tracking.

🚀 IoT GPS tracking project Overview

Core Components:

  • ESP32 WiFi + Bluetooth Microcontroller

  • NEO-6M GPS Module

  • SIM800L GSM/GPRS Module

  • 3.7V Li-ion Battery + Charging Module

  • 3D Printed Case (Optional but Recommended)

  • Arduino IDE (for programming)

 

SIM800L GPS tracker DIY Key Features:

  • Real-time GPS tracker with GSM

  • Data transmission via cellular networks (GPRS/SMS)

  • Optional MQTT/HTTP integration for cloud-based IoT dashboards

  • Compact, battery-powered, and portable

  • Can be enclosed in a 3D-printed protective case

 

🔧 SIM800L GPS tracker DIY Hardware Required

ComponentDescription
ESP32 Dev BoardCentral controller with Wi-Fi + BT
NEO-6M GPS ModuleProvides real-time latitude & longitude
SIM800L GSM ModuleSends data via SMS or HTTP to server/cloud
Li-ion BatteryPortable power supply
TP4056 ChargerBattery charging circuit
Antenna (GSM + GPS)For better signal reception
Breadboard & WiresPrototyping hardware
3D Printed EnclosureCustom housing for outdoor use

 

⚙️ IoT GPS tracking project Circuit Connection

  • GPS Module → ESP32

    • TX → RX (GPIO16)

    • RX → TX (GPIO17)

    • VCC → 3.3V

    • GND → GND

  • SIM800 Module → ESP32

    • TX → RX (GPIO4)

    • RX → TX (GPIO5)

    • VCC → External 4V power (not from ESP32 directly)

    • GND → GND

  • Battery Module

    • 3.7V Li-ion battery connected to TP4056 module

    • TP4056 output powers ESP32 and SIM800 through regulated voltage

ESP32 Dev Board & NEO-6M GPS module schematic

 

Loop function:

The loop function involves several steps; refer to the flowchart for a clearer understanding of its logic.

 

Portable GPS tag using ESP32 Working Principle flowchart

 

  1. GPS Initialization:

    The ESP32 initializes the NEO-6M module, which starts acquiring satellite signals. Once a valid GPS lock is obtained, it receives the latitude, longitude, speed, and timestamp data.

  2. Data Formatting:

    The ESP32 formats the GPS data as a string or JSON object.

  3. Transmission Real-time GPS tracker with GSM:

    The SIM800 module connects to a cellular network. The formatted data is then transmitted either via:

    • SMS to a fixed number

    • HTTP POST request to a remote web server or cloud IoT dashboard

    • MQTT publish if integrated into an IoT platform like ThingSpeak, Blynk, or Node-RED

  4. Repeat Cycle:

    After a defined interval (e.g., every 10 minutes), the ESP32 collects and transmits a new set of coordinates.

 

IoT GPS tracking project cloud platforms

IoT Features & Expansion

This Real-time GPS tracker with GSM isn’t just a GPS tracker—it’s a mini IoT node. With a few lines of code, you can:

  • Integrate with IoT Platforms:

    Send GPS data to ThingSpeak, Adafruit IO, or Google Firebase for real-time map visualization.

  • Enable Remote Commands:

    Configure the ESP32 to receive SMS commands, such as:

    • “SEND LOCATION” to get instant coordinates

    • “SLEEP MODE” to save battery

  • Add Geo-Fencing Alerts:

    With programmed zones, the ESP32 can alert the user if the tag leaves a predefined area.

  • Data Logging on SD Card (Optional):

    Add an SD card module to locally store GPS logs in case of GSM failure. Here’s A portable GPS logging device built with ESP32, NEO-6M, and SDCard Module.

TinyGPSPlus is a powerful and customizable Arduino library designed to parse NMEA data streams from GPS modules. As the successor to the original TinyGPS library, it retains a lightweight and user-friendly structure while adding enhanced capabilities. It efficiently extracts key GPS information such as position, date, time, altitude, speed, and course.

Unlike its predecessor, TinyGPSPlus features a more intuitive programming interface and supports parsing of a wide range of NMEA sentences—including proprietary and non-standard ones—making it a versatile choice for GPS-based Arduino projects.

 

3D Printed Enclosure

To make the tracker truly portable and rugged, it can be housed in a custom 3D-printed case:

  • Design Suggestions:

    • Separate compartments for the ESP32, SIM800, and GPS module

    • External antenna slots

    • Micro-USB port access for charging

    • Weatherproofing with gaskets or silicone sealant

  • Materials:
    Use PLA for indoor use or PETG/ABS for outdoor/weatherproof applications.

📥 Example Arduino Sketch Snippet

#include <TinyGPS++.h>
#include <SoftwareSerial.h>

TinyGPSPlus gps;
SoftwareSerial gpsSerial(16, 17); // RX, TX
SoftwareSerial sim800(4, 5); // SIM800 RX, TX

void setup() {
Serial.begin(9600);
gpsSerial.begin(9600);
sim800.begin(9600);

delay(1000);
sim800.println(“AT”);
delay(1000);
}

void loop() {
while (gpsSerial.available()) {
gps.encode(gpsSerial.read());
if (gps.location.isUpdated()) {
String message = “Lat: ” + String(gps.location.lat(), 6) +
“, Lon: ” + String(gps.location.lng(), 6);
sendSMS(message);
}
}
}

void sendSMS(String msg) {
sim800.println(“AT+CMGF=1”);
delay(1000);
sim800.println(“AT+CMGS=\”+1234567890\””);
delay(1000);
sim800.print(msg);
sim800.write(26); // ASCII code for Ctrl+Z
delay(1000);
}

 

⚠️ Note: Always use a regulated power supply for the SIM800L module (around 4.0V to 4.2V) as it’s sensitive to undervoltage.

 

✅ Advantages of Real-time GPS tracker with GSM Project

  • Standalone Functionality: No WiFi or smartphone dependency

  • Real-Time Updates: GPS coordinates are shared instantly via SMS or cloud

  • Customizable: Add sensors like temperature, motion, or shock detection

  • Portable & Rugged: Perfect for tracking pets, vehicles, packages, or even people

 

The code retrieves the data and displays all relevant information on the Serial Monitor.

Serial.print(“LAT: “);
Serial.println(gps.location.lat(), 6);
Serial.print(“LONG: “);
Serial.println(gps.location.lng(), 6);
Serial.print(“SPEED (km/h) = “);
Serial.println(gps.speed.kmph());
Serial.print(“ALT (min)= “);
Serial.println(gps.altitude.meters());
Serial.print(“HDOP = “);
Serial.println(gps.hdop.value() / 100.0);
Serial.print(“Satellites = “);
Serial.println(gps.satellites.value());
Serial.print(“Time in UTC: “);
Serial.println(String(gps.date.year()) + “/” + String(gps.date.month()) + “/” + String(gps.date.day()) + “,” + String(gps.time.hour()) + “:” + String(gps.time.minute()) + “:” + String(gps.time.second()));
Serial.println(“”);

Use Cases

  • Vehicle anti-theft GPS tag

  • Pet tracking collar

  • Child safety device

  • Delivery package tracker

  • Remote asset monitoring

 

SIM800L GPS tracker DIY Challenges:

During Portable GPS tag using ESP32 project, we encountered a few noteworthy challenges worth highlighting:

  • To ensure reliable transmission, it’s essential to verify the accuracy of GPS data before sending it to the server, which accepts only decimal coordinates. The timestamp, however, is simply a string and can be customized as needed.
  • The routing API is optimized for plotting nearby, sequential coordinates. If the data varies too widely, the routing on the map may appear fragmented—though the coordinates will still be plotted.
  • Hardware limitations restrict the size of local dynamic arrays, so for improved data retention—especially during power loss—using external flash memory is strongly advised.
  • Lastly, the built-in antenna of the Neo6M GPS module may struggle to perform well in urban or high-traffic areas. Connecting an external antenna is a more effective solution in such environments.

 

Conclusion

This portable GPS tag using ESP32, NEO-6M, and SIM800 GSM module is a powerful DIY IoT project that demonstrates real-world applications of electronics, cellular networking, and embedded systems. Its compact 3D-printed design, coupled with IoT cloud integration, makes it a practical solution for personal, commercial, and educational use.

FAQ:

  1. How do I interface the NEO-6M GPS module with the ESP32?
    The NEO-6M GPS module communicates with the ESP32 via UART. Connect the TX pin of the GPS module to the RX pin (e.g., GPIO16) of the ESP32 and the RX pin of the GPS to the TX pin (e.g., GPIO17). Make sure both devices operate at 3.3V logic levels or use a level shifter if needed. Use a library like TinyGPS++ to analyze GPS data.

  2. How does the ESP32 send GPS location via the SIM800 GSM module?
    After analyzing the GPS coordinates from the NEO-6M, the ESP32 formats the location (latitude and longitude) into a message string. It then sends AT commands over a UART interface to the SIM800 module to send this message as an SMS or to upload it to a server via HTTP. For example, AT+CMGS="+1234567890" followed by the message and a Ctrl+Z (ASCII 26) to send an SMS.

  3. What power considerations are necessary for reliable operation in a IoT GPS tracking project?
    The SIM800 can draw up to 2A peak current during GSM transmission bursts, which can cause instability if not properly powered. Use a Li-ion battery with a step-down converter (e.g., 5V to 3.7V/3.3V) and sufficient capacitors (e.g., 1000 µF or more) to handle peak loads. Ensure the ESP32 and GPS module also receive clean, regulated 3.3V power.

See Also: