Steve Zafeiriou (b. 1998, Thessaloniki, GR) is a New Media Artist, Technologist, and Founder of Saphire Labs. His practice investigates how technology can influence, shape, and occasionally distort the ways individuals perceive the external world. By employing generative algorithms, electronic circuits, and interactive installations, he examines human behavior in relation to the illusory qualities of perceived reality, inviting observers to reconsider their assumptions and interpretations.

In search of IKIGAI
dark mode light mode Search Menu
NEO-6M GPS sensor module connected to Arduino – Essential guide for ESP32 GPS module integration with Arduino for real-time location tracking.

ESP32 GPS Module Setup: A Complete Guide for Beginners (2025)

As a new media artist and technologist, I have experimented a lot with GPS tracking, location-based projects, and interactive installations.

The ESP32 is a microcontroller with built-in WiFi and Bluetooth, making it well-suited for GPS module integration.

However, when I first started using GPS with ESP32, setting up a reliable connection was challenging.

This guide provides a structured approach to esp32 GPS module setup, covering wiring, library installation, coding, and troubleshooting.

By following these steps, you will establish a functional GPS tracker capable of reading and processing data using an esp32 or an arduino nano for various applications.

ESP32 GPS module setup with wiring connections – Step-by-step guide to configuring an ESP32 GPS tracker for accurate location tracking
ESP32 GPS Module Setup

Understanding GPS Modules

GPS modules such as the NEO-6M GPS and NEO-M8N utilize satellite signals to determine location, transmitting NMEA sentences that contain latitude, longitude, speed, and time data.

Common GPS Modules

  1. NEO-6M GPS: Cost-effective, widely used, and beginner-friendly.
  2. NEO-M8N GPS: Offers improved accuracy and faster signal acquisition.
  3. SIM808: Combines GPS tracking with GSM communication for cellular applications.

Selecting the right GPS module depends on your specific requirements.

If basic tracking suffices, the ESP32 NEO-6M GPS is an excellent option, while the ESP32 NEO-M8N GPS is preferable for enhanced accuracy.

Choosing the Right GPS Module for Your Project

Key Factors to Consider

  1. GPS update rate: Higher update rates ensure smoother tracking.
  2. GPS power requirements: Essential for battery-powered projects.
  3. GPS external antenna: Enhances signal reception in obstructed environments.
  4. GPS I2C module: Some GPS modules support I2C communication, though UART is more common.

For most projects, a UART-based GPS module like the NEO-6M is the most straightforward option.

Wiring the ESP32 to a GPS Module

Step-by-Step Wiring Guide

GPS ModuleESP32
VCC (5V)5V
GNDGND
TXGPIO16 (RX2)
RXGPIO17 (TX2)
ESP32 GPS Module Setup

This configuration utilizes ESP32 UART communication on UART2. If different pins are used, adjust the code accordingly.

LilyGO T-Display S3 microcontroller setup with wiring and screen interface, ideal for IoT and display-based projects, from Steve Zafeiriou’s resources.
ESP32 GPS Module Setup

Installing Required Libraries for GPS Communication

To process GPS data, install the TinyGPS++ library in Arduino IDE:

  1. Open Arduino IDE.
  2. Go to Sketch > Include Library > Manage Libraries.
  3. Search for TinyGPS++ and install it.
  4. Also, install HardwareSerial if not already included.

If you’re using MicroPython, you can use the micropyGPS library instead.

Writing and Uploading the ESP32 GPS Module Code

Below is a basic GPS module code to read latitude and longitude:

#include <TinyGPS++.h>
#include <HardwareSerial.h>

static const int RXPin = 16, TXPin = 17;
static const uint32_t GPSBaud = 9600;

TinyGPSPlus gps;
HardwareSerial mySerial(2);

void setup() {
    Serial.begin(115200);
    mySerial.begin(GPSBaud, SERIAL_8N1, RXPin, TXPin);
}

void loop() {
    while (mySerial.available() > 0) {
        gps.encode(mySerial.read());
        if (gps.location.isUpdated()) {
            Serial.print("Latitude: "); Serial.println(gps.location.lat(), 6);
            Serial.print("Longitude: "); Serial.println(gps.location.lng(), 6);
        }
    }
}

Upload the ESP32 GPS Arduino IDE code, open the Serial Monitor, and set the ESP32 GPS baud rate to 115200.

If correctly configured, latitude and longitude values should be displayed.

ESP32 GPS MODULE: No signal detected on GPS satellite module – Troubleshooting ESP32 GPS issues related to weak signals and satellite reception.
ESP32 GPS Module Setup

Troubleshooting Common GPS Issues

GPS Module Not Detecting Satellites

  1. Move to an open area: GPS signals are weak indoors.
  2. Utilize an ESP32 GPS external antenna if available.
  3. Allow 30 seconds or more for the initial fix.

Incorrect Baud Rate

  1. Verify the ESP32 GPS baud rate (default: 9600).
  2. If unclear data appears, test alternative baud rates.

No Data in Serial Monitor

  1. Confirm proper ESP32 GPS hardware setup (TX/RX connections).
  2. Ensure sufficient ESP32 GPS power requirements.
  3. Switch to an alternative ESP32 GPS UART communication port if necessary.
GeoVision V2 map visualization demonstrating dynamic and detailed geographic mapping capabilities for comprehensive spatial analysis.
ESP32 GPS Module Setup

Visualizing GPS Data on a Map

Once the GPS data processing is functional, visualize it on a map:

  1. Transmit GPS coordinates to a web server using Websockets.
  2. Display data on Google Maps.
  3. Implement GPS real-time tracking using Python or JavaScript.

For tracking applications, log GPS coordinates and upload them to GPS cloud storage.

GeoVision v1.0 - Interactive Installation by Steve Zafeiriou, 2024.
ESP32 GPS Module Setup

Try the LilyGo T-Display S3 with your setup!

Conclusion

Configuring an GPS module requires proper wiring, library setup, and troubleshooting.

With a working ESP32 GPS tracker, you can expand functionality by integrating GPS logging, GPS Bluetooth transmission, or GPS visualisations.

Whether you are developing an GPS DIY project, a geofencing system, or a location-aware art installation, this guide provides the foundation to bring your vision to life.

Frequently Asked Questions (FAQ)

Why is my GPS module not receiving a signal?

One of the most common issues is an obstructed location, as GPS signals require a clear view of the sky.

Moving to an open outdoor space can significantly improve signal acquisition.

Additionally, using an external GPS antenna can enhance reception, especially in environments with interference.

Power supply issues can also affect performance, so it is essential to ensure that the GPS module receives the correct voltage based on its specifications.

Another factor to consider is the baud rate configuration, as many GPS modules default to 9600 baud, and an incorrect setting can prevent proper communication.

Finally, the first satellite fix can take between 30 to 60 seconds after startup, so allowing sufficient time for initialization is crucial.

How do I correctly wire an ESP32 to a GPS module?

The GPS module requires a stable power supply, typically 3.3V or 5V, depending on its specifications.

A secure ground connection between the ESP32 and the GPS module is also necessary to establish proper electrical communication.

The TX pin of the GPS module should be connected to the RX pin of the ESP32, while the RX pin of the GPS module should be connected to the TX pin of the ESP32.

It is important to check the correct GPIO pins assigned for UART communication, as different ESP32 models may use different pin configurations.

Incorrect wiring or swapped TX and RX connections can result in no data being received from the GPS module.

How can I parse GPS data from an ESP32 GPS module?

Parsing GPS data from an ESP32 GPS module requires the use of a library that can interpret NMEA sentences, which contain location, speed, and time information.

The TinyGPS++ library is a widely used option when working with Arduino IDE, as it allows for structured extraction of GPS data.

Once installed, the library can read incoming NMEA sentences and convert them into usable latitude and longitude values.

These values can then be displayed on the serial monitor for real-time tracking. For those using MicroPython instead of Arduino IDE, the micropyGPS library provides similar functionality.

Correctly processing GPS data ensures that location-based applications can effectively utilize the retrieved coordinates.

Can I send GPS data from ESP32 to the cloud or a web server?

ESP32 GPS data can be transmitted to a cloud service or web server through various communication protocols.

One common method is using Websockets, which allows real-time data transmission to an IoT platform.

Another approach involves using WiFi to upload GPS coordinates to a remote database or API for further processing.

Google Maps integration can also be implemented to visualize GPS data online, making it easier to track movement.

For more advanced applications, cloud storage services such as Firebase or AWS can be used to log and retrieve historical GPS data.

How can I improve the accuracy of my ESP32 GPS module?

Using an external antenna is one of the most effective ways to improve GPS reception, as it enhances signal strength and reduces interference.

Choosing a high-performance GPS module, such as the NEO-M8N, can also lead to better accuracy compared to older models like the NEO-6M.

Increasing the GPS update rate allows for smoother real-time tracking, particularly in fast-moving applications.

Additionally, implementing filtering algorithms can help eliminate signal noise and improve data reliability.

Ensuring that the module has a clear view of the sky is also critical, as buildings, trees, and other obstacles can obstruct satellite signals, reducing overall accuracy.

Total
0
Shares