An Arduino-based GPS tracker that reads live coordinates from a GPS module, connects to Wi-Fi using an ESP8266-compatible board, and uploads latitude and longitude data to a ThingSpeak channel for remote monitoring.
This project uses the TinyGPS++ library to decode GPS data received over software serial, then sends the parsed location to ThingSpeak over Wi-Fi. It is a simple IoT tracking project that combines GPS positioning with cloud logging.
Core functions:
- read NMEA GPS data from a serial GPS module
- parse latitude and longitude using
TinyGPS++ - connect to a Wi-Fi network
- upload location data to ThingSpeak fields
- print connection and coordinate data to the serial monitor
- ESP8266-compatible development board
- GPS module
- jumper wires / power supply
TinyGPS++SoftwareSerialThingSpeakESP8266WiFi
- The board starts a software serial connection for the GPS module.
- It connects to the configured Wi-Fi network.
- Incoming GPS data is decoded using
TinyGPS++. - When a valid location is available, the project extracts:
- latitude
- longitude
- The coordinates are sent to ThingSpeak:
- Field 1: latitude
- Field 2: longitude
- The values are also printed to the serial monitor for debugging.
The sketch defines the GPS software serial pins as:
RXPin = 4TXPin = 5
These pins are used here:
static const int RXPin = 4, TXPin = 5;
static const uint32_t GPSBaud = 9600;Make sure your GPS module is wired to match these pins on your ESP8266 board.
Before uploading the sketch, update the following values in GPS_tracker.ino:
ssidpasswordmyChannelNumbermyWriteAPIKey
These credentials are required for Wi-Fi access and ThingSpeak data upload.
The full application is contained in a single sketch:
When valid GPS data is received, the serial monitor prints values similar to:
Latitude = 30.123456
Longitude = 31.123456
At the same time, the same values are uploaded to your ThingSpeak channel.
- Open the project in the Arduino IDE or another compatible ESP8266 development environment.
- Install the required libraries:
TinyGPS++ThingSpeakESP8266 board support
- Enter your Wi-Fi credentials and ThingSpeak channel information in
GPS_tracker.ino. - Connect the GPS module to the configured pins.
- Upload the sketch to the ESP8266 board.
- Open the serial monitor at
115200baud to verify Wi-Fi connection and GPS readings.
- The GPS module communicates at
9600baud in this project. - The serial monitor runs at
115200baud. - Coordinates are uploaded only when a valid GPS fix is available.
- Wi-Fi and ThingSpeak credentials are intentionally left as placeholders in the sketch.
Created and maintained by Ziad Ahmed.