GPS-RTK2 Hookup Guide

Pages
Contributors: Nate
Favorited Favorite 11

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.

The SparkFun u-blox Arduino library enables the reading of all positional datums as well as sending binary UBX configuration commands over I2C. This is helpful for configuring advanced modules like the ZED-F9P but also the NEO-M8P-2, SAM-M8Q and any other u-blox module that use the u-blox binary protocol.

Note: We support two versions of the SparkFun u-blox GNSS library. Version 2 and Version 3. Version 3 uses the u-blox Configuration Interface (VALSET and VALGET) to configure the module, instead of the deprecated UBX-CFG messages. For modules like the F9 and M10, we recommend upgrading to Version 3. However, older modules like the M8 do not support the Configuration Interface. For those you will need to keep using Version 2 of the library. We will continue to support both.

The SparkFun u-blox Arduino library can be downloaded with the Arduino library manager by searching 'SparkFun u-blox GNSS v3' or you can grab the zip here from the GitHub repository to manually install.

Once you have the library installed checkout the various examples.

  • Basics
    • Example1: Read NMEA sentences over I2C using u-blox module SAM-M8Q, NEO-M8P, etc
    • Example2: Parse NMEA sentences using MicroNMEA library. This example also demonstrates how to overwrite the processNMEA function so that you can direct the incoming NMEA characters from the u-blox module to any library, display, radio, etc that you prefer.
    • Example3: Get latitude, longitude, altitude, and satellites in view (SIV). This example also demonstrates how to turn off NMEA messages being sent out of the I2C port. You’ll still see NMEA on UART1 and USB, but not on I2C. Using only UBX binary messages helps reduce I2C traffic and is a much lighter weight protocol.
    • Example4: Displays what type of a fix you have the two most common being none and a full 3D fix. This sketch also shows how to find out if you have an RTK fix and what type (floating vs. fixed).
    • Example5: Shows how to get the current speed, heading, and dilution of precision.
    • Example7: Demonstrates how to increase the output rate from the default 1 per second to many per second; up to 30Hz on some modules!
    • Example8: Older modules like the SAM-M8Q utilize an older protocol (version 18) whereas the newer modules like the ZED-F9P depricate some commands using the latest protocol (version 27). This sketch shows how to query the module to get the protocol version.
    • Example9: u-blox modules use I2C address 0x42 but this is configurable via software. This sketch will allow you to change the module’s I2C address.
    • Example10: Altitude is not a simple measurement. This sketch shows how to get both the ellipsoid based altitude and the MSL (mean sea level) based altitude readings.
    • Example11: Sometimes you just need to do a hard reset of the hardware. This sketch shows how to set your u-blox module back to factory default settings.
  • ZED-F9P
    • ZED-F9P Example1: This module is capable of high precision solutions. This sketch shows how to inspect the accuracy of the solution. It’s fun to watch our location accuracy drop into the millimeter scale.
    • ZED-F9P Example2: The ZED-F9P uses a new u-blox configuration system of VALGET/VALSET/VALDEL. This sketch demonstrates the basics of these methods.
    • ZED-F9P Example3: Setting up the ZED-F9P as a base station and outputting RTCM data.
    • ZED-F9P Example4: This is the same example as ZED-F9P's Example3. However, the data is sent to a serial LCD via I2C.

This SparkFun u-blox library really focuses on I2C because it's faster than serial and supports daisy-chaining. The library also uses the UBX protocol because it requires far less overhead than NMEA parsing and does not have the precision limitations that NMEA has.