I am trying to detect deceleration in a fully contained unit but I am not super sure what to use or how to do it.
My initial idea was to use an accelerometer but, after getting one for about $10, the data seams to be tough to use. Im not sure what method I could use in my code to trigger a "slowing down" function if the deceleration is of a certain speed. Any ideas for this?
Would it make more sense to use a force sensitive resistor? If so, how could I use it to detect this?
PeterH:
An accelerometer seems like the appropriate sensor for what you're trying to achieve.
Thats what I thought as well but the next issue I have is - how can I decode the x-y-z readings to check if a deceleration is occuring? I don't want all decelerations to be detected, only when a rapid deceleration is (hitting the brakes on a bike for example or going from a full sprint to a walk really quickly).
The accelerometer will be designed to provide an acceleration value (depending on the accelerometer, it might provide multiple values corresponding to the accelerations along different axes).
Look for an example of reading the acceleration from your sensor. If it's one that is marketed for use with an Arduino then you should have no problem finding examples showing how to read values from it.
Once you have an acceleration value you would just compare it against a threshold to decide whether to trigger your action.
Thanks, I will run some tests tonight by having my friend run down the hall with it and have a radio receiver get the values every 200ms. Hopefully I can deduce the values I am looking for from it.