The gravity sensor measures the acceleration effect of Earth's gravity on the device enclosing the sensor. It is typically derived from the accelerometer, where other sensors (e.g. the magnetometer and the gyroscope) help to remove linear acceleration from the data. The Gravity unit are in m/s² like the accelerometer, and they are measured along the X,Y, and Z axes.
When a device with gravity sensor is held up, the source of gravity acceleration is, of course, the gravity pull of the Earth. Therefore, when the gravity sensor discloses the X,Y,Z components of the sensed gravity, one can calculate the tilt of the device relative to the face of the Earth. Ancient gravity sensors for measuring tilt were made by a small body (e.g. a sphere) that is tettered to a wire connected to the device. Crude angular scales were used to determine the inclination of the wire relative to a perpendicular reference line to the Earth.
In modern mobile devices, the physical sensor that measure acceleration is the the accelerometer. The accelerometer, however, measures all the accelerations that affect the device, which are the sum of the gravity acceleration and the actual linear acceleration that are associated with the movement of the device. A crude estimate of the gravity on hand-held device can be made on the accelerometer reading using a low-pass filter that minimizes the linear acceleration. Remember that a hand-held device is most of the time stationary, and cannot sustain continuous accelaration in one direction (unless the user travels within a vehicle that is subjected to wild accelerations). Therefore, the linear acceleration components in the accelerometer measurement are transient in nature, with a tendencies to return to 0.
First generation smartphone used this low-pass filter technique to determine device tilt using the accelerometer, which was the only sensor available at the time. While results were satisfactory, the response was relatively slow due to the inherent delay of the low-pass filter. Modern mobile devices refined the gravity measurement by creating a virtual sesnor that is implemented as a sensor-fusion of several basic physical sensors, the accelerometer, the gyroscope, and the magnetic sensor. This resulted in much more accurate and fast responding gravity and tilt measurements, as you can experiment below.
Sensor Kinetics for the iPhone includes a 3d graphic view that shows the three components of gravity along the x,y,z axes of the device.
Similar demo is available in the Sensor Kinetics app for Android.
Sensor Kinetics displays realtime charts for the three components of gravity along the x,y,z axes of the device. The gravity charts can be viewed in either portrait or landscape mode.
You can compare the gravity sensor and the accelerometer as follows:
Hold the device face up and make "up and down" movements. The accelerometer's raw readings will show Earth's gravity plus variation on the Z axis due to the movement. The gravity sensor reading will show constant Earth gravity along the Z axis regardless of the movements.
In our RotoView technology, we measure the device tilt to control the scrolling. RotoView attempts to use the best available means to measure the tilt, so if your device has a gyroscope, it will automatically select a gyroscope based virtual gravity sensor, as discussed above. However, you can experiment with an accelerometer-only tilt detection using the following Setting selection in the RotoView Photo Viewer app:
You will be able to see for yourself that the low-pass filter that must be used on the accelerometer only implementation of the gravity sensor is slower and less smooth than the gyroscope based implementation!
For further questions, please contact us at 1+ (281) 879-6226, fax 1+ (281)
879-6415, e-mail firstname.lastname@example.org.