iPhone accelerometer values are not consistent

Hello guys, i am working on a bike game. i have a problem like if i put my iphone on a table in a static position still i can see its values are changing. its values are not consistent. can anybody tell me why is that so?

i,ll be very thankful.

I don’t think you should expect the numbers to be constant, even when the phone is not moving at all. How much variation are you seeing?

The accelerometer reads all acceleration in units of g (earth’s gravitational acceleration on relatively small object near its surface = -9.81 m/s). What that means is that it will read normal gravitational acceleration as 1.0 and any acceleration with a lesser or higher magnitude accordingly. Since all forms of gravity are constant (i.e., we don’t float above the ground), that means the accelerometer will always read a downward acceleration even when the device is at rest. However, since the earth itself is moving and prolly from the accelerometer’s method of measurement, the values received from that reading are not constant and will always change by a very small fraction. Regardless, the downward acceleration read when the device is at rest will always be very close to 1.0g. Also, since the earth is not completely flat, there is a very small angle of incline on the earth’s surface which results in some gravitational acceleration also leaking to the x- and z- axes.

Check out this control I wrote which may help you out.


I worked in a game recently which needed an accelerometer control for a spaceship I created which is now available in the App Store as well, during my programming I found myself using this control for other games. I would recommended as is super easy to integrate into your game.

Download Now from the Asset Store

alt text