Collapse the table of content
Expand the table of content

Windows.Devices.Sensors namespace

Provides access to the supported types of sensors and related motion data.


The Windows.Devices.Sensors namespace has these types of members:


Accelerometer Represents an accelerometer sensor.
AccelerometerReading Represents an accelerometer reading.
AccelerometerReadingChangedEventArgs Provides data for the accelerometer readingchanged event.
AccelerometerShakenEventArgs Provides data for the accelerometer-shaken event.
ActivitySensor Represents an activity sensor that provides the activity and status of a sensor.
ActivitySensorReading Represents the reading of an activity sensor that provides readings for the sensor.
ActivitySensorReadingChangedEventArgs Represents data for the reading–changed event of the sensor.
ActivitySensorReadingChangeReport Represents data for the sensor trigger.
ActivitySensorTriggerDetails Represents details about the sensor triggering.
Altimeter Provides an interface for an altimetric sensor to measure the relative altitude.
AltimeterReading Represents an altimeter reading.
AltimeterReadingChangedEventArgs Provides data for the altimeter readingchanged event.
Barometer Provides an interface for a barometric sensor to measure atmospheric pressure.
BarometerReading Represents a barometer reading.
BarometerReadingChangedEventArgs Provides data for the barometer readingchanged event.
Compass Represents a compass sensor.
CompassReading Represents a compass reading.
CompassReadingChangedEventArgs Provides data for the compass readingchanged event.
Gyrometer Represents a gyrometer sensor.
GyrometerReading Represents a gyrometer reading.
GyrometerReadingChangedEventArgs Provides data for the gyrometer readingchanged event.
Inclinometer Represents an inclinometer sensor.
InclinometerReading Represents an inclinometer reading.
InclinometerReadingChangedEventArgs Provides data for the inclinometer readingchanged event.
LightSensor Represents an ambient-light sensor.
LightSensorReading Represents an ambient lightsensor reading.
LightSensorReadingChangedEventArgs Provides data for the ambient-light sensor reading-changed event.
Magnetometer Represents a magnetic sensor.
MagnetometerReading Represents a magnetometer reading.
MagnetometerReadingChangedEventArgs Provides data for the magnetometer readingchanged event.
OrientationSensor Represents an orientation sensor.
OrientationSensorReading Represents an orientation-sensor reading.
OrientationSensorReadingChangedEventArgs Provides data for the orientation-sensor reading-changed event.
Pedometer Provides an interface for a pedometer to measure the number of steps taken.
PedometerDataThreshold A threshold for the Pedometer sensor. When the threshold conditions are met, the sensor trigger will activate.
PedometerReading Represents a pedometer reading.
PedometerReadingChangedEventArgs Provides data for the pedometer readingchanged event.
ProximitySensor Provides an interface for a proximity sensor to determine whether or not an object is detected.
ProximitySensorDataThreshold A threshold for the ProximitySensor. When the threshold conditions are met, the sensor trigger will activate.
ProximitySensorDisplayOnOffController Provides a controller responsible for turning on or off the phone display based on the readings from the ProximitySensor.
ProximitySensorReading Represents a reading from the proximity sensor.
ProximitySensorReadingChangedEventArgs Provides data for the readingchanged event of the proximity sensor.
SensorDataThresholdTriggerDetails Provides data for what sensor triggered the data threshold monitoring task.
SensorQuaternion Represents a Quaternion.
SensorRotationMatrix Represents a 3x3 rotation matrix.
SimpleOrientationSensor Represents a simple orientation sensor.
SimpleOrientationSensorOrientationChangedEventArgs Provides data for the sensor reading–changed event.



The Windows.Devices.Sensors namespace has these enumerations.

AccelerometerReadingType Indicates the type of accelerometer.
ActivitySensorReadingConfidence Specifies the confidence of a sensor reading.
ActivityType Specifies activity types of a sensor.
MagnetometerAccuracy The sensor's accuracy.
PedometerStepKind The type of step taken according to the pedometer.
SensorOptimizationGoal Indicates whether power or precision should be optimized for sensors.
SensorReadingType Specifies the sensor reading type.
SensorType Indicates the type of sensor.
SimpleOrientation Indicates the orientation of the device.



The Windows.Devices.Sensors namespace defines these interfaces.

ISensorDataThreshold Identifies a threshold for sensor data. When this threshold is crossed, the sensor trigger will activate.



This namespace provides access to the sensor types listed in the table below. The driver for a sensor must indicate that the hardware is integrated with the PC chassis for it to be accessible via this namespace. Sensors not marked as PC-integrated, even if they are of a supported type, will not be accessible. Driver developers can refer to SensorConnectionType enumeration for more details.

AccelerometerDetects acceleration along three axes (x, y, and z).
InclinometerDetects angle of incline along three axes (pitch, roll, and yaw).
GyrometerDetects angular velocity along three axes.
CompassDetects heading in degrees relative to magnetic north (and due north when integrated with onboard GPS).
LightDetects ambient lighting level in lumens.
OrientationCombines the data from the accelerometer, compass, and gyrometer sensors to provide smoother and more sensitive rotation data than can be obtained from any of the sensors alone. See the Quaternion and SensorRotationMatrix definitions. This combined sensor data is also known as “Sensor Fusion.”
Simple OrientationUses the accelerometer to obtain device orientation as a rotation into one of four quadrants, or face-up, or face-down.


In addition, this namespace provides access to the following motion (or movement) data.

QuaternionA Quaternion is a rotation of a point [x,y,z] around an arbitrary axis.
Rotation MatrixA Rotation Matrix represents a rotation around 3 axes (x, y, and z).


Sensor data is provided relative to the device's fixed sensor coordinate system, and is independent of display orientation. For applications that rely on sensor data for input control or to manipulate elements on the screen, the developer must take current display orientation into account and compensate the data appropriately. For more info about the sensor coordinate system, see Sensor data and display orientation.

For some samples that demonstrate using various sensors, see Windows Sensor Samples.

See also

Sensor data and display orientation
Windows Sensor Samples
Background sensors sample (Windows 10)
Compass sample (Windows 10)
Inclinometer sample (Windows 10)
Gyrometer sample (Windows 10)
Light sensor sample (Windows 10)
Orientation sensor sample (Windows 10)
Accelerometer sample (Windows 10)



© 2017 Microsoft