Fun and Games with Adafruit GPS

by Web FishJan 24, 2013 @ 06:35pm

With most of the navionics building blocks arriving in the mail over the last 15 days and with our test mule build taking longer than originally projected, it's time to start tackling the core navigation functionality.

The final navionics bay design, layout and external connectors are still very much work in progress. For now we'll stick with experimental wiring in order to get all modules talking to each other and iron out all the conflicts. By the time we are done, the deck layout should hopefully be finalized.

Starting with the Adafruit GPS module on UART 2:

Initial plan was to use a one-way communication with the GPS module (read-only) to save one GPIO port for other use (GPIO 4 is normally dedicated to UART 2 / TX). After playing with it for a while, it became evident that the default update frequency of the GPS board (NMEA_UPDATERATE) is ~10Hz, flooding the serial port with data that is (kind of) useless for us (the distance we'll travel at maximum speed in 100ms is significantly less than the GPS margin of error :). So we'll need a two-way communication after all (for the PMTK_SET_NMEA_UPDATERATE command and a few other configs upon GPS initialization).

Another thing to point out about the MTK3339 chipset in the Adafruit GPS module is that it takes FOREVER to update the internal almanac data after cold restart. If you try to do this inside a building, it can spend a whole night without building a usable almanac table and getting a stable satellite lock. Fortunately, Adafruit provides an optional battery back-up (requires a simple battery holder installation and a 3V lithium battery). Once the battery is installed, the satellite lock time is DRASTICALLY reduced (by orders of magnitude) and the receiver is operational on the ground floor of a two-story building.

With all this behind us, the first module is on-line and operational:

Time for the first real-life test. I'll go into more details about the code in the Software section of the blog, but here is a summary of the test setup:

  • The GPS class provides real-time (1 second interval) updates of current longitude/latitude/altitude, satellite fix mode (None/GPS/Differential GPS), number of available satellites in the constellation and the current time offset in GMT (hh:mm:ss);
  • The main routine polls the GPS class every 3 seconds;
  • If there is a satellite lock, the data logger dumps the current location data in human-readable format in a text file on the on-board SD card;

So I dropped the board on the passenger seat of the car and headed to the harbor. Dana Point harbor is not the most signal-friendly place (tall cliffs, rich vegetation, etc). To add to the test, the GPS sensor antenna was pointed down (towards the car seat). A four minute drive from the top of the cliff to the tip of the island yielded this. Not too bad... 

A quick parse and paste into gives us a near-perfect data point distribution. Try guessing where the stop signs are on the test course:

View GPS Test - 1/24/2012 in a full screen map


By the looks of it, we might be able to get away without an external active GPS antenna. 

Next on the list: compass module.

The GPS Receiver

by Web FishJan 4, 2013 @ 10:47am

Provides current position (and optionally direction/speed). 

  • Current selection: Adafruit Ultimate GPS Breakout board
  • Status: Finalized

  • Criteria: Reliable satellite signal acquisition when installed inboard, standard I/O, small physical footprint, cost 
  • Finalists: Adafruit Ultimate GPS v.3, Sparkfun GPS LS20031
  • Main decision factors: External antenna connector (makes board mounting position and packaging less relevant), standard I/O on two GPIO pins, sensitivity

 (click image for larger view) 

Spec highlights:

  • -165 dBm sensitivity, 10 Hz updates, 66 channels
  • 5V friendly design and only 20mA current draw
  • PPS output on fix
  • Internal patch antenna + u.FL connector for external active antenna



  • Will not know for certain if external antenna is needed until the navionics bay design and mounting is finalized
  • As an added bonus module provides current time-stamp for syncing Netduino internal clock after reboot (no battery back-up for the clock on the Netduino board - anyone remembering early Apple II days?)


PilotFish Navionics - Block Diagram

by Web FishJan 1, 2013 @ 10:55am

In a series of articles over the next few weeks we'll cover the various components of the on-board electronics driving the PilotFish vessel. Many components are still in flux, so expect changes as the project develops. As sub-modules and connection paths / interface points get solidified, those will be marked as finalized in future revisions of the diagram.

Here is a quick summary of the navionics sub-systems (click image for full size):



  • Central Processor: The main control unit. Runs the custom software which makes things move (and find their way)
  • Comm uplink: Telemetry uplink (current position, system status and sensor data reporting)
  • GPS receiver: Current position tracking
  • Compass: Current bearing and acceleration;
  • Aux navigation sensors: additional sensors needed for proper orientation and navigation
  • Additional sensors: environmental and other sensors not directly related to navigation;
  • Image acquisition: live video / snapshots of surroundings
  • Motor controller: accepting control input from CPU and converting it to high-power electric current control
  • Propulsion motors: electric drive motors and propellers
  • Rudder control: directional control
  • Propulsion solar panels: high-power solar harvesting, dedicated to powering main drive motors
  • Propulsion battery bank: high-capacity energy storage dedicated to powering main drive motors in the absence of sufficient solar power
  • Aux solar panels: additional solar harvesting capacity dedicated to powering navionics 
  • Navionics battery bank: navionics battery back-up