Geo Data Logger: Arduino+GPS+SD+Accelerometer to log, time-stamp, and geo-tag sensor data



NOTE: I have oversimplified the concepts in this section to keep this guide short and accessible.  For those who are interested in a more detailed explanation, there are many helpful references on the web. 

The accuracy and resolution of the geo data logger will depend on many facors such as:
  • The speed by which we are moving with the geo data logger.
  • The frequency by which sensors can generate fresh readings.
  • The frequency by which the GPS receiver can generate location fixes to tag sensor data with.
  • The SD card read/write performance. 
  • The speed of the microcontroller, for number crunching and formatting. 
As for our Bump-O-Meter, we have the following specs to work with:
  • The LS20031 GPS receiver can report a location "fix" 5 times a second (datasheet says 10Hz but field experience shows 5Hz is reliable)
  • The ADXL335 Accelerometer generates motion data at a rate 50 times per second.
  • SD cards have an average latency of 100 ms even though the specs allow for 200 ms. Some old SD cards can handle 150KB/Sec to 200KB/Sec. More than enough for our data logger. 
  • The ATmega328p runs at a cool 16Mhz. 
MATH FOR FUN (No such thing)

So the bottleneck for our Bump-O-Meter will be the GPS receiver, at 5 updates per second (5Hz). Let's assume we are driving at 60 Km/h and the GPS is reporting 5 location fixes per second.
  • 60 kilometers per hour = 1 Km per minute. 
  • 1 kilometer per minute = 16.6 meters per second. 
  • Since the LS20031 GPS receiver provides 5 fixes per second that's a fix every 3.3 meters. Keep in mind this GPS receiver is accurate within 2.5 meters. 
At 30 kilometers per hour, we can double the accuracy of our logger and so on. At 15...and so forth. 

The key thing is to record a road bump or pothole even if we don't have its exact location. Because so long as we capture the bump's existence on our logger, we can find it if we go searching for it within +/- 2.5 meters (GPS accuracy) of the location reported by the logger.  

For smoother data such as the ones generated by outdoors temperature and humidity sensors, we can make use of fairly simple techniques for guessing in-between data, such as interpolation. 


Interpolation is a method of guessing a mid data point within two recorded sensor data points.  For examples, if we drive down the highway while logging temperatures, if our geo data logger is capturing temperature readings every 100 meters, it might be possible to interpolate (guess) the in-between temperature every 50 meters. The change in outdoors weather temperature within 100 meters is not typically abrupt but tend to be gradual. So if we log 32 degrees F at 0 meters and 33 degrees F at 100 meters. We can make a reasonable guess that at 50 meters or somewhere in between the temperature can be 32.5 degrees F. This is the simplified version of data interpolation. 

Some interpolation might be possible and meaningful between two logged temperature points over a certain distance. Interpolating road conditions, on the other hand, may not be as simple.

Potholes and road bumps don't lend themselves to interpolation. Unlike the gradual change in many environmental conditions, potholes tend to be sudden.  Potholes are not typically preceded by increasingly larger potholes. And they are not followed by increasingly smaller pot holes. For detecting pot holes, we have to drive slower to give our geo data logger time to catch those (<15 Km/h).  Also, we can slow down when we see an approaching pothole or a road bump to make sure our geo data logger catches it.  In real world situations, we tend to slow down anyway as we approach a bump or pothole so that works well for our purposes. 

Happy geo data logging. 

skrubol2 years ago
You can read the accelerometer more often than the GPS, so there should be no need to interpolate the accelerometer reading. Either you would interpolate the position reading (write 10 accelerometer readings for every GPS reading and do the interpolation in post processing,) or characterize the 10 accelerometer readings (likely take RMS or peak) and record once per GPS reading.