[GUIDE] Your sensors and you

LeoRex

Retired Moderator
Nov 21, 2012
6,223
0
0
Visit site
Spocktricorder.jpg

These devices are marvels of technology, packed with more high-tech gizmos than you can shake a bat'leth at. Powerful processors, storage, organic light emitting diodes, etc, but there's often one piece of technology that is often ignored when we talk about our phones; the sensors.

Sensors are dull, boring... rarely mentioned. But they often have a massive impact on how our phones operate. We usually only become aware of them when they DON'T work... a case or screen protector blocks the proximity or light sensor, for instance. And it is often one of the key differences between a top of the line model, such as the Nexus 6P with one of the more budget minded phones, like the Honor 5X. And with the increased visibility of Virtual Reality and Augmented Reality... such as not being able to run Pokemon in AR Mode. (don't worry, Pokemon references will be limited)

pokemon-gs7edge-2_0.jpg

What are these sensors, and how do I find out which ones my phone has?

The sensor layout is often just a footnote on a spec page, and while there are some diagnostic tools on your phone that you can use to see them (or their output), the simplest and most effective way to view those sensors is to download a sensor testing app. I'm currently using Sensor Test by Ettore Zaffaroni (found here : https://forums.androidcentral.com/e...s/details?id=asd.vector.sensor&token=9lhtqkv4)... it's simple, to the point.

Light
This is simple; it detects light. It is typically located on the front of your phone, most often at the top. It reports the ambient light value in 'lux, or 'luminous flux per unit area' and it is most often used by your phone display's automatic brightness setting.​

Proximity
The sensor emits electromagnetic radiation, usually infrared, and waits for a reflection. It is designed to only report two values, near or far, and uses very little power in the process. This is what turns off your phone's display when you hold it to your ear during a phone call, and what can help your phone ignore input when in your pocket. Unlike the light sensor, this one needs to be uncovered. One of the most common problems you'll see is this covered by a screen protector or (rarer) a case. If it's covered, you might have issues with things like the screen staying black on a phone call, etc.​

Pressure
Measures the ambient atmospheric pressure in pascals. I have no idea how this is helpful.... other than some of those crowd-sourced weather apps. Maybe there is a "Shutdown if on Mars" mode.​

Geomagnetic Field
This is a magnetometer that senses magnetic fields on three axis (X, Y, Z). Typically, this allows the phone to detect its orientation with respect to the Earth's magnetic field. For apps like Google Maps, this data is needed to figure out what direction you are pointed, not just your location.​

Linear Accelerometer
A series of sensors (sometimes looking like interlocking, microscopic fingers) that detects acceleration along the three major axis, in m/s. Another one of those critical sensors that the phone needs to have working properly to know what's what. If your phone stops being able to change its orientation and it is a hardware problem, this sucker is most likely the culprit.​

Gyroscope
Detects angular speed (rotation) with respect to the three axis of the device, reported in degrees per second. This sensor is critical for VR and AR applications, like Google Cardboard or Pokemon and some current or older lower end phones (like the Honor 5X, first gen Moto G) lack one. Without it, there is no way for the phone to accurately synchronize the orientation of the phone (and what you see through the camera) and the orientation of the application's interface.​

Heart Rate Sensor
This uses a emitter similar to the proximity sensor to determine the heart rate (or at least the pulse detected on the finger you have pressed against it). Only a few phones have these (such as the S7), but they are more common on smartwatches and fitness bands​

Humidity/Moisture Sensor
Another uncommon sensor, detects the moisture content of the ambient air. I hear that Apple might use this for safety reasons, perhaps to not allow the phone to charge if it detects an extremely humid (i.e. wet) environment. Otherwise another sensor that might be a niche thing.​

Step Counter
A dedicated sensor designed to better detect (while using less power) walking and running than using a combination of the other sensors. This is a relatively newcomer to the phone world and is pretty nuanced as it needs to be able to figure out a step from other random motion. Judging from the complaints I've read from people here and elsewhere, they still have some kinks to work out.​

Significant Motion Detector
Another sensor that is fairly new to the scene. The purpose of this is to try to figure out if the motion of the device means a change in your device's location... so it knows the difference between someone fidgeting in their seat and someone walking or driving in a car. The power-saving Doze feature, new to Android 6.0, uses this sensor to determine whether or not it should enable or not.​

Hall Sensor
A Hall effect sensor is a transducer that varies its output voltage in response to a magnetic field. Now... what does that jibberish mean? It's all fancy-pants speak for the sensor that tells you if you have it in a smart case and you closed the cover (there's a small magnet in the case's cover).​

Now, the sensors above give the phone everything it needs to figure out where it is and how it is oriented with respect to the world around it. From there, it starts to crunch some numbers to get some more detailed information. Some phones have a dedicated coprocessor to calculate the additional information, saving power. The Android Sensor Hub in the Nexus 5X and 6P, the Qualcomm Snapdragon Sensor Core found in the Snapdragon 8XX class of processors are two examples of dedicated hardware sensor hubs. Others - typically lower end phones - either don't report any additional data altogether or calculate the value using the main processor, which can use a fair amount of power in the process... you have to remember that most of these sensors are always on.

So now what?

From there, a whole host of information can be found... here are some secondary sensor readings you may see:

Gravity
This is more complicated than you think... not to get all Einstein on you, but from the phone's perspective, there is no difference between it under acceleration and it feeling the pull of gravity. The phone uses the geomagnetic sensor, gyroscope and accelerometers to determine the phone's geomagnetic rotation vector (which direction the phone is pointing with respect to Earth). Then it can cancel out the pull of the Earth's gravity (9.8m/s^2).... THEN.... phew.... it can figure out if you are holding the phone still or if you are moving about (which is given as the linear acceleration).​
(Game/Geomagnetic) Rotation Vector
A calculated value to determine what direction the phone is pointed, given as a rotation angle and axis. If you can't turn on AR Mode so you can take a screenshot of that Weedle jumping on your gramm's head, blame your phone's inability to determine its rotation vector.​
Orientation
Related to the Rotation Vector, just given in degrees in all three axis.​

So if you REALLY want to see how the Android sensor sausage is made, go check it out in all its glory here (https://developer.android.com/guide/topics/sensors/sensors_motion.html).
 
Last edited: