AVR/PIC uC to calculate 0-100kph and 100-0 using 2D accelerometer

Jul 12, 2003 5 Replies

Hi all! I'm mucking about with an AVR/PIC uC and want to choose a suitable accelerometer (probably from Analog Devices - but please let me know of any suitable alternatives!) to give me good accuracy to calculate 0-62mph times, max lateral G force, braking G's etc



What I do need is for someone to point me in the right direction with regards to how I can calculate such things using only the accelerometer and a known car weight?



TIA! Adam


The Analog ADXL series is probably your best bet, they're ubiquitous and inexpensive. For automotive use, I would suggest a dual-axis 2G unit unless you plan to crash or engage in radical driving, then a 5G or 10G unit should suffice with slightly reduced resolution. The ADXL series has both analog and duty-cycle output units, an ADC will be unnecessary if you go with a duty-cycle version.

The car's mass is irrelevant in the calculations to determine speed or G's. The vehicle speed, which is an integration of acceleration over time, can be calculated but an accelerometer-based speed estimation will quickly degrade due to cumulative sampling innacuracies and changes in the vehicle's orientation.

No, BB, the vehicle's orientation does not affect the speed calculated. The speed is a path variable, and is integrated along the path regardless of oriention. The only way it can be off is if the car is sliding thru the turns - ie, losing speed lateral to the direction it's pointing.

Doug I hated dynamics but I remember path variables...

I was thinking more in terms of a vehicle able to rotate freely in all axes (in which case you'd need gyroscopes to measure orientation as well), which isn't really the case for a motor vehicle. Hopefully though, he won't be driving that recklessly. ;O)

In a vehicle with it's tires stuck to the road, you're right.

OOH! OOOH! OOOOH!

Actually, I just realized it IS an issue. The vehicle's pitch orientation (uphill or downhill) will result in G's being included in the accelerometer readings, and will be integrated into any velocity solution.

i.e., even if the vehicle just sat there parked, pointed uphill, it would look like the vehicle was accelerating.

So I *was* right, neener neener! ;OP

It's not all that hard. I used it in a rocket, so...

Things you have to do are : Get a PERFECT alignment with the centreline of your car, and measure the Y and Z-acceleration (to eliminate the up-or downhill acceleration. Get enough resolution (10-12 bits for an ADXL), and a REALLY precise clock. That's going to be your biggest problem. i used an I2C clock, but it could only give me data up to 1/100th of a second.

If you cannot put the sensor at the centre of gravity of your car, you will need three sensors (x,y,z) and know the exact locati>Hi all!

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required