loading

Step 10: SPEED VS LOGGING ACCURACY

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 OF MISSING DATA 

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. 


<p>Hi im just wondering whether it will able to track the location like within a room because i want to implement this in a lego track for detecting faulty track.</p><p>Can you assist me with this?</p>
<p>Can anyone help please? I am new <br>to this, and been trying to put together the project. So far I have everything <br>assembled as instructed. However, as soon as I try to verify the code, I get <br>this error:</p><p>Arduino: 1.6.5 (Windows 7), Board: &quot;Arduino/Genuino <br>Uno&quot;</p><p>C:\Program Files <br>(x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp:26:17: fatal error: SPI.h: <br>No such file or directory</p><p>#include <br>&lt;SPI.h&gt;</p><p>^</p><p>compilation terminated.</p><p>Error compiling.</p><p>What do I need to do to fix this?</p>
<p>Newer versions of Arduino IDE can't find the SPI library, so you need to add them by adding the following line at the start of sketch:<br>#include &lt;SPI.h&gt;<br></p>
<p>I'm no expert but had this same problem on another project. All of the files (including the additional libraries) need to be in the right folder. The Arduino IDE seems to be a bit picky about this (on Linux at least).</p>
<p>can i have the code for storing Accelerometer ADXL335 data into SD card with time staps (say every 5 min interbal)</p><p>and how can name the stored file as a YYYYMMDDHHSS format </p>
<p>could not get code to compile</p>
<p>I made an equivalent tool in python that print real time data from ADXL345 accelerometer.</p>
<p>like</p>
<p>I made an equivalent tool in python that print real time data from ADXL345 accelerometer.</p><p><a href="https://github.com/mba7/SerialPort-RealTime-Data-Plotter" rel="nofollow">https://github.com/mba7/SerialPort-RealTime-Data-P...</a></p><p>may be it will be helpful for someone</p>
<p>I made an equivalent tool in python that print real time data from ADXL345 accelerometer.</p><p><a href="https://github.com/mba7/SerialPort-RealTime-Data-Plotter" rel="nofollow">https://github.com/mba7/SerialPort-RealTime-Data-P...</a></p><p>may be it will be helpful for someone</p>
<p>I need create a file GPS.log in SD card before do this work ? Or the file GPS.log will be created by code?</p>
<p>You can read the accelerometer more often than the GPS, so there should be no need to interpolate the accelerometer reading.</p>
<p>great</p>
<p>good</p>
<p>super</p>
<p>super</p>
<p>In this tutorial I find what I need to start interfacing the gps sensor with an Arduino. And because I want to help many more hobbyists to start building robots, I share this tutorial on my post http://www.intorobotics.com/gps-sensors-tutorials-resources/. Thank you!</p>
<p>Hello techbitar - I'm thinking of building an adaption of your project but am considering changing the SD card adapter to the microSD card shield from Sparkfun: https://www.sparkfun.com/products/9802</p>
True but not all sensors (temperature, humid, etc.) possibly used by others will be as fast as the accelerometer I am using in my project.
Hello techbitar, <br> <br>I just ordered all the hardware for this project, and I should be beginning it some time next week. I just had a question. Obviously all of these components would need to be powered up whilst in car data collecting while driving, so would one of these do the job: http://www.radioshack.com/product/index.jsp?productId=3802146 . Also, I got this for the 'in-home' programming and construction of the actual project: https://www.sparkfun.com/products/9442? ..... Do you think that'll be good as well? I would assume so.
The Arduino Uno specs are as follows: <br>Input Voltage (recommended) 7-12V <br>Input Voltage (limits) 6-20V <br> <br>As for current, I have tested my Bump-O-Meter with a USB connection which provides 5V and up to 0.5A. I did not run into any issues but I did not perform any exhaustive tests. <br> <br>While driving around in my car, I powered the Arduino Uno via the DC plug using a battery brick made of 6 X 1.2V (NiMh) = 7.2V @ 2A. That voltage is close to the minimum recommended voltage. It worked but of course the moment the battery dropped to 6V and below I am sure I would have ran into all sorts of issues. <br> <br>If I go production with this, I would use a 3S LiPo for a cool 11.1 Volts and 1.5A or 2A current for safety margin in case I need to add additional power hungry gizmos to the bump-o-meter. <br> <br>Check you choices of power supplies against the min/max voltage specs and add a comfortable margin to the current with an eye on your future plans. then decide what fits your requirements best.
I was riding my bike recently and remarked to another rider that it would be useful to quantify just how bad our roads are. My thinking is to first breadboard components as you have laid them out, and then substitute an Arduino Micro and micro SD card reader for compactness. While I like LiOn batteries, a 3S 11.1V 2 amp battery is fairly large (and heavy and needs a requisite charger). Do you have an idea for a compact battery with a 3-hour runtime?
Hello techbitar - I'm thinking of building an adaption of your project but am considering changing the SD card adapter to the microSD card shield from Sparkfun: https://www.sparkfun.com/products/9802 <br> <br>Do you see any obvious problems with this change, and would it break the code you've written? Cheers
I have not tried it but if it Sparkfun's SD adapter does not work out of the box you may need to tweak my circuit and/or code.
You can read the accelerometer more often than the GPS, so there should be no need to interpolate the accelerometer reading.
True but not all sensors (temperature, humid, etc.) possibly used by others will be as fast as the accelerometer I am using in my project.
You're welcome.

About This Instructable

159,926views

503favorites

License:

Bio: Did I unplug the solder iron?
More by techbitar:IR Remote Control Station for Android - TURN THE TV DOWN SensoDuino: Turn Your Android Phone into a Wireless Sensors Hub for Arduino Modify The HC-05 Bluetooth Module Defaults Using AT Commands 
Add instructable to: