hello forum. i want to use an accelometer, on a car, to detect the following situtations : (i suppose that i would use a 3axis accelometer, with the X-Y plane, parallel to earth)
when i there is a hard braking. but, is the accelometer, able to detect accelearation from DEcelaration??? or would accelarating, produce the same signal, as braking??
also, and more important, i want to be able to detect, when the car is driving uphill... how would i do that??? can i seperate it, from when the car is driving downward???
I'm new to Arduino and programming but i have a suggestion.
I'm not sure how you would like to use this information (output to LCD maybe?) but detecting uphill and down hill would be easy. Use analog pins and set something up along the lines of:
if x > ( high end of level range) you're going up hill
if x < (low end of level range) you're going down hill
else you're level.
please note that that is not at all written in code but rather is an idea of how you could set it up and that x could be changed depending how you orient the sensor.
I'm assuming you have a tolerance of what is "level" so that's why I use a range instead of a single number
For example (using degrees as angular measurement) you might say anywhere between -5 and 5 is level.
Hope that helps! If not but you like the logic, feel free to reply to this or message me or something and I'll try to help you out
An accelerometer cannot distinguish between the acceleration due to the Earth's gravity and acceleration due to any other effect, like an automobile accelerating, decelerating or braking. You should just build the circuit and then test it in various different situations, so that you can learn how it will respond.
An analog accelerometer usually outputs Vcc/2 (often 2.5V) when subject to zero acceleration along an axis.
Search for "arduino accelerometer tutorial" for lots of information.