In preparation for an ASV (autonomous surface vehicle) contest this summer, I needed to track the position of a near-shore buoy off of Port Townsend's waterfront. The reason is that the contest involves going out to the buoy, going around it, and returning to the starting point. Because of tidal currents, the buoy can wander considerably with the ebb and flood. So I wanted to accumulate data about its position range, so that contestants could program their ASVs to go around it, regardless of tidal conditions.
To that end, I built a recording GPS unit, housed in a waterproof box, and attached it to the buoy for two days. Here's a photo of the interior of the box:
And here's a photo of the buoy with the box attached:
The hardware consists of a Propeller Backpack (since discontinued), onto which is plugged a Proto-DB prototyping board. On the prototyping board is a PAM-7Q GPS module. I had the module in my junk box and really didn't know where it came from. It turns out that it had come unsoldered from the Parallax GPS module of the same name and that, at some point, I just soldered a header to it so I could use it stand-alone.
I wrote a Perl script (attached, zipped) that translates the raw GPS lat/lon data (in micro degrees) to a .KML file (also attached), so that I could see the track in Google Earth. (The attached Perl file did not produce the attached KML file. It's a later version that smooths the lat/lon data (also attached) according to a Gaussian averaging function.)
The Spin program (attached) waits for the HDOP (horizontal dilution of precision) to go below a certain threshold, then begins recording Lat and Lon every five minutes to an EEPROM file. The unit was powered by four AA batteries, which lasted about 37 hours.
Also attached are a KML file (zipped), which you can load into Google Earth, and a PNG file that you can view directly:
It's notable that the buoy's position clusters around two distinct locations, depending upon tidal conditions. Even more notable is the fact that the NNE cluster is overwhelmingly preferred. This is because, on an ebb tide, the buoy is pulled with the ebbing current. On a flood tide, the near-shore current results from a clockwise gyre set up by the point (Point Hudson) to the northwest, so the current direction is the same as on an ebb tide. (Locals have known this forever, but this confirms it.)