Android OS 11 sensor introduction

Source: Internet
Author: User
Tags cos sin

Let's look at these 11 sensors in turn.

1 Acceleration Sensor

The accelerometer is also called G-sensor, which returns The acceleration values for the X, Y, andz axes.

This value contains the effect of gravity, in units of m/s^2.

Put your phone flat on the desktop,x -axis defaults to 0,y - axis default 0,z Axis default 9.81.

Place your phone face down on the desktop with az axis of -9.81.

Tilt the phone to the left and thex -axis as positive.

Tilt the phone to the right and negativex - axis.

Tilt the phone upward and they -axis is negative.

Tilt the phone downward and they -axis is positive.

The accelerometer is probably the most sophisticated MEMS product, with a wide range of accelerometer sensors on the market.

The commonly used accelerometer in mobile phones are bosch (Bosch) BMA series, AMK 897x st lis3x series.

These sensors typically provide an acceleration measurement range from ±2G to ±16G , using an i²c or SPI interface and MCU data accuracy is less than 16bit .

2 Magnetic sensor

The magnetic sensor is referred to as m-sensorand returns The environmental magnetic field data of the X, Y, andz axes.

The unit of the value is micro-Tesla (Micro-tesla), expressed in UT .

The unit can also be Gauss (Gauss),1tesla=10000gauss.

There is generally no independent magnetic sensor on the hardware, and the magnetic data is provided by the electronic Compass sensor (e-compass).

The Electronic Compass sensor also provides direction sensor data for the following.

3 Direction Sensor

The direction sensor is abbreviated as o-sensor, which returns the angle data of the three axes, and the unit of the direction data is the angle.

To get accurate angular data,e-compass needs to get g-sensor data,

The production o-sensor data is calculated, otherwise only the horizontal angle can be obtained.

The direction sensor provides three data, azimuth,pitch , and roll respectively.

Azimuth: Azimuth, returns the angle of the magnetic north and Y axes at horizontal time , ranging from 0° to 360°.

0°= North,90°= East,180°= South,270°= West.

Pitch: The angle of the x-axis and the horizontal plane, ranging from -180° to 180°.

When the z axis rotates toward the y axis, the angle is positive.

Roll: The angle between the y-axis and the horizontal plane, for historical reasons, ranging from -90° to 90°.

When the x - axis moves toward the z - axis, the angle is positive.

The electronic compass needs to be calibrated before it can get the correct data, usually with a 8 -word calibration method.

8- Word calibration requires the user to do 8-word shaking in the air using a device that needs to be calibrated ,

In principle, as much as possible, the device normal direction points to all 8 quadrants of space.

The electronic compass chip used in the mobile phone has the AKM Company's 897X series,ST Company's LSM Series as well as Yamaha Inc. and so on.

Because of the need to read g-sensor data and calculate m-sensor and o-sensor data,

So vendors will generally provide a background daemon to complete the work, electronic compass algorithm is generally the company's private property rights.

4 Gyro Sensor

The gyroscope sensor is called gyro-sensorand returns The angular acceleration data for the X, Y, andz axes.

The unit of angular acceleration is radians/second.

Measured by Nexus S Mobile:

Rotate horizontally counterclockwise and theZ axis is positive.

The horizontal counterclockwise rotation, thez axis is negative.

Rotate to the left and negative on they axis.

Rotates to the right and they -axis is positive.

Rotate up and thex axis is negative.

Rotate downward and thex axis is positive.

ST 's l3g series of gyroscope sensors are more popular,iphone4 and Google 's Nexus S used in this type of sensor.

5 Light Sensing sensor

The light sensor detects real-time light intensity, the unit of light is Lux, and its physical meaning is luminous flux on the unit area.

The light sensor is mainly used for the LCD Auto-brightness function of Android system .

The brightness of the LCD can be adjusted in real time according to the light intensity sampled.

6 pressure sensor

The pressure sensor returns the current pressure in the unit of hectopascal(hPa).

7 temperature Sensor

The temperature sensor returns the current temperature.

8 Proximity Sensor

The proximity sensor detects the distance between the object and the phone, in centimeters.

Some proximity sensors can only return far and near two states,

Therefore, the proximity sensor returns the maximum distance to the far state, which is less than the maximum distance to return to the near state.

Proximity sensors can be used to automatically turn off the LCD screen when answering a phone to conserve power.

Some chips have integrated proximity sensors and light sensors for both functions.

The following three sensors are the new sensor types proposed by ANDROID2, and it is not yet clear which applications are available.

9 Gravity sensor

The gravity sensor is referred to as gv-sensor and outputs gravity data.

On Earth, the value of gravity is 9.8, and the unit is m/s^2.

The coordinate system is the same as the accelerometer sensor.

When the device is reset, the output of the gravity sensor is the same as the accelerometer sensor.

Linear acceleration Sensor

Linear accelerometer is referred to as la-sensor.

The linear accelerometer is the data obtained by the acceleration sensor minus the gravity effect.

The unit is m/s^2andThe coordinate system is the same as the accelerometer sensor.

The formula for acceleration sensors, gravity sensors and linear accelerometer is as follows:

Acceleration = Gravity + linear acceleration

One- turn vector sensor

Rotary vector sensor for short rv-sensor.

The rotation vector represents the direction of the device, which is a mix of axes and angles to calculate the data.

Rv-sensor output of three data:

X*sin (THETA/2)

Y*sin (THETA/2)

Z*sin (THETA/2)

Sin (THETA/2) is an order of magnitude for RV.

The RV is in the same direction as the axis rotation.

the three values of the RV, together with the cos (THETA/2) , constitute a four-tuple.

RV Data has no units, and the coordinate system used is the same as acceleration.

Example:

View Source

Print?

1

Sensors_event_t.data[0] = X*sin (THETA/2)

2

SENSORS_EVENT_T.DATA[1] = Y*sin (THETA/2)

3

SENSORS_EVENT_T.DATA[2] = Z*sin (THETA/2)

4

SENSORS_EVENT_T.DATA[3] = cos (THETA/2)

The values for GV,LA , and RV are not available in the physical sensor directly,

g-sensor,o-sensor , and gyro-sensor are required to be calculated by the algorithm.

The algorithm is usually the private property of the sensor company.

Android OS 11 sensor introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.