Skip to content

Latest commit

 

History

History
108 lines (74 loc) · 3 KB

File metadata and controls

108 lines (74 loc) · 3 KB

GPS Tracker

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.

Overview

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

Hardware Used

  • ESP8266-compatible development board
  • GPS module
  • jumper wires / power supply

Libraries Used

  • TinyGPS++
  • SoftwareSerial
  • ThingSpeak
  • ESP8266WiFi

How It Works

  1. The board starts a software serial connection for the GPS module.
  2. It connects to the configured Wi-Fi network.
  3. Incoming GPS data is decoded using TinyGPS++.
  4. When a valid location is available, the project extracts:
    • latitude
    • longitude
  5. The coordinates are sent to ThingSpeak:
    • Field 1: latitude
    • Field 2: longitude
  6. The values are also printed to the serial monitor for debugging.

Pin Configuration

The sketch defines the GPS software serial pins as:

  • RXPin = 4
  • TXPin = 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.

Cloud Configuration

Before uploading the sketch, update the following values in GPS_tracker.ino:

  • ssid
  • password
  • myChannelNumber
  • myWriteAPIKey

These credentials are required for Wi-Fi access and ThingSpeak data upload.

Project File

The full application is contained in a single sketch:

Example Output

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.

Build and Run

  1. Open the project in the Arduino IDE or another compatible ESP8266 development environment.
  2. Install the required libraries:
    • TinyGPS++
    • ThingSpeak
    • ESP8266 board support
  3. Enter your Wi-Fi credentials and ThingSpeak channel information in GPS_tracker.ino.
  4. Connect the GPS module to the configured pins.
  5. Upload the sketch to the ESP8266 board.
  6. Open the serial monitor at 115200 baud to verify Wi-Fi connection and GPS readings.

Notes

  • The GPS module communicates at 9600 baud in this project.
  • The serial monitor runs at 115200 baud.
  • Coordinates are uploaded only when a valid GPS fix is available.
  • Wi-Fi and ThingSpeak credentials are intentionally left as placeholders in the sketch.

Author

Created and maintained by Ziad Ahmed.