Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accelerometer vs Gravity sensor

Does gravity sensor return right values if device is in motion? I thought that gravity sensor use accelerometer to recognize gravitation direction. Are these two sensors different piece of hardware?

like image 1000
SpeedEX505 Avatar asked Feb 28 '14 17:02

SpeedEX505


People also ask

Is accelerometer a gravity sensor?

Accelerometer sensors have the ability to alter obtained physical acceleration from motion or gravity into a voltage output. Accelerometers are widely used to measure inert acceleration due to gravity, the low-frequency module of the acceleration and the dynamic acceleration due to animal movement [36].

Is G-sensor same as accelerometer?

Strictly speaking, a g-sensor is an accelerometer. You might see some literature inaccurately refer to a g-sensor as a gyroscope; but when you dig deeper, you see that they're actually referring to an accelerometer after all.

What is difference between accelerometer and sensor?

Often an accelerometer can be used to measure the force of impact, or the vibration of a machine. These devices can help ensure your machinery is working correctly. Instead of measuring an absolute position, a velocity sensor uses a seismic device to measure changing positions over time.

What is a gravity sensor?

A gravity sensor measures the direction and intensity of gravity. Using such data, you can check the relative direction of a device within a space. A linear accelerometer provides data on acceleration, excluding gravity.


1 Answers

The Gravity sensor is what Android calls a 'software sensor' and calculates its values using more than one hardware sensor.

The software Gravity sensor is only available if the device has a gyroscope. By combining accelerometer data with gyroscope data, the acceleration due to moving the device can be filtered out to leave the pure gravity signal. So yes, it will return the right value under motion.

Thus, the Gravity sensor gives a much better signal for device orientation than just the accelerometer on its own.

Combining sensor values is called sensor fusion and important for high quality measurement values.

The Android Documentation describes the Gravity Sensor.

Unfortunately, many Android devices lack a Gyroscope, and thus, will have no Gravity sensor either. This leaves you with a sub optimal signal from just the accelerometer alone, giving a lower quality user experience compared to Android devices with both sensors, and lower quality experience compared to iOS devices.

You can block installations on incompatible devices by using a Google Play requirement specification as follows:

<uses-feature android:name="android.hardware.sensor.gyroscope" />
like image 65
Bram Avatar answered Sep 21 '22 20:09

Bram