If you are looking to get start learning about or coding for a GPS/GNSS module with your Arduino, the u-blox CAM-M8C module is a great way to get started with its integrated antenna and proven design. Petrichor Labs makes an affordable and easy-to-use breakout board for the CAM-M8C module, which can be purchased from Digi-Key here, or directly from Petrichor Labs here. The datasheet for the breakout board can be found here. In this tutorial, we'll show you how to get started quickly with that breakout board over I2C using an Arduino Uno.
For a version that excludes the Arduino and simply uses a command prompt, check at our other tutorial: TBC. A PDF version of both this tutorial and that one can be here.
The ProcedureStep 1 : Obtain an Arduino Uno and female to male jumper wires.
Step 2 : Connect the breakout board to the Arduino with the following pin mapping and as shown in the photos below. Reference this page for help finding the SCL and SDA pins on the Arduino.
Step 3 : Connect the Arduino Uno to your computer.
Step 4 : Open the Arduino IDE. Version 2.0.0-beta.4 is depicted below.
Step 5 : Select your Arduino from the menu at the top. If you haven’t previously, install the board support files for the Arduino.
Step 6 : Select the Library Manager tab. Search for "SparkFun u-blox GNSS" and find "SparkFun u-blox GNSS Arduino Library", not the deprecated "SparkFun u-blox Arduino Library, ” in the list. Select the latest version and click “Install."
Step 7 : Search for "MicroNMEA" and find "MicroNMEA by Steve Marple” in the list. Select the latest version and click “Install."
Step 8 : Make sure you have the correct board, port, and programmer settings.
Step 9 : Open the u-blox NMEAParsing example by going to Examples > SparkFun u-blox GNSS Arduino Library > Example2_NMEAParsing.
Step 10 : Verify and upload the code to the Arduino. Open the Serial Monitor (on macOS: Tools > Serial Monitor). Set the baud rate for the Serial Monitor to 115200.
Step 11 : You should begin to see parsed data from the module.
After several minutes, if you do not have a fix so that the data looks like the last screenshot above, consider moving the breakout board near a window or outdoors.
Step 12 : Experiment with the other u-blox example files from the SparkFun library. Example1 will give you the raw NMEA sentences:
Those example files are a great start point for your own code to work with any GPS/GNSS module.
If you want to convert all of that NMEA data to CSV files, or import to a database (and maybe even plot it in Grafana), check out our code (and Grafana dashboards) that aims to help you do that: github.com/Petrichor-Labs/nmea_data_convert.
Comments
Please log in or sign up to comment.