Component guide · Intermediate · 4 min read
NEO-M8N GPS Module

Pinout, Wiring and Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
The NEO-M8N is a u-blox GNSS receiver that tracks GPS plus GLONASS, Galileo or BeiDou at once, so it gets a fix faster and holds it better than the older NEO-6M. It outputs NMEA sentences over UART at 9600 baud, can update up to 10 times a second, and many drone versions add a compass (HMC5883L or QMC5883L) on I2C in the same case.
Key specs at a glance
- Receiver
- u-blox M8, 72 channels
- Systems
- GPS + one of GLONASS, Galileo, BeiDou at a time
- Accuracy
- About 2.5 m CEP in open sky
- Update rate
- 1 Hz default, up to 10 Hz
- Interface
- UART 9600 baud default (NMEA and UBX), some with I2C compass
- Supply
- 3.3 to 5 V on most modules
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1NEO-M8N GPS Module w/ SMA External Antenna₹1,159
Option 2u-blox NEO-M8N GPS Module w/ Ceramic Active Antenna₹739
Option 3NEO-M8N GPS Module with Compass for APM & Pixhawk₹2,449
Option 4ReadyToSky NEO-M8N GPS Module w/ Compass for APM/Pixhawk₹2,309
Option 5NEO-M8N GPS & Compass Module for DJI Naza M V1/V2 FC₹2,199
Option 6M5Stack COM.GPS (NEO-M8N) Module w/ External Antenna₹2,549
What the NEO-M8N GPS module is
Using two satellite systems roughly doubles the satellites in view, which helps under trees and between buildings. The first fix outdoors takes about 30 seconds cold, and a few seconds after that with the backup battery.
Drone versions are a round puck with a 6-pin GPS plug and a 4-pin compass plug for Pixhawk and similar flight controllers. Square boards with an SMA or ceramic antenna suit Arduino and ESP32 trackers.
NEO-M8N GPS module pinout
The pins on the NEO-M8N GPS module and what each one does.
| Pin | Function |
|---|---|
| VCC | Supply, 3.3 to 5 V (check your module) |
| GND | Ground |
| TX | GPS transmit (NMEA), to the controller's RX |
| RX | GPS receive, for configuration |
| SDA / SCL | Compass on I2C (drone versions) |
| PPS | One pulse per second when fixed (some boards) |
- VCC
- Supply, 3.3 to 5 V (check your module)
- GND
- Ground
- TX
- GPS transmit (NMEA), to the controller's RX
- RX
- GPS receive, for configuration
- SDA / SCL
- Compass on I2C (drone versions)
- PPS
- One pulse per second when fixed (some boards)
Wiring the NEO-M8N GPS module
The GPS TX is 3.3 V, which a 5 V Uno reads fine. Put the antenna face up with a clear view of the sky; it will not get a fix indoors away from windows.
| NEO-M8N GPS module pin | Arduino Uno | ESP32 |
|---|---|---|
| VCC | 5V | 3V3 or 5V (VIN) |
| GND | GND | GND |
| TX | D4 (SoftwareSerial RX) | GPIO 16 (RX2) |
| RX | D3 through a divider (optional) | GPIO 17 (TX2) |
| SDA / SCL | A4 / A5 (compass) | GPIO 21 / 22 (compass) |
- VCC
- Arduino Uno:
- 5V
- ESP32:
- 3V3 or 5V (VIN)
- GND
- Arduino Uno:
- GND
- ESP32:
- GND
- TX
- Arduino Uno:
- D4 (SoftwareSerial RX)
- ESP32:
- GPIO 16 (RX2)
- RX
- Arduino Uno:
- D3 through a divider (optional)
- ESP32:
- GPIO 17 (TX2)
- SDA / SCL
- Arduino Uno:
- A4 / A5 (compass)
- ESP32:
- GPIO 21 / 22 (compass)
Example code
Install TinyGPSPlus by Mikal Hart. Use u-center on a PC (through a USB to TTL adapter) to change the update rate or the satellite systems.
#include <TinyGPSPlus.h>
TinyGPSPlus gps;
void setup() {
Serial.begin(115200);
Serial2.begin(9600, SERIAL_8N1, 16, 17);
}
void loop() {
while (Serial2.available()) gps.encode(Serial2.read());
static uint32_t last = 0;
if (millis() - last > 1000) {
last = millis();
if (gps.location.isValid()) {
Serial.printf("%.6f, %.6f sats: %d speed: %.1f km/h\n",
gps.location.lat(), gps.location.lng(), gps.satellites.value(), gps.speed.kmph());
} else {
Serial.printf("Waiting for fix, sats: %d\n", gps.satellites.value());
}
}
}Setup and tuning
take it outdoors for a few minutes the first time.
the ceramic patch must face the sky; metal above it blocks the signal.
set 5 or 10 Hz in u-center for drones and fast vehicles, and raise the baud rate to match.
mount it away from motors and power wires; calibrate it in the flight controller.
What you need
Shop this list10 of 11 found in our store · ₹12,066
NEO-M8N GPS Module w/ SMA External Antenna: the part this guide coversNEO-M8N GPS Module w/ SMA External Antenna₹1,159
u-blox NEO-M8N GPS Module w/ Ceramic Active Antenna: another version this guide coversu-blox NEO-M8N GPS Module w/ Ceramic Active Antenna₹739
NEO-M8N GPS Module with Compass for APM & Pixhawk: another version this guide coversNEO-M8N GPS Module with Compass for APM & Pixhawk₹2,449
ReadyToSky NEO-M8N GPS Module w/ Compass for APM/Pixhawk: another version this guide coversReadyToSky NEO-M8N GPS Module w/ Compass for APM/Pixhawk₹2,309
NEO-M8N GPS & Compass Module for DJI Naza M V1/V2 FC: another version this guide coversNEO-M8N GPS & Compass Module for DJI Naza M V1/V2 FC₹2,199
M5Stack COM.GPS (NEO-M8N) Module w/ External Antenna: another version this guide coversM5Stack COM.GPS (NEO-M8N) Module w/ External Antenna₹2,549
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389- Uno R3 development board: the controller used in the wiring tableFind this part
0.96 inch OLED display 128x64: to show readings without a computer0.96" OLED Display 128x64₹139Closest match, check the specs
USB to TTL serial converter: to talk to the module from a PCUSB to TTL Serial Converter (CH340G / CP2102 / FT232RL / PL2303)₹85Closest match, check the specs
Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
Alternatives and when to choose them
- NEO-6M GPS: GPS only, cheaper, slower to fix.
- Drone GPS, compass and RTK: flight controller GPS units and centimetre RTK.
- QMC5883L compass: the compass chip on many M8N pucks.
Common mistakes to avoid
- Testing indoors and waiting forever for a fix.
- Swapping TX and RX.
- Mounting the antenna upside down or under metal.
- Mounting the compass next to motor wires so the heading drifts.
Frequently asked questions
NEO-M8N or NEO-6M?
The NEO-M8N tracks two satellite systems, gets a fix faster and holds it better; choose it for drones and trackers.
Does it work with Arduino?
Yes, it sends standard NMEA at 9600 baud; TinyGPSPlus decodes it.
How accurate is it?
About 2 to 3 m in open sky. For centimetres you need RTK.
Why no fix?
It needs a clear sky view; indoors it usually cannot see enough satellites.
How do I read the compass?
Read the HMC5883L or QMC5883L on the SDA and SCL wires with its own library.
Parts for this guide
Projects that use it
Put this into practice: 8 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

