DEV Community

Cover image for Practical GPS Tracker with XIAO ESP32-S3 & Geofencing
Messin
Messin

Posted on

Practical GPS Tracker with XIAO ESP32-S3 & Geofencing

Build a Smart GPS Tracker with Seeed XIAO ESP32-S3

GPS trackers are incredibly useful for monitoring assets, vehicles, pets, or even loved ones. But many DIY implementations rely on expensive cellular modules and data plans — until now. In this project, we’ll walk through building a fully functional GPS tracker that uses Wi-Fi instead of GSM, includes geofencing, and even sends SMS alerts when your device leaves a defined area — all without a SIM card.

This version uses the small but powerful Seeed Studio XIAO ESP32-S3 microcontroller together with a Neo-6M GPS module. By integrating with the free GeoLinker cloud platform, the tracker sends its GPS coordinates over Wi-Fi so you can visualize locations on a map and handle advanced features like geofence crossings.

What You’ll Build

Your GPS tracker will:

  • Read GPS coordinates using an external GPS module.
  • Connect to Wi-Fi and send location data to the cloud.
  • Display movement history on an interactive map.
  • Detect geofence breaches and trigger an alert.
  • Send SMS notifications when boundaries are crossed.

How It Works

Here’s a simplified overview of the system:

GPS Collection: The Neo-6M module captures satellite signals and outputs latitude/longitude.

Processing: The ESP32-S3 reads GPS data via UART at 9600 baud.

Cloud Upload: Coordinates are sent to GeoLinker over Wi-Fi at set intervals (e.g., every 15 seconds).

Mapping & History: GeoLinker stores each point with a timestamp and plots them on a map.

Geofencing: The tracker uses the Haversine formula to measure distance from a set “home” coordinate.

SMS Alerts: If the device leaves the defined radius, an SMS is automatically triggered.

Offline Buffering: Lost Wi-Fi? Data is temporarily stored and synced once reconnected.

This setup provides a reliable tracker with features typically found in commercial IoT solutions — but at a fraction of the cost and complexity.

Step-by-Step Assembly

Wiring

  • GPS VCC → XIAO 5V
  • GPS GND → XIAO GND
  • GPS TX → XIAO GPIO44 (RX)
  • GPS RX → XIAO GPIO43 (TX)

Add an external GPS antenna to the Neo-6M for better signal.

Simple serial wiring enables the GPS module to stream NMEA data to the ESP32 continuously.

GeoLinker Cloud Setup

GeoLinker provides the backend that:

  • Stores incoming GPS data
  • Renders it visually on a map
  • Handles SMS alerts via a cloud API

To set this up:

  • Create an account on the GeoLinker platform.
  • Generate your unique API key.
  • Link a mobile number for SMS alerts.

The free tier offers enough data points and SMS capacity for most hobbyist projects.

Code Highlights

Your Arduino sketch will:

Initialize GPS serial and Wi-Fi.

  • Set up GeoLinker with your API key and device ID.
  • Upload data in timed intervals.
  • Compute geofence distance using the Haversine formula.
  • Send SMS when the device moves outside the preset radius.

You can further customize:

  • Update intervals (more frequent updates for finer tracking)
  • Geofence radius (from meters to kilometers)
  • Multiple geofences
  • Speed or battery alerts

Real-World Testing

In practical tests, the tracker:

  • Connected to a phone hotspot via Wi-Fi
  • Continued local GPS buffering when Wi-Fi dropped
  • Synced stored points once reconnected
  • Sent SMS notifications as expected when the geofence was breached

The result is a consistent and fault-tolerant tracker suitable for many real use cases.

Where You Can Use It

  • Fleet & vehicle tracking
  • Asset security
  • Child or elderly location alerts
  • Pet monitoring

Any mobile object that needs safe-zone notifications

Conclusion

This GPS Tracker with Seeed Studio XIAO ESP32-S3 project shows how Wi-Fi-based GPS tracking can replace more expensive cellular alternatives, adding powerful features like geofencing and SMS alerts. Using a compact board like the XIAO ESP32-S3 and free tools like GeoLinker makes it accessible to makers, students, and hobbyists alike.
Ready to prototype? Jump into the code and circuit, and make your own smart tracker today!

Top comments (0)