- Oct 17, 2013: I have published a guide on using your Android phone to accomplish a similar task by leveraging your Android device's built in GPS and sensors.
- Feb 6, 2013: Featured on GeoAwesomeness http://geoawesomeness.com/?p=3388
- Nov 24, 2012: Featured on Hackaday http://goo.gl/XX9oy
- Nov 21, 2012: Featured by John Boxall @ Freetronics http://goo.gl/OvnNC
- Nov 20, 2012: Featured on Dangerous Prototypes http://goo.gl/ve6Eu
I thought it would be educational to build a prototype that I can take on the road to log, geo-tag, and time-stamp sensor data to be analyzed later with mapping and/or data analysis applications. So I figured why not start with a gadget that can log road conditions. This prototype, the Bump-O-Meter, measures road conditions by using an Arduino, a GPS receiver, an SD card, and an accelerometer sensor.
This prototype is a generic sensor logging/geo-tagging gadget which means the accelerometer can be replaced with any other sensor(s) to log and map anything anywhere.
As a matter or fact my next adventure with this logger is to replace the accelerometer with a pollution sensor to visualize levels of air quality around town.
This guide is divided into the following sections:
- Overview & Background
- Hardware & Software Components
- Wiring the Prototype
- Logging data to the LC STUDIO SD Card
- Geo-Tagging & Time-Stamping With the LS20031 GPS Receiver
- Measuring Road Condition with an ADXL335 Accelerometer
- PROGRAM: The Arduino Program That Pulls It All Together
- PROGRAM: A Plain GPS Logger To Interface With Google Earth
- Scrubbing & Formatting Data with a Spreadsheet
- Plotting and Color-coding Road Condition Data with GPSvisualizer.com
- Formatting GPS Date/time Output For Stamping Data
- Speed vs. Logging Accuracy
The Bump-O-Meter uses an Arduino to capture the X,Y,Z motion data generated by the ADXL335 accelerometer. In this case, we are measuring road "shakiness" as a result of road condition. Poor road conditions and uneven road surfaces generate lots of sudden acceleration in the car body up and down (z-axis). But before this data is saved to the SD card, it's tagged with location information from the LS20031 GPS receiver and also date/time stamped in real-time using the GPS satellites' atomic clock. More on this later.
We want to capture and analyze the z-axis acceleration information visually to determine which road stretches are poorer and need attention. We can repeat this and compare our data over time. The possibilities are endless. Not just for road condition scanning, but for any sort of environmental geo data logging.
HOW TO USE
We can use this gadget by placing it in a car and driving over a given road stretch to assess its condition. We can even attach this prototype to a bike or skateboard to identify irregular and rough stretches of tracks.
We can substitute the ADXL335 accelerometer sensor with any other sensor(s) such as temperature or pollution sensors with simple code modification.
The data on the SD card can then be imported it into a spreadsheet for scrubbing, sub-setting, reformatting, analysis, and visualizing.
We will also make use of a wonderful website GPSvisualizer.com to plot our data over a map using intelligent markers that change shape and color according to magnitude of road shakiness so we can visually detect road conditions in need of further inspection.
I have published a guide titled "Connect your LS20031 GPS receiver to Google Earth via PC" explaining how to configure the LS20031 GPS receiver. You can refer to it for more details on how to use the LS20031 GPS receiver.
HARDWARE & SOFTWARE COMPONENTS
- Arduino Uno or Leonardo*: $25 (Arduino.cc, Seeedstudio.com)
- LS20031 GPS receiver: $50 (Ebay, Pololu, Adafruit, Sparkfun)
- ADXL335 or ADXL345 Accelerometer (or any other sensor): $7 (Ebay.com)
- SN74AHC125 as level shifter from 5V to 3.3V**: $1 (Mouser.com, Futurlec.com)
- SD reader socket. The LC STUDIO: $2.50 (Ebay.com)
- SD memory card. $5 for 4GB.
- LED: $0.1
- Resistor 1K Ohm: $0.1
- Breadboard: $5
- Jumper wires: $2
- Male headers 2.45mm (0.1") - straight and right angle: $1 (Ebay.com)
- Any battery or power source that can provide 7-12V and a minimum of 500mA.
* I have not tried this prototype with the Arduino Leonardo because of some known issues with the SD library . But according to the release notes of the Arduino IDE 1.02 software these issues have been addressed.
** In the future, I am phasing out the SN74AHC125 level-shifter (5V to 3.3V converter) in favor of the CD4050BE HEX Non-Inverting Buffer/Converter simply because it's more readily and cheaply available on Ebay.com. I purchased 10 ICs for $4.0. That's $0.4 per IC. The CD4050 is not pin compatible with the SN74AHC125 but there are plenty of examples on the net.
- Arduino IDE 1.02
- MiniGPS 1.4: This is a nifty utility to configure the LS20031 GPS receiver.
- GPSvisualizer.com: This amazing website will help us plot logged sensor data along with the GPS coordinates using color schemes to indicate road conditions.
- MS Excel or comparable spreadsheet: We will use a spreadsheet to scrub the logged data, to remove any garbage, to make sub-selections of our logged, and to format it in a manner that can be read by other applications and websites such as GPSvisualizer.com and Google Earth.
- SD Arduino library (bundled with Arduino IDE)
VIDEO OF IMPORTING/REFORMATTING LOG FILE
This is a prototype and prototypes by definition are drafts of products not finished yet. Your feedback is appreciated.
Hazim Bitar (techbitar)
techbitar at gmail dot com