Mobile phone sensors

rami picture rami · Jan 13, 2011 · Viewed 13.7k times · Source

After some hours of searching I'm so confused, so I'll tell now what I learned, so please correct me if I was wrong :

Light Sensor: surrounding light

Magnetic Sensor: I can get the north location.

Accelerometer Sensor: the gravity X Y Z , earth gravity or what ever acceleration .

Proximity Sensor: just like the parking car sensors.

Orientation Sensor: Tells the X Y Z degrees form their axis.

I've tried those sensors using some apps from android market like "My sensors", and I can confirm that accelerometer Sensor can't feel if you rotate your phone in position over a table. While orientation Sensor seems to catch all the moves. Now I can conclude that compass app uses the magnetic sensor to see where is the north, then orientation sensor to know where are you heading with your device, right?

switching between portrait and landscape modes use "Accelerometer Sensor" and checks the earth gravity on which axis.right?

Q1:so if everything is ok, what is "Gyroscope"? is it same as "Orientation Sensor"?

Q2:is Orientation Sensor avalible on most of the devices?

Q3:what other uses of Orientation Sensor?

Q4:why most of the websites even wikipedia says thet Orientation Sensor == Accelerometer Sensor?

-Rami

Answer

mdelolmo picture mdelolmo · Jan 13, 2011

Ok, first the easy ones... About Q1, Gyroscope measures the Angular velocity (radians/second) and the Orientation is a different magnitude, telling us how is "placed" the device (I don't really know how to explain something so basic in English).

And about Q2, I would say yes, 3-Axis orientation is avaiable on most of smartphones, at least those running Android.

Q3: Compass actually uses the Orientarion values, Magnetic Field sensor measures that magnitude, (not in degrees) though probably you can calculate the compass values with the magnetic field. Another use... well, you can tell wether the device lies upside or downside, for example.

About Q4, this is more difficult, I'm not that expert in accelerometers, but I think most of these "Sensors" use the same hardware sensor, which measures the magnecit field and makes the necessary calculations, but I insist, maybe it's better to read more detailed and technical information.

If you notice, now OrientarionSensor is deprecated, and this is written in the docs:

Note: This sensor type exists for legacy reasons, please use getRotationMatrix() in conjunction with remapCoordinateSystem() and getOrientation() to compute these values instead.

So yes, it seems it calculates Orientation values trough the Accelerometer, but still, Orientation is given in degrees and Acceleration in (m/s^2), different magnitudes. As I told you, I think they measure different magnitudes with the same sensor, that's why they present different kind of Events in the API.

I hope I haven't written many huge mistakes, because well, I would also like to clarify some concepts regarding to these Sensors.