Automotive G-Force mesurement with arduino?

Hi, Guys/Galls

First post here!, I am debating weather or not to get in to arduino, one proyect im insterested is to be able to store on readings from a acelerometer.

This will be use on Autocross events that i race, i would like to be able to record this (about 6 minutes of readings) and latter be able to download it to my laptop and do what ever with those readings (maybe use them to do a graphic over googlemaps or something like that that that will show when im turning to the left, right, accelerating breaking, etc...)

My experience with arduino is null, i have read a little and the proyect sounds interesting, i have some little experience with embeded devices and linux (Gentoo on the NSLU2 running a web server and some other stuff). so i have a couple of questions:

  • How much would i have to spend on hardware to get this working inside my car?
  • On a scale 1 to 10 how difficult would it be and what would be the difficult part of it?

If you still have doubts about what exactly i want to do with the arduino, tale a look at this iPhone application:

i want to be able to capture data and latter on my computer generate a graphic like that ^^^

What iPhone application is that? Looks neat.

But, I can't help you with the actual question.

it is called racedataax, it is $49 but looking at the price of arduino hardware i think it would be more fun to build something like that my self using arduino and some scripting on my MBP. thats why im insterested to know how much would i have to spend... also i was looking at 'addon' hardware for the arduino and it looks like i could expand this project beyond what the iphone can do.

There are very simple-to-use, low-cost accelerometers that will interface with the Arduino.

http://arduino.cc/playground/Main/ADXL330

However, I'm not sure if it's cut out for particularly high accuracy telemetrics. It would take some experimenting. I expect it would be on the same grade as the iPhone feature, so if you see an iPhone applet doing this, it would probably suit.

You're probably aware that accelerometers aren't sufficient for dead-reckoning the position of the car. You can't expect the sum of all acceleration vectors to help you draw a "closed loop" on a race track, where the finish line mates up with the starting line neatly. For that, you will probably need a lot more accuracy in the acceleration measurements, and GPS to corroborate makes it a lot easier. That's likely also handled by the iPhone application you mention.

The current Arduino processor itself only has 1K of RAM, but you can also interface with inexpensive serial EEPROMs without much trouble. This would let you record a few kilobytes of telemetry data, to be downloaded to the PC later.

GPS on the Arduino is harder, but it has been done. There are a number of shields to interface with available antennae, and even to store tracking data on an SD card as FAT16-compatible files. But these solutions really push the Arduino, and you might have a hard time doing both GPS and Accelerometer at the same time with just one Arduino.

The GPS antenna pictured would surely outperform the iPhone GPS, but it's fairly expensive compared to the rest of the parts of this project.

@halley

so are we talking over $150?

Hm, ballpark figures.

$30 Arduino Duemilanove
$60 GPS Antenna Module (pictured)
$20 GPS shield kit (soldering required)
$20 random electronics components, wiring, etc.
$35 ADXL330 accelerometer on breakout

Plus any tools you don't have, like soldering iron, hobby vice, clippers and a volt/ohm meter. Take a browse on Maker Shed or Adafruit, they have some tool "starter kits" that I find useful. The accelerometer I suggested can be found at SparkFun which is also a good site for neat add-ons once you have your basic tools.

If you haven't soldered anything before, I suggest you find the cheapest self-contained solder kit, such as a blinky heart toy, to get some practice before you assemble something like the GPS shield yourself. If you have no components and you think this is a neat new hobby, I like to recommend Sparkle Labs' Electronics Kit, which gives you a breadboard and a wide assortment of basic components to learn with some very clear instructions.

I think someone did it already but way more complex

http://robotmeter.com/dokuwiki/doku.php?id=the_robot_meter_wiki

they are doing some dataloging of the ECU readings through the OBD-2 port so they can get oil pressure, Air/Fuel ration, boost pressure, etc... etc...

I've been contemplating the same thing for an older car, pre OBD.

The alternatives for logging both GPS location and speed, as well as displaying longitudinal/lateral acceleration cost hundreds of $$$ more. It looks like I could do this for less than $200, and have a nifty display to boot.

What's the concensus, is it possible to log GPS data along with data from an accelerometer and possibly some other data, such as analog and digital sensor values? Would a Mega be required? Ultimate goal would be to control the fuel pressure regulator in addition to the above logging.

Acceleration measurement can actually be done with some laptops, without any extra hardware. There's often a built-in accelerometer that's used to park the hard disk if the laptop is dropped, and that can be read by software. Here's an example of it on an IBM (now Lenovo) ThinkPad.

Well, there was supposed to be a link, but the forum software won't let me post it. A search on "thinkpad accelerometer almaden" should find numerous references. The original post is by Mark A. Smith.

Thanks for the tip about making acceleration measurements with a laptop. I'll keep that in mind for casual measurements in a passenger car when I don't need to datalog.

What I really wanted to use this for was in a race car. Here is a sampling of products already on the market.
$289 for GPS tracking but no DAQ http://www.maxqdata.com/products.htm
$700 for GPS tracking, DAQ interfaces are extra http://store.traqmate.com/ProductDetails.asp?ProductCode=930002
$865 for GPS and accelerometer logging http://www.rlcracing.com/track-commander.htm
$700 for GPS and accelerometer logging with the capability to log sensors http://www.racepak.com/Road_Racing/G2X.php

So I'm thinking, price of a Mega, Adafruit GPS logger shield, accelerometer, and Locosys 5Hz GPS module would be far less and an education project, with the possiblity of future expansion, think LCD display and LED shift lights for example.

I'm surprised that this was practically the only post on this subject, so I was wondering about the feasibility of this idea.

The data logging was one reason I thought it might be better to do with a laptop. You've got multi-GBytes of hard disk space to log the data to, plus whatver analysis software you want without having to transfer the data.

I'm working on a project much like this.

the thing that has me hung up is which gps unit to go with. what level of accuracy can be obtained with one of the gps modules that can be purchased from one of the mod friendly retailers.

As far as civilian grade equipment can you even get accurate within 2 feet? if that's not possible then the use of the device isn't going to be giving information that's worth it to the driver. autocrosses tend to exist in parking lots that are about 500ft by 500ft. Typical off the shelf gps units people buy for road trips are only accurate within 10 meters... which is unacceptable for this application.

Personally I am willing to spend up to 200 dollars on a receiver if it can be that accurate wile others may not.

Some one may be a better math geek, but is it possible to take accelerometer data and help make the GPS data more accurate?

Little demonstration of what I wanted to do.

Use the Arduino simply as an acquisition tool and log all data onto an SD card.

At an autocross you get a chance to pre walk the course to learn the route and look for trouble spots.

At the start of the run you select two points that when linked make up the start line, and from then you proceed to collect every cone to map the course. once you've mapped out the cones you mark the finish line as you did the start line. You can use the mode or select button to change which points you're trying to map.

Then its up to you to just run the course, every time you pass the start line it just adds a new entry to the log file so you can do runs over and over until you fill your SD card.

Then back on your laptop you insert the car and a program (windows/linux/mac) pulls the data from the card and draws it up as a nice little map showing you your path and acceleration in two directions. the width of the additional stroke represents lateral acceleration where color change represents the the stop and go acceleration. (I didn't actually draw it on the map because I didn't want to spend hours on a simple diagram)

But going from the I phone application to something that can give better feedback.

I'm trying to figure out how accurate of a GPS can I obtain and whats going to be the cost.

Whoa! What acquisition tool is that? I'm not aware of any GPS based data acquisition tool that has the capabilities you describe, not even the MaxQData. Or did you draw this up simply as an illustration?

This Locosys LS20031 http://www.sparkfun.com/commerce/product_info.php?products_id=8975 is what I had found as the best choice for this kind of thing, though I doubt it will have the sub-meter accuracy you're looking for. Has about 3m accuracy and good sample rate. I couldn't find anything better for <$200 and civilian grade equipment is only so accurate.

My thought is that the accuracy in absolute terms isn't a big deal. If it was always off by say 5m in exactly the same direction then no problem because then all the cones would be accurately placed relative to one another as well as the car on the course.

My other thought on this was to record some analog inputs, accelerometer rather than computing from the GPS velocity and heading, engine rpm to start with.

From my research I've found it may be off 5M horizontal and double that in vertical distance.

Some one on the spark fun forums noted a u-blox unit though I'm unaware of its accuracy.

I'm actually working on a similar project. Targeted for road racing DAQ and in car dash. My tests with the ADXL320 (going from memory here) Accelerometer show that it is as accurate as my $1500 DAQ/DASH system is for measuring X and Y axis. For the GPS i'm using the Venus with SMA connector from sparkfun, which looks like it will do WAAS which should bring the accuracy up.

I will be splitting the function, using a MEGA for the actual DAQ and sensor input (non OBDII car) for Tach, Ignition Advance (my crankfire ignition provides for advance in degrees by outputing between 0-1 volts, so an analog input works for this. Tach is something (I'm no hardware engineer) that I'm still working out, as my tach signal is a 12v Square wave, and I need to take that to a 5v Square wave. The display will be driven by a Pro Mini which takes serial input from the MEGA.

The part I'm still working out is the GPS. I have the GPS receiver working, but I think that to much of the mega processing will be taken up with receiving the NMEA strings and parsing them. I will also be using a button which the driver sets start/finish. Using the Lat/Long from the GPS when the button is pressed, and the course data, I'll calculate a "line" perpendicular to the course, so that I can calculate when the Start/Finish line is crossed. Given my "concerns" with the GPS signal, my thought is to use another PRO MINI to handle the GPS and have it send only the specific data to the MEGA. Idealy I'd like to "query" the GPS, rather than have it send data asynchronously, though that does not seem possible with any of the shields available for GPS units.