# AppsAccelerometer Problem.

#### satellitemundo

##### Newbie
Hi Friends,

I am doing some stuff with accelerometer. I am able to access this sensor using Sensor Listener service.As you all know it gives three values X,Y and Z. Now what this values are.
I got some info from google. But still I am not sure about it.

Can anyone elaborate those three values to me? I want to detect that user is walking or not? I want to detect the distance the user has walked.

androidforums

Last edited:

#### dimiter

##### Newbie
No, it values is linerar accelerations witout earth gravity. So, if devise lie in surface, it make the reaction force (RF). RF=-gravity. Accelerometer calculate this force. If user is walking (speed of device changed), values has changed too. You can integrate it values and get device speed in any time. You can get moving distanse (get integral of speed).
Math workflow:
1)Get accelerometer values
2)Calculate total accelerate: T=sqrt(x*x+y*y+z*z)
3)Get additional total accel. : A=T-gravityEarth (also, gravity_earth is total accelerate, if device don't move)
4)Integrate A and get speed
5)Integrate speed and get distanse

androidforums

Last edited:

#### dimiter

##### Newbie
Physics also states that when an object has a constant velocity, it's acceleration is zero.
Yes, but accelerometer detecting all forces without (!) gravity force. If device sits on surface, then
(RF+Rubbing force)=-gravity force and total acceleration is 0. But for acceleromets situation looks otherwise: it don't detect gravity force and calculate only other forces, that != 0.

Look at this 2D draw for undestrand accelerometer values meaning:
http://i5.pixs.ru/storage/6/6/6/accelerome_1421189_2958666.jpg

androidforums

Last edited:

#### dimiter

##### Newbie
Hah, so you are really looks very stupid, because now i am developing app, what calculate inclination angles with my theory. Functional part is developed, it need improve style only. You can download it:
Accel7.apk

Replies
8
Views
965
Replies
49
Views
5K
Replies
1
Views
515
Replies
7
Views
3K
Replies
0
Views
2K