SparkFun GPS NEO-M9N Hookup Guide

Pages
Contributors: Elias The Sparkiest
Favorited Favorite 3

Introduction

The SparkFun GPS NEO-M9N is the next iteration of u-blox's GPS offerings! We've developed three flavors of the board: one with a small chip antenna, u.FL connector, and SMA connector so that you can select an antenna of your choosing.

SparkFun GPS Breakout - NEO-M9N, Chip Antenna (Qwiic)

SparkFun GPS Breakout - NEO-M9N, Chip Antenna (Qwiic)

GPS-15733
$74.95
3
SparkFun GPS Breakout - NEO-M9N, U.FL (Qwiic)

SparkFun GPS Breakout - NEO-M9N, U.FL (Qwiic)

GPS-15712
$69.95
5
SparkFun GPS Breakout - NEO-M9N, SMA (Qwiic)

SparkFun GPS Breakout - NEO-M9N, SMA (Qwiic)

GPS-17285
$74.95
8

Required Materials

To follow along with this tutorial, you will need the following materials. You may not need everything though depending on what you have. Add it to your cart, read through the guide, and adjust the cart as necessary.

SparkFun RedBoard Qwiic

SparkFun RedBoard Qwiic

DEV-15123
$21.50
20
Qwiic Cable - 100mm

Qwiic Cable - 100mm

PRT-14427
$1.50
USB Micro-B Cable - 6 Foot

USB Micro-B Cable - 6 Foot

CAB-10215
$5.50
15

Additional GPS Antenna Options

Below are some other GPS Antenna options. Make sure to get the u.FL to SMA cable if you decide to use the one with the u.FL connector. Link for that is below in the GPS accessories.

GNSS L1/L2 Multi-Band Magnetic Mount Antenna - 5m (SMA)

GNSS L1/L2 Multi-Band Magnetic Mount Antenna - 5m (SMA)

GPS-15192
$72.95
1
GPS/GNSS Magnetic Mount Antenna - 3m (SMA)

GPS/GNSS Magnetic Mount Antenna - 3m (SMA)

GPS-14986
$13.95
3
GPS/GNSS Embedded Antenna - 1m (SMA)

GPS/GNSS Embedded Antenna - 1m (SMA)

GPS-14987
$64.50
GPS Embedded Antenna SMA

GPS Embedded Antenna SMA

GPS-00177
$12.95

GPS Antenna Accessories

Interface Cable SMA to U.FL - 100mm

Interface Cable SMA to U.FL - 100mm

WRL-09145
$5.50
3

GPS Antenna Ground Plate

GPS-15004
Retired

Other Qwiic Cable Accessories

SparkFun Qwiic Cable Kit

SparkFun Qwiic Cable Kit

KIT-15081
$8.95
22
Qwiic Cable - 100mm

Qwiic Cable - 100mm

PRT-14427
$1.50
Qwiic Cable - 50mm

Qwiic Cable - 50mm

PRT-14426
$0.95

Qwiic Cable - 200mm

PRT-14428
Retired

Suggested Reading

If you aren't familiar with the Qwiic system, we recommend reading here for an overview.

Qwiic Connect System
Qwiic Connect System

We would also recommend taking a look at the following tutorials if you aren't familiar with them.

GPS Basics

The Global Positioning System (GPS) is an engineering marvel that we all have access to for a relatively low cost and no subscription fee. With the correct hardware and minimal effort, you can determine your position and time almost anywhere on the globe.

Serial Peripheral Interface (SPI)

SPI is commonly used to connect microcontrollers to peripherals such as sensors, shift registers, and SD cards.

I2C

An introduction to I2C, one of the main embedded communications protocols in use today.

How to Work with Jumper Pads and PCB Traces

Handling PCB jumper pads and traces is an essential skill. Learn how to cut a PCB trace, add a solder jumper between pads to reroute connections, and repair a trace with the green wire method if a trace is damaged.

Getting Started with U-Center for u-blox

Learn the tips and tricks to use the u-blox software tool to configure your GPS receiver.

Three Quick Tips About Using U.FL

Quick tips regarding how to connect, protect, and disconnect U.FL connectors.

Hardware Overview

Power

Power for this board is 3.3V and we have provided multiple power options. This first and most obvious is the USB-C connector. Secondly, are the Qwiic Connectors on the top and bottom of the board. Thirdly, there is a 5V pin on the PTH header along the side of the board that is regulated down to 3.3V. Make sure that power your provide to this pin does not exceed 6 volts. Finally, just below the 5V pin is a 3.3V pin that should only be provided a clean 3.3V power signal.

Power Pins

Battery

The small metal disk in the upper left corner is a small lithium battery. This battery does not provide power to the IC like the 3.3V system does, but to relevant systems inside the IC that allow for a quick reconnection to satellites. The time to first fix will about ~29 seconds, but after it has a lock, that battery will allow for a two second time to first fix. This is known as a hot start and lasts for four hours after the board is powered down. The battery provides over a years worth of power to the backup system and charges slowly when the board is powered. To charge it to full, leave your module plugged in for 48 hours.

Battery for Hot Start

LEDs

There's is a red power LED just to the left of the bottom Qwiic connector and near the board's edge to indicate that the board is powered. There is another LED just above the power LED labeled PPS that is connected to the Pulse Per Second line. When connected to a satellite, this line generates a pulse that is synchronized with a GPS or UTC time grid. By default, you'll see one pulse a second.

Status LEDs

Jumpers

There are four jumpers on the underside of the product, each labeled with its function. At the upper right of the picture is a three way jumper labeled I²C that connects two pull-up resistors to the I2C data lines. If you have many devices on your I2C data lines, then you may consider cutting these. On the left side of the board is a jumper labeled PWR. If you cut this trace it will disconnect the Power LED. Just below is the PPS jumper that when cut disconnects the PPS LED. Finally, there's a jumper labeled SPI which enables the SPI data bus thus disabling the UART functions on those lines. For more information, check out our tutorial on working with jumper pads and PCB traces.

Jumpers on the Back

Chip Antenna, U.FL, or SMA

The SparkFun GPS NEO-M9N with Chip Antenna has a GNSS antenna near its left Qwiic connector while its cousins have either a U.FL and SMA connector in which you can connect a patch antenna.

Chip Antenna u.FL SMA
Chip Antenna U.FL SMA

Qwiic and I2C

There are two pins labeled SDA and SCL which indicates the I2C data lines. Similarly, you can use either of the Qwiic connectors to provide power and utilize I2C. The Qwiic ecosystem is made for fast prototyping by removing the need for soldering. All you need to do is plug a Qwiic cable into the Qwiic connector and voila!

I2C Pins and Qwiic connector

SPI

There are four pins on the right most header that are labeled with their corresponding SPI functionality. As mentioned in the jumpers section, you'll need to close the SPI jumper on the underside to enable SPI.

SPI Pins

UART

There are two pins on the right most header labeled for their UART functionality.

UART Pins

Broken Out Pins

There are four other pins broken out: Pulse per second (PPS), Reset (RST), Safeboot (SAFE), and finally the interrupt pin (INT). The first pin PPS, outputs pulse trains synchronized with the GPS or UTC time grid. The signal defaults to once per second but is configurable over a wide range. Read the u-blox Receiver Protocol Specification in the Resources and Going Further tab for more information. The reset pin resets the chip. The next pin, SAFE is used to start up the IC in safe boot mode, this could be useful if you somehow manage to corrupt the module's Flash memory. The final pin INT can be used to wake the chip from power save mode.

Additional Pins Broken Out

Board Dimensions

Overall, the boards are 1.30"x1.60". The location of a majority of the components are the same with the exception of the SMD chip antenna and the u.FL connector.

Board Dimension for Chip Antenna Version Board Dimension for u.FL Version Board Dimension for SMA Version
Chip Antenna Version u.FL Version SMA Version

Click on image for a closer view.

GPS Capabilities

The SparkFun NEO-M9N is able to connect to up to four different GNSS constellations at a time making it very accurate for its size. Below are the listed capabilities of the GPS unit when connecting to multiple GNSS constellations and when connecting to a single constellation.

Constellations GPS+GLO+GAL+BDS GPS+GLONASS+GAL GPS+GLO GPS+BDS GPS+GAL
Horizontal Position Accuracy 2m2m2m2m2m
Max Navigation Update Rate PVT 25Hz 25Hz 25Hz25Hz25Hz
Time-To-First-Fix Cold Start24s 25s 26s 28s29s
Hot Start 2s 2s 2s 2s 2s
SensitivityTracking and Navigation -167dBm -167dBm -167dBm -1667dBm -166dBm
Reacquisition -160dBm -160dBm -160dBm -160dBm -160dBm
Cold Start-148dBm -148dBm -148dBm -148dBm -148dBm
Hot Start -159dBm -159dBm -159dBm -159dBm-159dBm
Velocity Accuracy 0.05m/s 0.05m/s 0.05m/s 0.05m/s 0.05m/s
Heading Accuracy 0.3deg 0.3deg 0.3deg 0.3deg 0.3deg


When using a single GNSS constellation:

Constellation GPS GLONASS BEIDOU Galileo
Horizontal Position Accuracy 2m4m3m3m
Max Navigation Update Rate PVT 25Hz 25Hz 25Hz 25Hz
Time-To-First-Fix Cold Start 29s 27s 32s 42s
Hot Start 2s 2s 2s 2s
SensitivityTracking and Navigation -166dBm -164dBm -160dBm -159dBm
Reacquisition -160dBm -155dBm -157dBm -154dBm
Cold Start-148dBm -145dBm -145dBm -140dBm
Hot Start -159dBm -156dBm -159dBm -154dBm
Velocity Accuracy 0.05m/s 0.05m/s 0.05m/s 0.05m/s
Heading Accuracy 0.3deg 0.3deg 0.3deg 0.3deg

Hardware Assembly

For this example, I used a Qwiic capable RedBoard and associated USB cable. connecting the boards with Qwiic cable, the assembly is very simple. Plug a Qwiic cable between the RedBoard and the SparkFun NEO-M9N with chip antenna and that's it! Just as easily I could have used the version with the U.FL connector and plugged in one of our patch antennas to the GPS board. If you need tips on plugging in the U.FL connector, then check out our U.FL tutorial. If you're going to be soldering to the through hole pins for I2C functionality, then just attach lines to power, ground, and the I2C data lines to a microcontroller of your choice.

GPS with Antenna Connected to RedBoard Qwiic

For a secure connection with an external antenna, we recommend using the SMA version.

GPS with External Antenna Connected to RedBoard Qwiic

SparkFun u-blox Arduino Library

Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE. If you have not previously installed an Arduino library, please check out our installation guide.

All of our u-blox based GPS boards share the same library: these two boards, their predeccesors and the higher precision u-blox cousins. The SparkFun u-blox Arduino library can be downloaded with the Arduino library manager by searching 'SparkFun u-blox GNSS' or you can grab the zip here from the GitHub repository to manually install:

There are 13 example sketches provided to get you up and receiving messages from space. We'll go over one of the examples in this tutorial.

Example Code

We're just going to look at example two (i.e. "Example2_NMEAParsing.ino") which in my opinion, makes it clear the awesomeness of these GPS receivers. That is to say, talking to satellites and finding out where in the world you are.

language:c
#include <Wire.h> //Needed for I2C to GPS

#include "SparkFun_u-blox_GNSS_Arduino_Library.h" //Click here to get the library: http://librarymanager/All#SparkFun_u-blox_GNSS
SFE_UBLOX_GNSS myGNSS;

void setup()
{
  Serial.begin(115200);
  Serial.println("SparkFun u-blox Example");

  Wire.begin();

  if (myGNSS.begin() == false)
  {
    Serial.println(F("u-blox GNSS module not detected at default I2C address. Please check wiring. Freezing."));
    while (1);
  }

  //This will pipe all NMEA sentences to the serial port so we can see them
  myGNSS.setNMEAOutputPort(Serial);
}

void loop()
{
  myGNSS.checkUblox(); //See if new data is available. Process bytes as they come in.

  delay(250); //Don't pound too hard on the I2C bus
}

When you upload this code you'll have to wait ~29s to get a lock onto any satellites. After that first lock, the backup battery on the board will provide power to some internal systems that will allow for a hot start the next time you turn on the board. The hot start only lasts four hours, but allows you to get a lock within one second. After you get a lock the serial terminal will start listing longitude and latitude coordinates, as seen below. Make sure to set the serial monitor to 115200 baud.

This image shows a screenshot of the Arduino Serial terminal spitting out latitude and longitude data.

These are the coordinates for SparkFun HQ

Resources and Going Further

Now that you've successfully got your GPS receiver up and running, it's time to incorporate it into your own project! For more information, check out the resources below:

Are you looking for a GPS receiver with an insane 10mm 3D accuracy, then check out the two other u-Blox based GPS boards by SparkFun (ZED-F9P and NEO-M8P-2) on the left below. Need a smaller more compact GPS unit but don't need as high of a refresh rate, check out the ZOE-M8Q and SAM-M8Q on the right.

SparkFun GPS-RTK2 Board - ZED-F9P (Qwiic)

SparkFun GPS-RTK2 Board - ZED-F9P (Qwiic)

GPS-15136
$249.95
21
SparkFun GPS Breakout - ZOE-M8Q (Qwiic)

SparkFun GPS Breakout - ZOE-M8Q (Qwiic)

GPS-15193
$49.95
8
SparkFun GPS-RTK Board - NEO-M8P-2 (Qwiic)

SparkFun GPS-RTK Board - NEO-M8P-2 (Qwiic)

GPS-15005
$264.95 $179.95
7
SparkFun GPS Breakout - Chip Antenna, SAM-M8Q (Qwiic)

SparkFun GPS Breakout - Chip Antenna, SAM-M8Q (Qwiic)

GPS-15210
$42.95 $30.07
5

Need some inspiration for your next project? Check out some of these related tutorials:

GPS Shield Hookup Guide

This tutorial shows how to get started with the SparkFun GPS Shield and read and parse NMEA data with a common GPS receiver.

Copernicus II Hookup Guide

A guide for how to get started with the Copernicus II GPS module.

Displaying Your Coordinates with a GPS Module

This Arduino tutorial will teach you how to pinpoint and display your GPS coordinates with a press of a button using hardware from our Qwiic Connect System (I2C).

RFID Beginners Tutorial

Make a remote work logger using an RFID reader and a GPS module. Scan a card and get ID, location, and time. All the perfect data to punch in and punch out from the middle of Nowhere!