Showing posts with label Raspberry Pi. Show all posts
Showing posts with label Raspberry Pi. Show all posts

Saturday, June 23, 2018

Foil Against Noise

Let me start with a picture to make clear what this post is about:
It's about how a little bit of aluminum foil can help against RF noise from Raspberry Pies(the kind shown in the picture above - if other raspberry pies make you noisy, try the gluten free versions!).
The graph above shows the results from a stationary test, with measured speed on top, and accuracy estimates at the bottom. For the first 5 minutes of the test (the left, yellow half), I had covered the Raspberry Pi with a bit of aluminum foil; for the second half of the test, I put the Pi on top of the foil.

The results show that (a) the Pi generates a lot of RF noise that's picked up by the GPS and introduces error, and (b) that this RF noise can be blocked quite easily. For those of you who like numbers, here are the averages and maxima for this test (all numbers in knots):
For the numbers, I divided the second half of the test into two parts: a transition part, where the speeds and error estimates where high; and a "not blocked" part, when the numbers stabilized. Moving the Pi took just a few seconds, but the transition period lasted about 2 minutes. I'm not sure exactly what was going on there - perhaps the software in the GPS module needed a couple of minutes to figure out which satellites and/or noise filters to use. 

The numbers in the table above reflect what I had seen many times before in other data sets:
  • At low error estimates (the "with foil" row), actual errors typically are below the error estimates.
  • With higher error estimates, deviations larger than the error estimate can be observed more often.
  • With poor data quality (high error estimates), the error becomes less random, with extended regions of larger error. This is illustrated by the high (false) speed over 2 seconds of more than 4 knots in the "Transition" period. In this region, 10 successive points had errors over 2 knots, about 2x to 5x as high as the error estimate. This would be extremely unlikely to occur randomly.
While the data shown are from a single test, the results are very reproducible. This is quite easy to do by simply hooking up the GPS to u-center, and opening a few graphs. Here's a screen shot from the part where the Pi was covered with foil:
Changes after uncovering the Pi where quite dramatic:
For a lot of the satellites (but not all of them), the observed signal-to-noise ratio dropped significantly, which reduced the accuracy of the speed calculations. So, if you want to use a Raspberry Pi to capture GPS data: cover your Pi!

Thursday, May 24, 2018

GPS Prototypes

Here's a short video that shows two GPS prototypes ready to be tested on the water:

The one on the left uses a Raspberry Pi Zero W, an e-paper display (similar to what a Kindle uses), and a Stratux GPYes USB GPS module. The one on the right is inside the GoPro case. It's a ublox-8 based GPS connected to a battery and a bluetooth module; the Android phone below it grabs the data over Bluetooth and logs them. Now the wind just has to play along for on-the-water tests tomorrow!

Tuesday, April 3, 2018

For Pi Players


A couple of people have expressed interest in also playing around with Raspberry Pi-based GPS loggers, so I have posted some very brief instructions and a ZIP file with the code I use at http://www.ecwindfest.org/GPS/. If you want to play along, you'll have to figure out all the Pi things on your own - Google is your friend! I'll entertain any suggestions for improvement, but can't make any promises - I hope to windsurf a lot in the next few weeks, and spend the rest of the time talking about windsurfing, drinking beer, and sitting in the hot tub :-).

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).