ESP32 C3 Super Mini - GPS

A NEO-6M GPS module lets the ESP32 C3 Super Mini find its place on Earth using satellite signals. This ESP32 C3 Super Mini GPS tutorial shows the wiring and two ready-to-use sketches. No GPS experience is needed.

In this tutorial, you'll learn:

ESP32 C3 Super Mini - GPS

Hardware Preparation

1×ESP32 C3 Super Mini
1×USB Cable Type-A to Type-C (for USB-A PC)
1×USB Cable Type-C to Type-C (for USB-C PC)
1×NEO-6M GPS module
1×Jumper Wires
1×Breadboard

Or you can buy the following kits:

1×DIYables Sensor Kit (18 sensors/displays)
Disclosure: Some of the links provided in this section are Amazon affiliate links. We may receive a commission for any purchases made through these links at no additional cost to you.
Additionally, some of these links are for products from our own brand, DIYables .

Overview of NEO-6M GPS module

The NEO-6M GPS module is a satellite receiver that sends position, speed and time data over a serial connection.

Key Features:

  • Rich data: Gives longitude, latitude, altitude, speed, date and time
  • Simple connection: Needs only 4 wires
  • Easy to program: The TinyGPSPlus library decodes the data for you
  • External antenna: A small antenna comes with the module for a better signal

Technical Specifications:

  • Supply voltage: 3.3V or 5V
  • Communication: Serial (UART) at 9600 baud by default
  • Position accuracy: About 2.5 meters
  • Update rate: 1 reading per second by default

Pinout

The NEO-6M GPS module has 4 pins.

  • VCC: Power pin - connect it to VCC (3.3V or 5V). This tutorial uses 3.3V
  • GND: Ground pin - connect it to GND (0V)
  • TX: Sends data from the GPS module to the board - connect it to the Serial RX pin of the ESP32 C3 Super Mini
  • RX: Receives data from the board - connect it to the Serial TX pin of the ESP32 C3 Super Mini
NEO-6M GPS module Pinout

Wiring Diagram

Connect the GPS module to the ESP32 C3 Super Mini with 4 wires, as shown below.

  • Note: TX goes to RX and RX goes to TX. The two data wires always cross.
  • Note: GPIO20 and GPIO21 are the default serial pins of the board. Keep them free for this project.
  • Note: GND of the module and GND of the board must be joined.
The wiring diagram between ESP32 C3 Super Mini GPS module

This image is created using Fritzing. Click to enlarge image

The diagram below shows the same connections without a breadboard:

The wiring diagram between ESP32 C3 Super Mini GPS module  (No Breadboard)

This image is created using Fritzing. Click to enlarge image

NEO-6M GPS Module Pin ESP32 C3 Super Mini Pin
VCC 3.3V
GND GND
TX GPIO7 (RX of Serial1)
RX GPIO6 (TX of Serial1)

ESP32 C3 Super Mini Code

Reading GPS coordinates, speed (km/h), and date time

This sketch reads all the main GPS data and prints it to the Serial Monitor.

What This Code Does:

  • Opens two serial ports: One for the Serial Monitor at 115200 baud, and Serial1 for the GPS module at 9600 baud
  • Decodes the GPS data: Passes each byte from GPIO7 to the TinyGPSPlus library
  • Prints the results: Shows latitude, longitude, altitude, speed and date time
  • Marks missing data: Prints INVALID for any value the module does not have yet
  • Checks the wiring: Prints a warning if no GPS data arrives after 5 seconds
/* * This ESP32 C3 Super Mini code was developed by newbiely.com * * This ESP32 C3 Super Mini code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/esp32-c3/esp32-c3-super-mini-gps */ #include <TinyGPS++.h> #define RX1PIN 7 // The ESP32 C3 SuperMini pin connected to the TX of the GPS module #define TX1PIN 6 // The ESP32 C3 SuperMini pin connected to the RX of the GPS module TinyGPSPlus gps; // The TinyGPS++ object void setup() { Serial.begin(115200); Serial1.begin(9600, SERIAL_8N1, RX1PIN, TX1PIN); Serial.println(F("Arduino - GPS module")); } void loop() { if (Serial1.available() > 0) { if (gps.encode(Serial1.read())) { if (gps.location.isValid()) { Serial.print(F("- latitude: ")); Serial.println(gps.location.lat()); Serial.print(F("- longitude: ")); Serial.println(gps.location.lng()); Serial.print(F("- altitude: ")); if (gps.altitude.isValid()) Serial.println(gps.altitude.meters()); else Serial.println(F("INVALID")); } else { Serial.println(F("- location: INVALID")); } Serial.print(F("- speed: ")); if (gps.speed.isValid()) { Serial.print(gps.speed.kmph()); Serial.println(F(" km/h")); } else { Serial.println(F("INVALID")); } Serial.print(F("- GPS date&time: ")); if (gps.date.isValid() && gps.time.isValid()) { Serial.print(gps.date.year()); Serial.print(F("-")); Serial.print(gps.date.month()); Serial.print(F("-")); Serial.print(gps.date.day()); Serial.print(F(" ")); Serial.print(gps.time.hour()); Serial.print(F(":")); Serial.print(gps.time.minute()); Serial.print(F(":")); Serial.println(gps.time.second()); } else { Serial.println(F("INVALID")); } Serial.println(); } } if (millis() > 5000 && gps.charsProcessed() < 10) Serial.println(F("No GPS data received: check wiring")); }

Detailed Instructions

Follow these bullets to run the GPS sketch.

  • New to ESP32 C3 Super Mini? Complete our Getting Started with ESP32 C3 Super Mini tutorial first to set up your development environment.
  • Wire it: Connect the components as shown in the diagram above.
  • Connect the board: Plug the ESP32 C3 Super Mini into your computer with a USB Type-C cable.
  • Open the IDE: Launch the Arduino IDE on your computer.
  • Select the board: Make sure ESP32 C3 Super Mini is selected in Tools > Board, and pick its COM port.
  • Open the library manager: Click the Libraries icon on the left bar of the Arduino IDE.
  • Find the library: Search “TinyGPSPlus”, then find the TinyGPSPlus library by Mikal Hart.
  • Install it: Click the Install button.
ESP32 C3 Super Mini TinyGPS++ library
  • Add the code: Copy the code above and open it in the Arduino IDE.
  • Upload: Click the Upload button to send the code to the ESP32 C3 Super Mini.
  • Open the Serial Monitor: Set the baud rate to 115200 and see the result.
  • Pro Tip: Take the antenna outside or put it next to a window. GPS signals do not pass well through walls, and the first fix can take a few minutes.
∞
Newbiely | Arduino IDE 2.3.8
──
☐
✕
File
Edit
Sketch
Tools
Help
ESP32C3 Dev Module
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32C3 Dev Module' on 'COM15')
New Line
9600 baud
Arduino - GPS module - latitude: 48.86 - longitude: 2.35 - altitude: 41.20 - speed: 0.37 km/h - GPS date&time: 2026-11-5 8:42:17 - latitude: 48.86 - longitude: 2.35 - altitude: 41.20 - speed: 0.37 km/h - GPS date&time: 2026-11-5 8:42:17 - latitude: 48.86 - longitude: 2.35 - altitude: 41.30 - speed: 0.52 km/h - GPS date&time: 2026-11-5 8:42:18 - latitude: 48.86 - longitude: 2.35 - altitude: 41.30 - speed: 0.44 km/h - GPS date&time: 2026-11-5 8:42:19
Ln 11, Col 1
ESP32C3 Dev Module on COM15
2
  • Before the first fix: You will see - location: INVALID. This is normal, so give the module some time.
  • No data at all: No GPS data received: check wiring means the board gets nothing on GPIO7. Check the TX and RX wires first.

Calculating the distance from current location to a predefined location

The code below calculates the distance between the current location and London (lat: 51.508131, long: -0.128002).

What This Code Does:

  • Stores a fixed place: Keeps the coordinates of London in two constants
  • Reads your position: Gets the current latitude and longitude from the GPS module
  • Finds the distance: Uses TinyGPSPlus::distanceBetween() and converts the result to kilometers
  • Prints the results: Shows latitude, longitude and the distance to London on the Serial Monitor
/* * This ESP32 C3 Super Mini code was developed by newbiely.com * * This ESP32 C3 Super Mini code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/esp32-c3/esp32-c3-super-mini-gps */ #include <TinyGPS++.h> #define RX1PIN 7 // The ESP32 C3 SuperMini pin connected to the TX of the GPS module #define TX1PIN 6 // The ESP32 C3 SuperMini pin connected to the RX of the GPS module TinyGPSPlus gps; // The TinyGPS++ object const double LONDON_LAT = 51.508131; const double LONDON_LON = -0.128002; void setup() { Serial.begin(115200); Serial1.begin(9600, SERIAL_8N1, RX1PIN, TX1PIN); Serial.println(F("Arduino - GPS module")); } void loop() { if (Serial1.available() > 0) { if (gps.encode(Serial1.read())) { if (gps.location.isValid()) { double latitude = gps.location.lat(); double longitude = gps.location.lng(); unsigned long distanceKm = TinyGPSPlus::distanceBetween(latitude, longitude, LONDON_LAT, LONDON_LON) / 1000; Serial.print(F("- latitude: ")); Serial.println(latitude); Serial.print(F("- longitude: ")); Serial.println(longitude); Serial.print(F("- distance to London: ")); Serial.println(distanceKm); } else { Serial.println(F("- location: INVALID")); } Serial.println(); } } if (millis() > 5000 && gps.charsProcessed() < 10) Serial.println(F("No GPS data received: check wiring")); }

Detailed Instructions

The wiring and the library stay the same, so only the code changes.

  • New to ESP32 C3 Super Mini? Complete our Getting Started with ESP32 C3 Super Mini tutorial first to set up your development environment.
  • Add the code: Copy the code above and open it in the Arduino IDE.
  • Select the board: Make sure ESP32 C3 Super Mini is selected in Tools > Board.
  • Upload: Click the Upload button to send the code to the ESP32 C3 Super Mini.
  • Open the Serial Monitor: Set the baud rate to 115200 and see the result.
  • Pro Tip: Change LONDON_LAT and LONDON_LON to the coordinates of your home to measure how far you are from it.
∞
Newbiely | Arduino IDE 2.3.8
──
☐
✕
File
Edit
Sketch
Tools
Help
ESP32C3 Dev Module
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32C3 Dev Module' on 'COM15')
New Line
9600 baud
Arduino - GPS module - latitude: 48.86 - longitude: 2.35 - distance to London: 343 - latitude: 48.86 - longitude: 2.35 - distance to London: 343 - latitude: 48.86 - longitude: 2.35 - distance to London: 343 - latitude: 48.86 - longitude: 2.36 - distance to London: 344
Ln 11, Col 1
ESP32C3 Dev Module on COM15
2

Application and Project Ideas

The ESP32 C3 Super Mini and a GPS module work well in many small location projects.

  • Bike speedometer: Show your speed in km/h while you ride
  • Trip logger: Save your route to an SD card and view it later
  • Pet or bag tracker: Send the position over WiFi when the board is in range
  • Geofence alarm: Turn on a buzzer when you move too far from a fixed place
  • GPS clock: Show the exact date and time on an LCD or OLED
  • Distance to home: Show how far you are from your home on a small display

Challenge Yourself

Try these small upgrades to learn more about GPS on the ESP32 C3 Super Mini.

  • Easy: Print latitude and longitude with 6 decimal places using Serial.println(gps.location.lat(), 6)
  • Easy: Replace London with your own city
  • Medium: Print the speed in miles per hour with gps.speed.mph()
  • Medium: Print the number of satellites in use with gps.satellites.value()
  • Advanced: Add 7 hours (or your own time zone) to the GPS time to show local time
  • Advanced: Blink the built-in LED on GPIO8 when you get closer than 1 km to your target

Learn More

※ OUR MESSAGES

  • As freelancers, We are AVAILABLE for HIRE. See how to outsource your project to us
  • Please feel free to share the link of this tutorial. However, Please do not use our content on any other websites. We invested a lot of effort and time to create the content, please respect our work!