Android - How to approach fall detection algorithm Android - How to approach fall detection algorithm android android

Android - How to approach fall detection algorithm


First, I want to remind you that you cannot just add the x, y, z values together as they are, you have to use vector mathematics. This is why you get values of over 15 m/s. As long as the phone is not moving, the vector sum should always be about 9.8 m/s. You calculate it using SQRT(x*x + y*y + z*z). If you need more information, you can read about vector mathematics, maybe http://en.wikipedia.org/wiki/Euclidean_vector#Length is a good start for it.

I also suggest another algorithm: In free fall, all three of the x,y,z values of the accelerometer should be near zero. (At least, that's what I learned in physics classes a long time ago in school.) So maybe you can use a formula like if the vector sum of x,y,z <= 3 m/s than you detect a free fall. And if the vector sum then raises to a value over 20 m/s, than you detect the landing.

Those thresholds are just a wild guess. Maybe you just record the x,y,z values in a test application, and then move around the phone, and then analyze offline how the values (and their normal and vector sum) behave to get a feeling for which thresholds are sensible.


I have acutally published a paper on this issue. Please feel free to check out "ifall" @ ww2.cs.fsu.edu/~sposaro

We basically take the root sum of squares and look for 3 things1. Lower threshold broke. Ie fallinging2. Upper threshold broke. Ie hitting the ground3. Flatline around 1g, ie longlie, laying on the ground for an extended period of time


I forgot to update this thread, but iFall is now available on the Android Market.Also check out ww2.cs.fsu.edu/~sposaro/iFall for more information