Set GPS update rate on Arduino Uno + Adafruit Ultimate GPS Logger Shield


Just in case someone wants to alter the GPS update rate on a Adafruit Ultimate GPS Logger Shield. This may come in handy if you want to reduce the power consumption of your board. According to a datasheet of the GPS-chip the max update rate is 10000ms/10sec. So how do you set it?

Relatively simple: go to your Adafruit_GPS-library, open Adafruit_GPS.h and look for these lines:

#define PMTK_SET_NMEA_UPDATE_1HZ "$PMTK220,1000*1F"
#define PMTK_SET_NMEA_UPDATE_5HZ "$PMTK220,200*2C"
#define PMTK_SET_NMEA_UPDATE_10HZ "$PMTK220,100*2F"

So this will define the name of the method/function/whatever which will be called in your Arduino-sketch, e.g. PMTK_SET_NMEA_UPDATE_1HZ. PMTK220 is the chip-internal code for update rate. So we say: Hey, I want to alter the update rate. The value after the comma is the update rate in milliseconds. We set it to 10000 (or whatever you like). The value behind the * is the checksum which the chip requires. Thanks to Stevens post about reading GPS data with bash I stumpled upon the MTK NMEA checksum calculator. So you put in PMTK220,10000 and get back _$PMTK220,10000*2F_. That’s it. Our new line would read:

#define PMTK_SET_NMEA_UPDATE_10SEC  "$PMTK220,10000*2F"

Just set PMTK_SET_NMEA_UPDATE_10SEC in your sketch and upload it.