Kaleb Kircher

Mobile Architect

Software Engineer

Kaleb Kircher

Mobile Architect

Software Engineer

Android Acceleration Sensor: Sensor Noise

December 27, 2017 Android Sensors A triple axis accelerometer is standard equipment on almost all Android devices.  They can be used to detect the orientation of the device, determine if the device is in free fall, control objects in a game, tap detection, measure acceleration, etc…

Accelerometers measure both the static gravity field of earth and dynamic acceleration in two or three axis. It is important to note that it is impossible to separate static acceleration (tilt) from dynamic acceleration (linear accleration) without the use of another sensor. This means an accelerometer can be used to determine the tilt of the device or the acceleration of the device, but not the tilt of the device while it is accelerating.

The range of a sensor determines the upper and lower limits of what it can measure. Most sensors designed for mobile devices measure up to 16 earth gravities, but can be configured for higher precision at the cost of maximum magnitude.

Java Code:

Register to listen for accelerometer updates from Android at the fastest possible frequency:

sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);

sensorManager.registerListener(listener,sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),SensorManager.SENSOR_DELAY_FASTEST);

Sensor Noise:

The noise density is defined as the noise per unit of square root bandwidth and can be used to determine the expected noise output from a sensor. To determine the expected noise output from noise density, we take the equivalent noise bandwidth, B, of the output filter. The equivalent noise bandwidth of a filter is the -3dB bandwidth multiplied by a coefficient corresponding to the order of the filter. The coefficients are as follows:

• B = 1.57 * f-3dB Hz for a 1st order filter

• B = 1.11 * f-3dB Hz for a 2nd order filter

• B = 1.05 * f-3dB Hz for a 3rd order filter

• B = 1.025 * f-3dB Hz for a 4th order filter

Testing a Nexus 4:

If you are interested in a specific devices you can usually identify the equipped sensor and then refer to data sheets to determine the expected noise density of the sensor. You milage may vary.

The Nexus 4 equipped with a MPU-6050 with a noise density of 400 ug/sqrt(Hz). The measured output frequency was 193hz.

With first order filter we would expect to see noise of .06962g since (400ug/sqrt(Hz)*sqrt(1.57*193Hz) = 6962ug.

When the MPU-6050 is sampled from the Nexus 4 on a flat surface, the RMS amplitude between the minimum value and maximum value is 0.0186g, which is lower than expected. This possibly implies that a large amount of filtering must be occurring in the background either on the hardware or somewhere in the Android software. 