Tuesday, March 27, 2018

The Pi Logger

Since it's too cold to windsurf, and cheap OTG phones are not available in most of the world, I've been looking into using a Raspberry Pi for logging GPS data. For those who don't know Raspberry: they are tiny little Linux computers that cost between $5 and $30, depending which model you want. Here's an image showing two of them:
The clear case contains a Raspberry 3 (~ $30); the white case a Raspberry Zero W ($10). The black thing at the bottom is a USB battery; the blue & black thing at the left is a GT-31 GPS. Here's a view from the side:

There's a USB GPS dongle plugged into the Raspberry 3 - the same dongle I had used with Android phones before. I tested the Pi 3 - dongle setup on a bur ride into Boston today, and it worked! Here's are some speed tracks from the dongle and a GW-60 watch:
The blue lines are from the GW-60 (the "gold standard GPS), the red lines are from the dongle + pi. The watch had problems when the bus went under bridges, and dropped a bunch of points (the lines to the bottom). Zoomed in, the data from the dongle look less noisy than the watch data:
This is reflected in lower error estimates for the dongle data (the numbers on the right side):
No big surprises here, the dongle had done better than the watch in previous driving tests (when using an Android phone). The next thing will be to get some tests with the smaller Raspberry Pi Zero W in a few days (I'm waiting for a cable I need).

So far, the setup is just a logger: plug the battery cable into the Pi, wait a couple of minutes for it to boot, plug the dongle in, and record. When done, take the dongle out, and the Pi will shutdown a little later. Back home, grab the data over WiFi, and through them into your favorite GPS software, or upload to ka72.com. To get this to run, it needs a custom Java program, a couple of libraries for the USB/serial communication, a couple of scripts, and an entry in the /etc/rc.local to start things up automatically - not too bad.

The hardware cost for Pi Zero W + GPS dongle + battery + case cables is around $50 US. Adding a small display would add another $40 or so, almost doubling the cost, so that's not very high on my list of priorities.

Things I'll probably try first are:

  • Use a smaller battery pack
  • Pack things neatly for use when windsurfing
  • Configure the Pi Zero as a USB drive for easier downloading onto a computer
  • Use Bluetooth to announce speed
  • Use Bluetooth and an Android phone to display speeds 
  • Automatically transfer files after a session to a phone or PC (over Bluetooth or WiFi)
The entire setup should consist of a few things that are easy and cheap to buy, and a few cables, with no or very little assembly required. Geeks can swap the USB dongle against a ublox 8 chip with a larger antenna, and hook it up using either a serial-to-USB cable, or using the GPIO pins on the Pi (which would also require software changes). 

No comments:

Post a Comment