Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly does the iPhone accelerometer measure?

The apple documentation for UIAcceleration class says,

"When a device is laying still with its back on a horizontal surface, each acceleration event has approximately the following values:
x: 0
y: 0
z: -1
"

Now, I am confused! How can the acceleration be non-zero, when you clearly say the "device is laying still"?

UPDATE

Judging by the responses, I think this should be called something like 'forceometer' or 'gravitometer' and not accelerometer!

like image 891
gigahari Avatar asked Feb 15 '12 12:02

gigahari


2 Answers

You get a -1 on the Z axis because gravity is acting on the device, applying a constant acceleration of 1G. I assume you want user acceleration, which you can get from the DeviceMotion object using a device motion handler as opposed to an acceleration handler. The userAcceleration property filters out the effects of gravity on the device and only gives you how much the user is accelerating it.

like image 185
bensnider Avatar answered Sep 24 '22 10:09

bensnider


It measures the gravity. The unit is chosen so that the gravity, 9.81 m/s^2, equals 1 unit. The sign tells how the phone axis is directed. In other words, what the phone considers downwards.

The phone measures 0 as acceleration in free fall. I don't know how much you want to throw your phone up and down to test it :)

like image 34
Ali Avatar answered Sep 24 '22 10:09

Ali