• Stars
    star
    217
  • Rank 182,446 (Top 4 %)
  • Language
    C++
  • License
    Other
  • Created almost 4 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Arduino library which allows you to communicate seamlessly with the full range of u-blox GNSS modules

SparkFun u-blox Arduino GNSS Library

SparkFun GPS-RTK2 - ZED-F9P (GPS-15136) SparkFun GPS-RTK - NEO-M8P-2 (GPS-15005) SparkFun ZOE-M8Q Breakout (GPS-15193) SparkFun SAM-M8Q Breakout (GPS-15210) SparkFun NEO-M9N Breakout (GPS-15733)

u-blox makes some incredible GNSS receivers covering everything from low-cost, highly configurable modules such as the SAM-M8Q all the way up to the surveyor grade ZED-F9P with precision of the diameter of a dime. This library supports configuration and control of u-blox devices over I2C (called DDC by u-blox), Serial and - as of v2.0.8 (thank you @aberridg) - SPI too! The UBX protocol is a much easier and lighterweight interface to a GNSS module. Stop polling messages and parsing NMEA data! Simply ask for the datums you need and receive an automatic callback when they arrive.

This library can be installed via the Arduino Library manager. Search for SparkFun u-blox GNSS.

Automatic support for correction services like PointPerfect (u-blox), RTK2go, Emlid Caster and Skylark (Swift Navigation)

u-blox's PointPerfect GNSS augmentation service uses the secure MQTT protocol to download SPARTN format correction data, providing "3-6 cm accuracy and convergence within seconds". Please see the new PointPerfect Client example for more details.

v2.2.1 also supports L-band correction services using the new u-blox NEO-D9S correction data receiver. Please see the new L-band Corrections example for more details.

Other RTK NTRIP corrections services often require you to send them your location in NMEA GPGGA format. v2.2 of the library makes this easy by providing get functions and automatic callbacks for both GPGGA and GNGGA messages. You can now instruct your module to output GPGGA (e.g.) every 10 seconds and then push it to the correction server directly from the callback. No more polling, no more parsing!

v2.2 also includes two new functions useful for correction services:

  • setMainTalkerID : lets you change the NMEA Talker ID (prefix) from "GN" to "GP" - just in case your correction service really does need GPGGA, not GNGGA
  • setHighPrecisionMode : adds extra decimal places in the GGA messages, increasing the resolution of latitude, longitude and altitude

Please see the new Automatic_NMEA examples for more details.

We've also added a new NTRIP Caster Client example showing how to use these new features to full effect.

AssistNowTM

v2.1 of the library adds support for u-blox AssistNowTM Assisted GNSS (A-GNSS) which can dramatically reduce the time-to-first-fix. You can find further details in the AssistNow Examples folder.

v2 vs. v1

This library is the new and improved version of the very popular SparkFun u-blox GNSS Arduino Library. v2.0 contains some big changes and improvements:

  • Seamless support for "automatic" message delivery:
    • In v1.8, you could ask for the NAV PVT (Navigation Position Velocity Time) message to be delivered automatically, without polling. v2.0 adds automatic support for 29 messages, covering the full range of: standard and High Precision position, velocity, attitude and time information; relative positioning; event capture with nanosecond time resolution; raw GNSS signal data including carrier phase; Sensor Fusion; and High Navigation Rate data.
    • Don't see the message you really need? Adding_New_Messages provides details on how to add "auto" support for your favourite message.
  • Dynamic memory allocation with clearly-defined data storage structs for each message:
    • There are no static 'global' variables to eat up your RAM. v2.0 automatically allocates memory for the automatic messages when they are enabled. You may find your total RAM use is lower with v2.0 than with v1.8.
    • Each "auto" message has a clearly-defined data storage struct which follows the u-blox protocol specification precisely.
  • Callbacks:
    • No more polling! Simply request the "auto" messages you need and receive an automatic callback when each message arrives.
    • Please see the callback examples for more details.
  • Built-in support for data logging:
    • Want to log RXM SFRBX and RAWX data for Post-Processed Kinematics or Precise Point Positioning? You can absolutely do that! v2.0 provides built-in support for data logging, allowing you to log any of the "auto" messages simply and easily.
    • Incoming "auto" data can be stored in a configurable ring buffer. You can then extract the data from the buffer and write it to (e.g.) SD card using your favorite SD library.
    • Data is logged in u-blox UBX format which is compact and efficient. You can replay the data using u-center.
    • Please see the data logging examples for more details.

Migrating to v2.0

Migrating to v2.0 is easy. There are two small changes all users will need to make:

  • The name of the library class has changed from SFE_UBLOX_GPS to SFE_UBLOX_GNSS to reflect that the library supports all of the Global Navigation Satellite Systems:
    • As a minimum, you need to change: SFE_UBLOX_GPS myGPS;
    • to: SFE_UBLOX_GNSS myGPS;
    • But we would encourage you to use SFE_UBLOX_GNSS myGNSS;. You will see that all of the library examples now use myGNSS instead of myGPS.
  • The name of the library header and C++ files have changed too:
    • Change: #include <SparkFun_Ublox_Arduino_Library.h>
    • to: #include <SparkFun_u-blox_GNSS_Arduino_Library.h>

If you are using the Dead Reckoning Sensor Fusion or High Dynamic Rate messages, you will need to make more small changes to your code. Please see the dead reckoning examples for more details. There is more detail available in Theory.md if you need it.

There is a new example showing how to read the UBX-NAV-PVAT (Position, Velocity, Attitude, Time) with a single function call. UBX-NAV-PVAT has full "auto" callback and data-logging support too!

Memory Usage

The u-blox GNSS library has grown considerably over the years and now exceeds the available program memory on platforms like the ATmega328 (Arduino Uno). If you want to reduce the amount of memory used by the library, you can edit the header file (SparkFun_u-blox_GNSS_Arduino_Library.h) and uncomment lines 60 and 63:

#define SFE_UBLOX_REDUCED_PROG_MEM // Uncommenting this line will delete the minor debug messages to save memory
#define SFE_UBLOX_DISABLE_AUTO_NMEA // Uncommenting this line will disable auto-NMEA support to save memory

Please note: the debug messages are automatically deleted and auto-NMEA support is automatically disabled on ARDUINO_AVR_UNO platforms. For other platforms, you will need to uncomment those lines manually.

On Windows, you will normally find SparkFun_u-blox_GNSS_Arduino_Library.h in:

  • Documents\Arduino\libraries\SparkFun_u-blox_GNSS_Arduino_Library\src

SPI Support

In v2.0.8 we added support for SPI, based on a contribution by @aberridg. Thank you Andrew!

We have tested the SPI interface on as many platforms and modules as we could pull together. It works perfectly on most but not quite all combinations. For reasons we don't understand yet, the ZED-F9P and Teensy 3.2 don't seem to get along. But Teensy 3.2 and the ZOE-M8Q do play nicely together. If you notice a combination that does not seem to work, please raise an issue and we will investigate.

The SPI examples have their own folder.

Please check the module datasheets for details on what clock speeds and data rates each module supports. The maximum clock speed is typically 5.5MHz and the maximum transfer rate is typically 125kBytes/s.

I2C Support

For I2C communication, please be sure to remove all additional pull-ups on the I2C bus. u-blox modules include internal pull-ups on the I2C lines (sometimes called DDC in their manuals). Cut all I2C pull-up jumpers and/or remove them from peripheral boards. Otherwise, various data glitches can occur. See issues 38 and 40 for more information. We recommend running the I2C bus at 100kHz.

Compatibility

v2 of the library provides support for generation 8, 9 and 10 u-blox GNSS modules. For generation 6 and 7, please see this example (depricated).

Contributing

If you would like to contribute to this library: please do, we truly appreciate it, but please follow these guidelines. Thanks!

Repository Contents

  • /examples - Example sketches for the library (.ino). Run these from the Arduino IDE.
  • /src - Source files for the library (.cpp, .h).
  • keywords.txt - Keywords from this library that will be highlighted in the Arduino IDE.
  • library.properties - General library properties for the Arduino package manager.
  • CONTRIBUTING.md - Guidelines on how to contribute to this library.
  • Theory.md - provides detail on how data is processed by the library.
  • /Utils - contains a Python utility which can check the contents of UBX log files.

Documentation

Theory

If you would like to learn more about how this library works, including the big changes we made in version 2.0, please see Theory.md for full details.

Products That Use This Library

  • GPS-16481 - SparkFun GPS-RTK-SMA Breakout - ZED-F9P (Qwiic)
  • GPS-15136 - SparkFun GPS-RTK2 Board - ZED-F9P (Qwiic)
  • GPS-16344 - SparkFun GPS-RTK Dead Reckoning Breakout - ZED-F9R (Qwiic)
  • GPS-15005 - SparkFun GPS-RTK Board - NEO-M8P-2 (Qwiic)
  • GPS-15210 - SparkFun GPS Breakout - Chip Antenna, SAM-M8Q (Qwiic)
  • GPS-15193 - SparkFun GPS Breakout - Chip Antenna, ZOE-M8Q (Qwiic)
  • GPS-17285 - SparkFun GPS Breakout - NEO-M9N, SMA (Qwiic)
  • GPS-15733 - SparkFun GPS Breakout - NEO-M9N, Chip Antenna (Qwiic)
  • GPS-15712 - SparkFun GPS Breakout - NEO-M9N, U.FL (Qwiic)
  • GPS-16329 - SparkFun GPS Dead Reckoning Breakout - NEO-M8U (Qwiic)
  • SPX-14980 - SparkX GPS-RTK Black
  • SPX-15106 - SparkX SAM-M8Q

License Information

This product is open source!

Various bits of the code have different licenses applied. Anything SparkFun wrote is beerware; if you see me (or any other SparkFun employee) at the local, and you've found our code helpful, please buy us a round!

Please use, reuse, and modify these files as you see fit. Please maintain attribution to SparkFun Electronics and release anything derivative under the same license.

Distributed as-is; no warranty is given.

  • Your friends at SparkFun.

More Repositories

1

SparkFun-Eagle-Libraries

SparkFun's Public Eagle PCB Footprints
1,694
star
2

phant

the data logging engine behind data.sparkfun.com
JavaScript
702
star
3

OpenLog

Open Source Hardware Datalogger
C++
509
star
4

SparkFun-KiCad-Libraries

SparkFun's KiCad Libraries
Python
425
star
5

Pro_Micro

ATMega32U4 Arduino board, available from SparkFun Electronics
C++
253
star
6

Arduino_Boards

Board definitions for SparkFun-manufactured AVR, ARM, and ESP-based Arduino boards.
C
246
star
7

Fritzing_Parts

This repo houses all of the SFE Fritzing parts for use in diagrams in tutorials. If you create a new part in Fritzing that correlates to an SFE part, please add it here so others may use it and to avoid duplication.
240
star
8

SparkFun_MPU-9250-DMP_Arduino_Library

Arduino library for the MPU-9250 enabling its digital motion process (DMP) features.
C
215
star
9

SparkFun_Eagle_Settings

The Eagle settings SparkFun uses for board designs
211
star
10

3D_Models

3D Models of our products
HTML
204
star
11

MaKeyMaKey

The main branch for MaKey MaKey firmware on SparkFun's version of the board.
C++
191
star
12

Old-SparkFun-Eagle-Library

SparkFun's Public Eagle PCB Footprints for pre-Eagle 6.0
181
star
13

AD8232_Heart_Rate_Monitor

AD8232 Heart Rate Monitor
Processing
163
star
14

WiFly-Shield

WiFly Shield -- A shield for the Roving Networks RN-52 WiFly Module.
C++
147
star
15

SparkFun_CAN-Bus_Arduino_Library

C
145
star
16

HX711-Load-Cell-Amplifier

A breakout board for the HX711 load cell weight measuring amplifier
C++
143
star
17

SparkFun_Ublox_Arduino_Library

Library to control UBX binary protocol and NMEA over I2C on Ublox GPS modules
C++
141
star
18

MPU-9150_Breakout

Example code and PCB design files for the MPU-9105, 9DOF.
Eagle
130
star
19

Graphical_Datasheets

Code, final versions, and information on the Sparkfun Graphical Datasheets
Python
122
star
20

Pokedex

3D Printed PokΓ©dex smartphone case
118
star
21

SparkFun_BME280_Arduino_Library

An Arduino library to control the BME280 humidity and pressure sensor.
C++
116
star
22

SparkFun_ICM-20948_ArduinoLibrary

Arduino support for ICM_20948 w/ portable C backbone
C
113
star
23

9DOF_Razor_IMU

9DOF Razor IMU available from SparkFun Electronics
C
111
star
24

Fingerprint_Scanner-TTL

Repository with example code for SEN-14585 & SEN-14585 at SparkFun.com
C++
106
star
25

SparkFun_MLX90640_Arduino_Example

Controlling and reading from the MLX90640 IR array thermal imaging sensor
C++
103
star
26

APDS-9960_RGB_and_Gesture_Sensor

Breakout board for the Avago APDS-9960 proximity, light, RGB, and gesture sensor, made by SparkFun Electronics.
C++
103
star
27

Arduino_Pro_Mini_328

SparkFun's Arduino Pro Mini 328 is a bare bones super small Arduino compatible development board.
94
star
28

SIK-Guide-Code

Example code from the SparkFun Inventor's Kit Guide.
C++
91
star
29

Serial7SegmentDisplay

Example code and board files for the Serial 7 Segment Display.
C++
89
star
30

OpenLog_Artemis

The OpenLog Artemis is an open source datalogger the comes preprogrammed to automatically log IMU, GPS, serial data, and various pressure, humidity, and distance sensors. All without writing a single line of code!
C++
86
star
31

Arduino_Apollo3

Arduino core to support the Apollo3 microcontroller from Ambiq Micro
C
79
star
32

Github_Tutorial

A very basic and flawed piece of code to show how Github GUI works.
C++
79
star
33

CAN-Bus_Shield

C++
76
star
34

SparkFun_BNO080_Arduino_Library

An Arduino Library for the BNO080 IMU combination triple axis accelerometer/gyro/magnetometer packaged with an ARM Cortex M0+ running powerful algorithms.
C++
76
star
35

SevSeg

Seven Segment library for Arduino
C++
76
star
36

SparkFun_ESP8266_AT_Arduino_Library

WiFi and TCP drivers for an ESP8266 running AT firmware.
C++
75
star
37

SparkFun_APDS-9960_Sensor_Arduino_Library

SparkFun APDS-9960 RGB/Gesture Sensor Arduino Library
C++
75
star
38

SparkFun_Micro_OLED_Arduino_Library

Arduino library for the SparkFun Micro OLED - a breakout board for a monochrome, 0.66", 64x48 OLED display.
C
75
star
39

SparkFun_VL53L1X_Arduino_Library

A library for the laser based VL53L1X Time Of Flight distance sensor capable of detecting a target 4m away!
C++
73
star
40

nRF52832_Breakout

Breakout board for the Nordic nRF52832, a BLE/ANT/2.4GHz, Cortex-M4F SoC.
C
72
star
41

SparkFun_SCD30_Arduino_Library

An Arduino library for the SCD30 NDIR CO2 sensor.
C++
72
star
42

Logic_Level_Bidirectional

Logic level converter bi-directional with Mosfets
71
star
43

ESP32_Miscellany

A grab bag of ESP32-related documentation, example code, hardware diagrams, and more.
C
71
star
44

ESP32_Thing

Development platform for the Espressif ESP32 WiFi/Microcontroller SoC
69
star
45

Pocket_AVR_Programmer

Example firmware and board files for the Pocket AVR Programmer
Python
69
star
46

SF32u4_boards

Support files for SparkFun's 32u4-based Arduino-compatible development boards.
C
69
star
47

BMP180_Breakout

Breakout board for the Bosch BMP180 barometric pressure sensor
C++
68
star
48

OBD-II_UART

A board that provides a serial interface with a vehicle's OBD-II bus.
C++
68
star
49

Tiny-AVR-Programmer

Hardware files for the Tiny AVR Programmer
66
star
50

MPU-9250_Breakout

C
66
star
51

Weather_Shield

Barometric pressure, temperature, humidity and light sensing weather shield for Arduino.
C++
65
star
52

Bus_Pirate

Troubleshooting tool for embedded devices available from SparkFun Electronics
Eagle
63
star
53

GraphicLCD_Nokia_5110

Example Code for Nokia 5110 Graphic LCD
C
62
star
54

SparkFun_LSM9DS1_Arduino_Library

Arduino library for the LSM9DS1 9DOF IMU.
C++
62
star
55

MicroView

The MicroView is a chip-sized Arduino with a built-in OLED, available from SparkFun Electronics
Eagle
58
star
56

OpenScale

An open source board for load cell reading and configuration based on the HX711 and ATmega328.
C++
55
star
57

MMA8452_Accelerometer

Triple axis accelerometer MMA8452, I2C based with tap and orientation settings.
55
star
58

RF_Links

These wireless transmitters and receivers easily fit into a breadboard and work well with microcontrollers to create a very simple wireless data link.
C++
54
star
59

SparkFun_u-blox_GNSS_v3

An Arduino library which allows you to communicate seamlessly with u-blox GNSS modules using the Configuration Interface
C++
52
star
60

Qwiic_Ublox_Gps_Py

Python
52
star
61

phant-arduino

phant logging utility library for arduino
C++
51
star
62

SparkFun_TB6612FNG_Arduino_Library

C++
51
star
63

SparkFun_RTK_Firmware

Centimeter precision GPS/GNSS using L1/L2 signals broadcast over Bluetooth SPP (using the ESP32) in an easy to use enclosure.
C
50
star
64

Rogue_Router

Solar Access Point Fileserver for Sparkfun Thing
Arduino
49
star
65

HC-SR04_UltrasonicSensor

Arduino example code for the HC-SR04 ultrasonic ranging sensor.
C++
49
star
66

MIDI_Shield

Midi shield product 9595, available from SparkFun Electronics
C++
48
star
67

SparkFun_LSM6DS3_Arduino_Library

Arduino library for the LSM6DS3
C++
48
star
68

hacker-application

Join the web developers at SparkFun Electronics
47
star
69

SparkFun_Simultaneous_RFID_Tag_Reader_Library

Arduino library to control the M6E-Nano RFID module from ThingMagic
C++
46
star
70

SparkFun_SX1509_Arduino_Library

Arduino library for the SX1509 16-I/O GPIO expander.
C++
43
star
71

Qwiic_Py

Python package for the qwiic system.
Python
43
star
72

Qwiic_GPS-RTK2

A breakout board for the ZED-F9P GNSS RTK capable module from u-blox.
42
star
73

ESP8266_Thing

A breakout and development board for the ESP8266 WiFi SoC.
42
star
74

SAMD21_Mini_Breakout

A miniature SAM21G Breakout, in the form factor/pin-out of a Pro Mini.
C
41
star
75

Cherry_MX_Switch_Breakout

Breakout board for Cherry's MX-series keyswitches
40
star
76

SparkFun_BQ27441_Arduino_Library

Arduino library for the BQ27441 LiPo Fuel Gauge.
C++
40
star
77

pcDuino

Example code for use on the pcDuino
39
star
78

SparkFun_ADXL345_Arduino_Library

Arduino Library for the ADXL345
C++
39
star
79

ColorLCDShield

This is an Arduino library for SparkFun's Color LCD Shield
C++
39
star
80

SparkFun_CCS811_Arduino_Library

A library to drive the AMS CCS811 air quality sensor
C++
38
star
81

Si4703_FM_Tuner_Evaluation_Board

Example code and board files for the Si4703 FM Tuner Evaluation Board
C++
37
star
82

HTU21D_Breakout

Breakout board for the HTU21D digital humidity sensor.
C++
36
star
83

Wimp_Weather_Station

Code for the tutorial available from SparkFun Electronics
Squirrel
36
star
84

BMP180_Breakout_Arduino_Library

Arduino libraries for the BMP180 pressure sensor breakout board
C++
35
star
85

RedBoard

The RedBoard is SparkFun's take on the Arduino Uno. It combines the simplicity of the Uno's Optiboot bootloader (which is used in the Pro series), with the stability of the FTDI and a mini-B USB connector.
35
star
86

SparkFun_External_EEPROM_Arduino_Library

An Arduino library for the easy control of external I2C EEPROMs.
C++
34
star
87

SparkFun_MLX90614_Arduino_Library

Arduino library for the MLX90614 Infrared Thermometer.
C++
34
star
88

SparkFun_Edge

SparkFun's Edge Development Board is based around the newest edge technology and is perfect for getting your feet wet with voice and even gesture recognition without relying on 3rd party cloud services.
C++
34
star
89

SparkFun_RadioHead_Arduino_Library

SparkFun Fork of Mike McCauley's RadioHead library (http://www.airspayce.com/mikem/arduino/RadioHead/)
C++
33
star
90

MPU-6050_Breakout

MPU-6050 TriAxis Accelerometer and Gyroscope, available from SparkFun Electronics
Eagle
32
star
91

Simon-Says

Example firmware and hardware files for the Simon Says kit.
Arduino
32
star
92

MAX30105_Particle_Sensor_Breakout

Breakout to sense smoke, SpO2, Pulse Detection, as well as airborne particles.
C++
32
star
93

AmbiqSuiteSDK

A copy of the AmbiqSuite SDK available on GitHub. Can be used to include AmbiqSuite as a submodule. May be used to track issues in SDK releases, however this repo is not maintained by AmbiqMicro
C
32
star
94

SFE_CC3000_Library

Arduino library for the TI CC3000 WiFi module
C++
31
star
95

SparkFun_HTU21D_Breakout_Arduino_Library

HTU21D Breakout Arduino Library
C++
31
star
96

Sound_Detector

Microphone with binary output indicating ambient sound, available from SparkFun Electronics.
Eagle
31
star
97

Thermal_Printer

Demo Code for the Thermal Printer available from SparkFun Electronics
C
31
star
98

CCS811_Air_Quality_Breakout

CCS811 Air quality sensor capable of detecting CO2 and TVOCs
Python
31
star
99

SunnyBuddy

MPPT single-cell LiPo battery charger based on the LT3562
31
star
100

OpenLCD

An open source serial LCD (HD44780) controller based on the ATmega328.
C++
30
star