Build Project

Sensor Projects

Build a Local NEO-6M GPS Reader

Build an ESP32 NEO-6M GPS reader with UART wiring, TinyGPS++ parsing, no-fix handling, sky-view guidance, and location privacy limits.

IntermediateAges 13+60-90 minUnder 25 USDParent Safe
ESP32 NEO-6M GPS reader with GPS module and serial coordinate output
Project Mission

Build a Local NEO-6M GPS Reader

The Story

The project is a receiver, not a cellular tracker or theft-recovery device. It does not upload location anywhere.

Explain Like I'm 12

The GPS module listens to satellites and sends text lines to the ESP32. The ESP32 waits until the lines contain a real fix before printing coordinates.

Learning Support

  • Recommended ageAges 13+
  • Adult supervisionAdult supervision recommended for outdoor testing and location privacy decisions.
  • Classroom useUse fake printed coordinates for discussion and test real fixes only with consent.
  • Parent promptAsk why a location project needs consent before tracking people or property.
  • Screen-free activityDraw how satellites, antenna sky view, UART bytes, and valid fixes connect.
  • Next challengeAdd an OLED display after the serial fix state is reliable.
  • Skills practiced
    • UART2 wiring
    • NMEA parsing
    • No-fix handling
    • Privacy boundaries
  • Learning outcomes
    • Wire GPS TX to ESP32 RX2 GPIO16.
    • Parse NMEA using TinyGPS++.
    • Print coordinates only when the fix is valid.
    • Explain cold start, sky view, and privacy limits.
  • Mini experiments
    • Compare no-fix and valid-fix Serial output.
    • Move the antenna from indoors to a window.
    • Log satellite count without sharing coordinates.

Safety Standards

  • Unplug USB before changing jumper wires. Recheck 3.3 V, 5 V, and GND before reconnecting power.
  • Do not power motors, pumps, LED strips, or servos from the ESP32 3.3 V pin. Use a suitable external supply and common ground.
  • Breadboards are for low-current prototypes. Move high-current or unattended builds to proper terminals, enclosure, strain relief, and fusing.

What You Will Build

A local GPS/GNSS reader that prints valid coordinates from a NEO-6M module to Serial Monitor.

Learning Objectives

  • Wire GPS TX to ESP32 RX2 GPIO16.
  • Parse NMEA using TinyGPS++.
  • Print coordinates only when the fix is valid.
  • Explain cold start, sky view, and privacy limits.

Components List

  • ESP32 DevKit boardUSB-programmable ESP32 board for the low-voltage logic side.
  • NEO-6M GPS/GNSS module with antennaSupported only: a documented NEO-6M carrier with a 3.3 V-rated supply input and native 3.3 V UART TX. Confirm its schematic; this is not a claim about every GY-GPS6MV2 or other unmarked board.
  • Breadboard and jumper wiresKeep UART wiring short for bench testing.
  • Optional USB power bankUseful for outdoor sky-view tests without exposing location online.

Bill of Materials

PartQtyEstimated CostNotes
ESP32 DevKit board1VariesUSB-programmable ESP32 board for the low-voltage logic side.
NEO-6M GPS/GNSS module with antenna1VariesSupported only: a documented NEO-6M carrier with a 3.3 V-rated supply input and native 3.3 V UART TX. Confirm its schematic; this is not a claim about every GY-GPS6MV2 or other unmarked board.
Breadboard and jumper wires1VariesKeep UART wiring short for bench testing.
Optional USB power bank1VariesUseful for outdoor sky-view tests without exposing location online.

Wiring

Read-only UART connection: documented 3.3 V carrier TX -> classic ESP32-WROOM GPIO16 (RX2), with common GND. GPS RX is left disconnected. Identify the actual carrier supply circuit first.

Build a Local NEO-6M GPS Reader wiring diagram

Open wiring diagram full size

  1. 1

    Disconnect power. Obtain the exact carrier schematic and identify its supply input, regulator and UART output voltage. If these are unknown, stop rather than applying 5 V.

  2. 2

    The supported carrier must accept regulated 3.3 V at the identified input and expose native 3.3 V UART TX. Use an adequately rated external 3.3 V supply, with its positive kept off ESP32 USB/VIN/3V3.

  3. 3

    Join carrier GND, external supply GND and ESP32 GND. Connect GPS TX to ESP32 GPIO16 (RX2). Leave GPS RX disconnected; this sketch sends no configuration commands.

  4. 4

    Use a classic ESP32-WROOM board that exposes GPIO16; some WROVER boards reserve GPIO16/17 for PSRAM.

  5. 5

    Power ESP32 USB before the carrier supply; switch carrier power off before USB. Confirm a 9600-baud NMEA stream before diagnosing satellite reception.

  6. 6

    Give the antenna clear sky view with permission to record location; indoor satellite acquisition is not promised.

GPIO Mapping

SignalESP32 PinDirectionNotes
Carrier TX, native 3.3 V UARTGPIO16 / RX2InputTX crosses to ESP32 RX; default NEO-6 NMEA setting is 9600 baud unless reconfigured.
Carrier RXNot connectedUnusedRead-only example; ESP32 TX GPIO17 is configured but physically unwired.
Documented carrier supply inputExternal regulated 3.3 VPowerOnly a carrier explicitly rated for this input; common ground. Not universal VIN.
Common referenceGNDGroundGPS and ESP32 UART require a shared reference.

Circuit Explanation

The GNSS module streams NMEA sentences at 9600 baud. TinyGPS++ decodes bytes into fix status, coordinates, satellites, and HDOP.

Engineering Explanation

GPS needs sky view and time for a cold start. Indoor tests often receive UART text but no valid coordinates. The u-blox NEO-6M silicon module is specified for 2.7–3.6 V VCC; that is not the same as a carrier VIN rating. Some carrier regulators need a higher input because of dropout; those carriers are outside this 3.3 V-input exercise unless their documentation identifies a supported 3.3 V connection. A regulator on VIN does not prove that UART tolerates 5 V. No particular unmarked carrier has been verified here.

Libraries

  • Arduino-ESP32 3.3.2Classic ESP32-WROOM UART2 review baseline.
  • TinyGPSPlus 1.0.3Mikal Hart official release tag v1.0.3 (package version); the TinyGPS++.h parsing API used here is present in that tag. Serial communication and satellite fix are separate checks.

Code

Copy into Arduino IDE. Install any libraries noted in the component guides first.

esp32-gps-tracker.ino
// ESP32 NEO-6M GPS reader
// Prints only valid fixes; no fabricated coordinates are used.
#include <TinyGPS++.h>

TinyGPSPlus gps;
HardwareSerial gpsSerial(2);

const int GPS_RX = 16; // ESP32 receives GPS TX here
const int GPS_TX = 17; // Configured UART TX, physically unwired; no commands sent.

unsigned long lastStatusMs = 0;

void setup() {
  Serial.begin(115200);
  gpsSerial.begin(9600, SERIAL_8N1, GPS_RX, GPS_TX);
  Serial.println("GPS reader ready. Place the antenna with a clear sky view.");
}

void loop() {
  while (gpsSerial.available()) {
    gps.encode(gpsSerial.read());
  }

  if (gps.location.isUpdated()) {
    if (gps.location.isValid()) {
      Serial.print("Latitude: ");
      Serial.println(gps.location.lat(), 6);
      Serial.print("Longitude: ");
      Serial.println(gps.location.lng(), 6);
      Serial.print("Satellites: ");
      Serial.println(gps.satellites.value());
      Serial.print("HDOP: ");
      Serial.println(gps.hdop.isValid() ? gps.hdop.hdop() : 0.0, 2);
      Serial.println("---");
    } else {
      Serial.println("GPS data received, but no valid location fix yet.");
    }
  }

  if (millis() - lastStatusMs > 5000) {
    lastStatusMs = millis();
    if (gps.charsProcessed() < 10) {
      Serial.println("No NMEA characters yet. Check TX-to-RX wiring and module power.");
    } else if (!gps.location.isValid()) {
      Serial.println("Waiting for satellite lock. Move antenna near a window or outdoors.");
    }
  }
}

Code Explanation

UART2 receives 9600-baud NMEA on GPIO16. GPIO17 is configured as UART TX but left physically unconnected; the sketch sends no configuration commands. TinyGPS++ parses the incoming stream; received characters alone do not prove a valid satellite fix.

Expected Output

Before satellite lock, Serial Monitor says it is waiting for a fix. After a valid fix, it prints latitude, longitude, satellites, and HDOP.

Troubleshooting

  • No characters processed Check that GPS TX goes to GPIO16 and the baud rate is 9600.
  • No valid fix Move outdoors or near a window and wait for cold start.
  • Coordinates look stale Check location.isUpdated() and antenna placement.

Common Mistakes

  • Swapping GPS TX/RX incorrectly.
  • Publishing real private coordinates.
  • Expecting indoor fixes.
  • Claiming guaranteed precision.

Testing Checklist

  • Confirm NMEA bytes are received before expecting a fix.
  • Test outdoors with consent.
  • Record only satellite count if privacy matters.

Engineering Tips

  • Keep the patch antenna facing upward.
  • Use fake example coordinates in notes.
  • Separate GPS from Wi-Fi geolocation in explanations.

Upgrade Ideas

  • Add OLED display.
  • Save local CSV logs only with consent.
  • Add a waypoint distance calculator using fake demo coordinates.

Real-World Applications

  • Satellite navigation lesson
  • Outdoor data logger prototype
  • Consent-based field mapping demo

FAQs

Is this a real-time tracker?

No. This page reads local GNSS data and does not upload it.

Can I track someone with it?

Only with clear consent and appropriate legal permission.

Why are coordinates missing indoors?

GPS signals are weak indoors and usually need sky view.

Review, Testing, and References

Author: Abdul Mubeen and the ESP32 Engine editorial team. Last updated: 2026-11-10. Reviewed: wiring logic, Arduino code structure, beginner safety, and learning sequence.

Educational level: Intermediate. Estimated completion time: 60-90 min. This project is for learning and prototyping; production or unattended hardware needs additional engineering review.

Check your result

Before treating this example as working on your hardware, compare the observed behavior with Expected Output and complete the checks on this page. If results differ, use Troubleshooting. Reading this tutorial does not establish successful compilation or hardware operation.

  • UART2 wiring
  • NMEA parsing
  • No-fix handling