Adafruit Ultimate GPS Created by lady ada Last updated on 2019-08-07 08:21:01 PM UTC
Overview We carry a few different GPS modules here in the Adafruit shop, but none that satisfied our every desire - that's why we designed this little GPS breakout board. We believe this is the Ultimate GPS module, so we named it that. It's got everything you want and more: -165 dBm sensitivity, 10 Hz updates, 66 channels 5V friendly design and only 20mA current draw Breadboard friendly + two mounting holes RTC battery-compatible Built-in datalogging PPS output on fix Internal patch antenna + u.
Ultimate GPS Breakout Board The Breadboard Breakout board comes with: a ultra-low dropout 3.3V regulator so you can power it with 3.3-5VDC in, 5V level safe inputs, ENABLE pin so you can turn off the module using any microcontroller pin or switch, a footprint for optional CR1220 coin cell to keep the RTC running and allow warm starts and a tiny bright red LED. The LED blinks at about 1Hz while it's searching for satellites and blinks once every 15 seconds when a fix is found to conserve power.
Ultimate GPS USB Board The USB Breakout board comes with: 4-pin USB breakout for direct-soldering or connection to a USB host, two yellow receive/transmit LEDs let you know when data is being transmitted to or from the GPS module serial interface, a footprint for optional CR1220 coin cell to keep the RTC running and allow warm starts and a tiny bright red LED. The LED blinks at about 1Hz while it's searching for satellites and blinks once every 15 seconds when a fix is found to conserve power.
Specifications: Module specs: Satellites: 22 tracking, 66 searching Patch Antenna Size: 15mm x 15mm x 4mm Update rate: 1 to 10 Hz Position Accuracy: 1.8 meters Velocity Accuracy: 0.1 meters/s Warm/cold start: 34 seconds Acquisition sensitivity: -145 dBm Tracking sensitivity: -165 dBm Maximum Velocity: 515m/s Vin range: 3.0-5.
Pinouts The plain GPS breakout is meant to be used with a microcontroller that has a 3/5V UART and has all the GPIO pins exposed on the bottom 0.1" header The USB version doesn't have those breakouts. Instead it has a single USB serial port. There's 4 pads to the right side that are the USB pinouts for when you want to solder it directly to a USB host converoller. Breakout Power Pins These are the pins that are involved with powering the GPS.
GND - power and signal ground. Connect to your power supply and microcontroller ground. Then, on the left are some optional power pins: VBAT is an input pin - it is connected to the GPS real time clock battery backup. We suggest using the battery spot on the back but if you have a project with a coin cell or other kind of battery that you want to use (and its under 3.3V) you can connect it to the VBAT pin.
FIX is an output pin - it is the same pin as the one that drives the red LED. When there is no fix, the FIX pin is going to pulse up and down once every second. When there is a fix, the pin is low (0V) for most of the time, once every 15 seconds it will pulse high for 200 milliseconds PPS is a new pin output on V3 modules. Its a "pulse per second" output. Most of the time it is at logic low (ground) and then it pulses high (3.
Battery Backup The GPS has a built in real time clock, which can keep track of time even when it power is lost and it doesn't have a fix yet. It can also help reduce fix times, if you expect to have a flakey power connection (say you're using solar or similar). To use the RTC, we need to attach a battery. There is a spot on the back for a CR1220 sized battery holder. We provide the holder but the battery is not included.
Remember, the GPS does not know what time zone you are in (even though it knows your location, there is no easy way to determine time zone without a massive lookup table) so all date/time data is in UTC (aka. Greenwich Mean Time) - You will have to write the code that converts that to your local time zone and account for Daylight Savings if required! Since that's pretty complicated, most people just stick to keeping everything in UTC © Adafruit Industries https://learn.adafruit.
External Antenna New in version 3 of the Ultimate GPS breakout, we now have support for optional external antennas! This is not available in v1 or v2 so if you do not see the uFL connector, you have an older version of the module which cannot support antennas All Ultimate GPS modules have a built in patch antenna - this antenna provides -165 dBm sensitivity and is perfect for many projects.
is 3 that means it is using the external antenna. If x is 2 it's using the internal antenna and if x is 1 there was an antenna short or problem. On newer shields & modules, you'll need to tell the firmware you want to have this report output, you can do that by adding a gps.sendCommand(PGCMD_ANTENNA) around the same time you set the update rate/sentence output. © Adafruit Industries https://learn.adafruit.
Direct Computer Wiring GPS modules are great in that the moment you turn them on, they'll start spitting out data, and trying to get a 'fix' (location verification). Like pretty much every GPS in existence, the Adafruit Ultimate GPS uses TTL serial output to send data so the best way to first test the GPS is to wire it directly to the computer via the TTL serial to USB converter on an Arduino. You can also use an FTDI Friend or other TTL adapter but for this demonstration we'll use a classic Arduino.
Now plug in the USB cable, and open up the serial monitor from the Arduino IDE and be sure to select 9600 baud in the drop down. You should see text like the following: This is the raw GPS "NMEA sentence" output from the module. There are a few different kinds of NMEA sentences, the most common ones people use are the $GPRMC (Global Positioning RecommendedMinimum Coordinates or something like that) and the $GPGGA sentences.
Look for the line that says $GPRMC,194509.000,A,4042.6142,N,07400.4168,W,2.03,221.11,160412,,,A*77 This line is called the RMC (Recommended Minimum) sentence and has pretty much all of the most useful data. Each chunk of data is separated by a comma. The first part 194509.000 is the current time GMT (Greenwich Mean Time). The first two numbers 19 indicate the hour (1900h, otherwise known as 7pm) the next two are the minute, the next two are the seconds and finally the milliseconds.
Breakout Arduino Wiring Once you've gotten the GPS module tested with direct wiring, we can go forward and wire it up to a microcontroller. We'll be using an Arduino but you can adapt our code to any other microcontroller that can receive TTL serial at 9600 baud. Connect VIN to +5V, GND to Ground, RX to digital 2 and TX to digital 3. Next up, download the Adafruit GPS library.
Open up the Arduino IDE Serial Console and make sure to set the Serial baud rate to 115200 You can configure the GPS output you see by commenting/uncommenting lines in the setup() procedure. For example, we can ask the GPS to send different sentences, and change how often it sends data. 10 Hz (10 times a second) is the max speed, and is a lot of data. You may not be able to output "all data" at that speed because the 9600 baud rate is not fast enough.
Breakout Arduino Parsing Since all GPS's output NMEA sentences and often for our projects we need to extract the actual data from them, we've simplified the task tremendously when using the Adafruit GPS library. By having the library read, store and parse the data in a background interrupt it becomes trivial to query the library and get the latest updated information without any icky parsing work. Open up the File→Examples→Adafruit_GPS→parsing sketch and upload it to the Arduino.
CircuitPython & Python You can easily use a GPS module with Python or CircuitPython code in addition to Arduino. Python code is well suited for parsing and processing the text output from GPS modules and this Adafruit CircuitPython GPS (https://adafru.it/BuR) module handles most of the work for you! CircuitPython MicroController Wiring First make sure to wire up the GPS module to your CircuitPython board so that the hardware UART pins are used. Here's an example with the Metro M0 Express: Board 5V or 3.
You can also skip the USB console cable, and just plug a Micro B cable directly from your computer to the Ultimate GPS USB Here's an example using the Pi's built-in UART: GPS Vin to 3.3V (red wire) GPS Ground to Ground (black wire) GPS RX to TX (green wire) GPS TX to RX (white wire) If you want to use the built-in UART, you'll need to disable the serial console and enable the serial port hardware in raspi-config. See the UART/Serial section of the CircuitPython on Raspberry Pi guide (https://adafru.
You can also download the adafruit_gps.mpy file from the Adafruit CircuitPython GPS releases page (https://adafru.it/BuS). Before continuing make sure your board's lib folder or root filesystem has the adafruit_gps.mpy, files and folders copied over. Python Installation of GPS Library You'll need to install the Adafruit_Blinka library that provides the CircuitPython support in Python. This may require verifying you are running Python 3.
# Define RX and TX pins for the board's serial port connected to the GPS. # These are the defaults you should use for the GPS FeatherWing. # For other boards set RX = GPS module TX, and TX = GPS module RX pins. RX = board.RX TX = board.TX # Create a serial connection for the GPS connection using default speed and # a slightly higher timeout (GPS modules typically update once a second). uart = busio.
print('Fix timestamp: {}/{}/{} {:02}:{:02}:{:02}'.format( gps.timestamp_utc.tm_mon, # Grab parts of the time from the gps.timestamp_utc.tm_mday, # struct_time object that holds gps.timestamp_utc.tm_year, # the fix time. Note you might gps.timestamp_utc.tm_hour, # not get all data like year, day, gps.timestamp_utc.tm_min, # month! gps.timestamp_utc.tm_sec)) print('Latitude: {0:.6f} degrees'.format(gps.latitude)) print('Longitude: {0:.6f} degrees'.format(gps.longitude)) print('Fix quality: {}'.format(gps.
import board import busio import time Next the GPS module is imported: import adafruit_gps Now a serial UART (https://adafru.it/BuT) is created and connected to the serial port pins the GPS module will use, this is the low level transport layer to communicate with the GPS module: # Define RX and TX pins for the board's serial port connected to the GPS. # These are the defaults you should use for the GPS FeatherWing. # For other boards set RX = GPS module TX, and TX = GPS module RX pins. RX = board.
# # # # # Initialize the GPS module by changing what data it sends and at what rate. These are NMEA extensions for PMTK_314_SET_NMEA_OUTPUT and PMTK_220_SET_NMEA_UPDATERATE but you can send anything from here to adjust the GPS module behavior: https://cdn-shop.adafruit.com/datasheets/PMTK_A11.pdf # Turn on the basic GGA and RMC info (what you typically want) gps.send_command(b'PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0') # Turn on just minimum info (RMC only, location): #gps.
if not gps.has_fix: # Try again if we don't have a fix yet. print('Waiting for fix...') continue # We have a fix! (gps.has_fix is true) # Print out details about the fix like location, date, etc. print('=' * 40) # Print a separator line. print('Fix timestamp: {}/{}/{} {:02}:{:02}:{:02}'.format( gps.timestamp_utc.tm_mon, # Grab parts of the time from the gps.timestamp_utc.tm_mday, # struct_time object that holds gps.timestamp_utc.tm_year, # the fix time. Note you might gps.timestamp_utc.
CircuitPython Datalogging Datalogging Example Another handy task with GPS is logging all the raw output of the GPS module to a file. This is useful if you're importing the GPS data into a tool like Google Earth which can process raw NMEA sentences. You can perform this datalogging very easily with CircuitPython. To store data you'll need to choose one of two options: Wire up a SD card holder to your board's SPI bus, or use a board with SD card holder built-in like the Feather M0 Adalogger (https://adafru.
code over the USB drive as normal. Remove the alligator clip, reset the board, and the boot.py will switch to mounting the internal filesystem as writable so you can log images to it again (but not write any code!). Remember when you enable USB drive writes (by connecting D5 to ground at startup) you cannot write files to the internal filesystem and any code in your main.py that attempts to do so (like the example below) will fail.
# Path to the file to log GPS data. By default this will be appended to # which means new lines are added at the end and all old data is kept. # Change this path to point at internal storage (like '/gps.txt') or SD # card mounted storage ('/sd/gps.txt') as desired. #LOG_FILE = '/gps.txt' # Example for writing to internal path /gps.txt LOG_FILE = '/sd/gps.txt' # Example for writing to SD card path /sd/gps.txt And further below: Should all be uncommented and look as above.
Awesome! That's all there is to basic datalogging of NMEA sentences with a GPS module and CircuitPython! © Adafruit Industries https://learn.adafruit.
Python Docs Python Docs (https://adafru.it/C4M) © Adafruit Industries https://learn.adafruit.
Built In Logging One of the nice things about the MTK3339 is the built in data-logger. This basic data-logging capability can store date, time, latitude, longitude and altitude data into a 64K flash chip inside. Its not a high resolution logger - it only logs once every 15 seconds when there is a fix - but for 99% of projects that want to track location, this can be a great low power way to log data - no SD card or other EEPROM required! It can store up to 16 hours of data.
This output gives you some more information. the first entry is the Log #. This is how many log traces are in the memory. Every time you start and save data, a new log is made. Full Stop means that once the logger has run out of memory it will stop. Next the output indicates that we are logging only during fix data and at set intervals, with an interval delay of 15 seconds. We are not logging based on distance or speed. The current status is LOGGING (active), there's also the number of records we've stored.
Copy and paste all the text after the —-'s (starting with $PMTKLOX,0,86*67 and ending with $PMTK001,622,3*36) then paste it into the box located on this page (https://adafru.it/cFg) OR you can try this python tool that don has kindly donated (https://adafru.it/emj) to the community! Using the GPS Tool If you are having difficulty with the Arduino/javascript tool, you can also try using the GPS tool. The tool runs only under Windows but it is very powerful.
LOCUS Parser LOCUS Parser (https://adafru.it/cFg) © Adafruit Industries https://learn.adafruit.
Resources Datasheets MTK3329/MTK3339 command set sheet (https://adafru.it/e7A) for changing the fix data rate, baud rate, sentence outputs, etc! PMTK 'complete' data (https://adafru.it/uoe)sheet (like the above but with even more commands) Datasheet for the PA6B (MTK3329) GPS module itself (https://adafru.it/aMo) Datasheet for the PA6C (MTK3339) GPS module itself (https://adafru.it/aMp) Datasheet for the PA6H (MTK3339) GPS module itself (https://adafru.
F.A.Q. Can the Ultimate GPS be used for High Altitude? How can I know? Modules shipped in 2013+ (and many in the later half of 2012) have firmware that has been tested by simulation at the GPS factory at 40km. You can tell what firmware you have by sending the firmware query command $PMTK605*31 (you can use the echo demo to send custom sentences to your GPS) If your module replies with AXN_2.10_3339_2012072601 5223 that means you have version #5223 which is the 40Km-supported firmware version.
Is the Ultimate GPS affected by the 2019 Week Rollover issue? The ultimate GPS (all firmware versions from 20110922_GTOP_EVK01_A2.10 and higher - any sold after 2011) have been tested to work fine through 2019. They do not pass the 2038 rollover test, so you may need to update the firmware between now and 2038. This does not affect the 2019 rollover (there's one every ~20 years) © Adafruit Industries https://learn.adafruit.
OK I want the latest firmware! Here is the binary of the 5632 firmware, you can use this tool to upload it using an FTDI or USB-TTL cable (or direct wiring with FTDI). We do not have a tutorial for updating the firmware, if you update the firmware and somehow brick the GPS, we do not offer replacements! Keep this in mind before performing the update process! © Adafruit Industries https://learn.adafruit.
I've adapted the example code and my GPS NMEA sentences are all garbled and incomplete! We use SoftwareSerial to read from the GPS, which is 'bitbang' UART support. It isn't super great on the Arduino and does work but adding too many delay()s and not calling the GPS data parser enough will cause it to choke on data. If you are using Leonardo (or Micro/Flora/ATmega32u4) or Mega, consider using a HardwareSerial port instead of SoftwareSerial! © Adafruit Industries https://learn.adafruit.
My GPS is giving me data but the location is wrong! People often get confused because the GPS is working but is "5 miles off" - this is because they are not parsing the lat/long data correctly. Despite appearances, the geolocation data is NOT in decimal degrees. It is in degrees and minutes in the following format: Latitude: DDMM.MMMM (The first two characters are the degrees.) Longitude: DDDMM.MMMM (The first three characters are the degrees.) © Adafruit Industries https://learn.adafruit.
How come I can't get the GPS to output at 10Hz? The default baud rate to the GPS is 9600 - this can only do RMC messages at 10Hz. If you want more data output, you can increase the GPS baud rate (to 57600 for example) or go with something like 2 or 5Hz. There is a trade off with more data you want the GPS to output, the GPS baud rate, Arduino buffer/processing capability and update rate! Experimentation may be necessary to get the optimal results. We suggest RMC only for 10Hz since we've tested it.
How come I can't set the RTC with the Adafruit RTC library? The real time clock in the GPS is NOT 'writable' or accessable otherwise from the Arduino. Its in the GPS only! Once the battery is installed, and the GPS gets its first data reception from satellites it will set the internal RTC. Then as long as the battery is installed, you can read the time from the GPS as normal. Even without a proper "gps fix" the time will be correct.
Do all GPS modules emit PPS pulses at the same time? Under ideal conditions, GPS modules emit a PPS signal within 10ns of the beginning of each GPS second. That's only a best-case value though. In practice, each GPS module's sync to the GPS clock system depends on the quality of the fix, how long the GPS module has had a fix, and the group of satellites the module uses for its fix.
How can I read the PPS signal on the Ultimate GPS USB? The PPS line is tied to the serial port RI (Ring Indicator) pin. You can read this with your serial-port interface code. for example here's a version in Python using pyserial: import serial ser = serial.Serial('/dev/ttyS34') # open serial port print(ser.name) # check which port was really used last_ri = ser.ri while True: if ser.ri != last_ri: last_ri = ser.ri if last_ri: print("\n---------- Pulse high ----------") else: print("\n---------- Pulse low --
© Adafruit Industries https://learn.adafruit.
Downloads Files MTK3329/MTK3339 command set sheet (https://adafru.it/qif) for changing the fix data rate, baud rate, sentence outputs, etc! LOCUS (built-in-datalogging system) user guide (https://adafru.it/uoC) Datasheet for the PA6B (MTK3329) GPS module itself - used in version 1 of this module (https://adafru.it/s0B) Datasheet for the PA6C (MTK3339) GPS module itself - used in version 2 of this module (https://adafru.
Ultimate GPS USB Schematic © Adafruit Industries https://learn.adafruit.
Ultimate GPS USB Fabrication Print © Adafruit Industries https://learn.adafruit.
© Adafruit Industries Last Updated: 2019-08-07 08:21:00 PM UTC Page 52 of 52