Accelerometer problems (Sensor Lib)

latcc

Banned
The accelerometer (sensor library) does not return correct values for me. I don't understand what's happening with it.

I found this description of what the x,y,z values represent:

"Acceleration is defined such that a device in free fall has an accleration value of (0, 0, 0). Thus a stationary device will have an acceleration value of (0, 0, -1) since it is being acted on with 1g of force by the Earth's gravity. When the device is stationary, the acceleration vector will thus indicate the downward direction."

I don't get these values at all. Anyone got this Sensor Library call working?
 

klaus

Expert
Licensed User
Longtime User
The accelerometers are absolute accelerometers and therefore measure also the earth gravity.
Accelerations measured in m/s2.

On my Nexus One the
X axis is landscape axis, device vertical position
X = 9.81 lower edge right
X = -9.81 upper edge right
Y = 0
Z = 0

Y axis is portrait axis, device vertical position
X = 0
Y = 9.81 upper edge on top
Y = -9.81 upside down
Z = 0

Z axis is vertical axis, device horizontaly
X = 0
Y = 0
Z = 9.81 screen on top
Z = -9.81 upside down

On my device, the Z axis has an offset of about 0.4 m/s2.

Best regards.
 
Last edited:
Upvote 0

latcc

Banned
The accelerometers are absolute accelerometers and therefore measure also the earth gravity.
Accelerations measured in m/s2.
On my device, the Z axis has an offset of about 0.4 m/s2.

Best regards.
Hi Klaus

Yes, I understand that. What I don't understand is: when I move the device in (say) the z axis, the other two axes' values are also changed. These are not discrete values but are somehow all interlinked. This makes them useless as discrete X,Y,Z values. If you move forward the up (z) axis shows a movement upward also. I am beginning to think this sensor is useless except for gross use, like a device 'shake' sensor.
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
I made some further tests.
It is not easy to garanty that we move really just in one axis.
But nevertheless the accelerometers in the devices are of low quality and have some noice and also some axis interference.

With the device on a table:
- the noise is about +- 0.03 and +-0.08 m/s2 depending on the axis
- moving horizontaly the z axis 'noise' is about +-0.5 m/s2 (is my movement really perfectly horizontal ? No)

Best regards.
 
Upvote 0

latcc

Banned
I made some further tests.
It is not easy to garanty that we move really just in one axis.
But nevertheless the accelerometers in the devices are of low quality and have some noice and also some axis interference.

With the device on a table:
- the noise is about +- 0.03 and +-0.08 m/s2 depending on the axis
- moving horizontaly the z axis 'noise' is about +-0.5 m/s2 (is my movement really perfectly horizontal ? No)

Best regards.
Thank you for taking an interest in this issue, Klaus.

I accept your point about not being able to move the device in only one axis without the other two axes also having some possible movement. The amount of 'unintended movement' on other axes is quite a lot, relative to the of the 'intended movement' axis. So I still feel the axes's values are somehow all linked. I will put it down to poor quality hardware, I think. :)
 
Upvote 0
Top