Skip navigation.

Playing Around with GPS Data Logging

I have a new Adafruit Ultimate GPS.  It's very small and I have integrated it to my Raspberry Pi with an adaptor cable that connects onto an external antenna.  You can see this blog post about how it's connected up to the Raspberry Pi.

Adafruit Ulitmate GPS and the Nokia 5110 Display Note: you can click on the images in this blog to enlarge and/or read more info about the image.

This post is mainly about some observations I have made with collecting GPS data from a stationary collection point via a West facing window.   As part of another project I am working on, I need to be able to collect a lot of GPS data, so I adapted this python script gegpsd-0.1.py to read the Adafruit GPS unit and dump my required fields (GPS/Text, date_time, longitude, latitude, speed, heading, altitude, geoid_height, num_satellites, tracked_satellites, fixtype, fixtype_dimension , hdop, vdop) to a data file once a second.  I am using python, because I wanted to learn how to program in the language, even though I had previously written a simple C program for my bulkier VP-200 Marine GPS receiver

Here is a sample data line: G, 2012-11-16 09:10:48,115.363048333,-33.52689,0,278.23,-3.6,-30.8,13,9,1,3,0.89,1.99

For the observations below, I ran a number of recording sessions over a number of days, ranging from three hours to 24 hours in length. It was during this testing process that I noted the following observations:

 

1) looking at less than half the sky, will really skew the GPS readings.  In my case even with a low Horizontal Dilution Of Precision (HDOP), the readings where some 14 metres out.

GPS Data Collection - First Run

First data collection run of around 9,216 readings, with an average error of 14 metre.  There is one reading taken every second.

Second Data Collection Run - HDOP 0.81 to 7.95

A second run of 3785 readings.  They averaged out at 36 metres from the GPS receiver.  It's shaded to display the different HDOP levels:   dark green equals a HDOP of 0.81, light green equals a HDOP of 7.5.  The left hand light blob of pixels is my house.  To the left of that, is a spare block of land, then on the right hand side is another house.

Second Data Collection Run - GPS Migration Pattern

Above is a close up of the same data, this time the recordings have been broken down into 5 different sequential chronological blocks of plots.

Second Data Collection Run - Satellite data vs. HDOP

Above is another view of the second run of data recordings. I have graphed the total number of satellites in the sky, the satellite count of the ones actually being used, ie: visible from my West facing window sill, and the +/- error rate in metres (HDOP * 5). The top coloured line correlates with the 5 coloured GIS plot above that.  It shows how the data can move around with time.

2) It takes some time for the HDOP to come down to an acceptable level, and even then, it can jump around as satellites come and go.  This needs to be taken into account if you are trying to minimise GPS errors.

GPS Reading Movement in Metres

The above plot shows the actual difference between two sequential Lat/Long readings over a 9216 second (~ 2.5hrs) long period.  The Top graph shows the difference after the data from the bottom graph has been averaged out over a running 60 second period.  The bottom graph shows how much a stationary GPS reading can appear to jump around even over a short time period.

3) When left alone, stationary GPS readings can drift quite a way from a true position, even with a low HDOP:

GPS data - HDOP less than 1.0  

The above plot is a filtered view from the first run. The red-orange-yellow data points are the differences in metres from previous sequential lat/long reading.  Deep red is good (0m - 0.15m) to yellow, (0.67m - 0.78m).  Superimposed on top is a display of histogramed GPS HDOP with dark purple (best: 0.76 - 0.80), to light purple (worse: 0.94 - 0.99). The plot also shows an outside iPhone test, where I placed an iPhone 4 out on the fence top (green diamond) and plotted the resultant (using the wonderful LogGPS App) reading some 3m south of the iPhone (lower black diamond), which is pretty good for an iPhone.

4 With a clear-ish sky, most HDOP values are lower rather than higher:

GPS HDOP Errors

The graph above is a histogram that counts the number of unique HDOP entries. 76% of them are less than a HDOP of 1.24, which on the ground might be an error of around +/- 6.15 metre.  It's interesting to see that there can be a long tail of higher values.  It will be interesting to run this again, with a 360 deg. clear view of ALL the satellites.

GPS Data Collection including the second run 

This is a compilation plot of the first and second data collection runs.  The light blue (cyan) is the first run data.  Superimposed on top of the first run data is a filtered display of readings with a HDOP of less than 1.25.  It's displaying the distance from the preceding GPS reading:  dark red = 0.0 to 0.15m and yellow = 0.62m to 0.78m difference.  The green second run is shaded to display the different HDOP levels:   dark green = 0.81, light green = 7.5

 

Here are a few links that I have found helpful in understanding HDOP and GPS accuracy: