1# Sensor Overview 2 3## Sensor Types 4 5 6Sensors are an abstraction of underlying sensor hardware. Your application can access the underlying sensor hardware via [Sensor](../../reference/apis-sensor-service-kit/js-apis-sensor-sys.md) APIs. Using these APIs, you can query sensors on your device and subscribe to sensor data. Based on the sensor data obtained, you can customize algorithms and develop various sensor-based applications, such as compass, motion-controlled games, and fitness and health applications. 7 8| Sensor Types | Name | Description | Usage | 9| --------------------------- | ------------------ | ------------------------------------------------------------ | ---------------------------------------- | 10| ACCELEROMETER | Acceleration sensor | Measures the acceleration (including the gravity acceleration) applied to a device on three physical axes (X, Y, and Z), in the unit of m/s<sup>2</sup>.| Measures the acceleration of device motion. | 11| GYROSCOPE | Gyroscope sensor | Measures the rotation angular velocity of a device on three physical axes (X, Y, and Z), in the unit of rad/s.| Measuring the rotation angular velocity | 12| ORIENTATION | Orientation sensor | Measures the orientation angle of the screen around three physical axes (z, x , and y), in rad.| Measuring the three orientation angles of the screen | 13 14 15## Working Principles 16 17The following modules work cooperatively to implement sensors: Sensor API, Sensor Framework, Sensor Service, and HDF layer. 18 19 **Figure 1** How the sensor works 20 21 22 231. Sensor API: provides APIs for performing basic operations on sensors, including querying the sensor list, subscribing to or unsubscribing from sensor data, and executing control commands. This module makes application development simpler. 24 252. Sensor Framework: manages sensor data subscription, creates and destroys data channels, subscribes to or unsubscribes from sensor data, and implements communication with the Sensor Service module. 26 273. Sensor Service: interacts with the HD_IDL module to receive, parse, and distribute data, manages foreground and background policies and sensors of a device, and controls sensor permissions. 28 294. HDF layer: selects proper policies based on the hardware first in first out (FIFO) and frequency, and adapts to different devices. 30 31 32## Constraints 33 341. To obtain data of the following sensors, you must request the required permissions. 35 36 | Sensor | Permission | Sensitivity | Permission Description | 37 | -------------------------------------------------- | -------------------------------- | ------------ | ------------------------------------------------------------ | 38 | Acceleration sensor, uncalibrated acceleration sensor, and linear acceleration sensor| ohos.permission.ACCELEROMETER | system_grant | The permission allows an application to read data from acceleration sensors, uncalibrated acceleration sensors, and linear acceleration sensors.| 39 | Gyroscope sensor and uncalibrated gyroscope sensor | ohos.permission.GYROSCOPE | system_grant | The permission allows an application to read data from gyroscope sensors and uncalibrated gyroscope sensors.| 40 412. The APIs for subscribing to and unsubscribing from sensor data work in pairs. If you do not need sensor data, call the unsubscription API to stop sensor data reporting. 42