Windows.Devices.Sensors Windows.Devices.Sensors Windows.Devices.Sensors Windows.Devices.Sensors Windows.Devices.Sensors Namespace

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


Accelerometer Accelerometer Accelerometer Accelerometer Accelerometer

Represents an accelerometer sensor.

This sensor returns G-force values with respect to the x, y, and z axes.

For an example implementation, see the accelerometer sample.

AccelerometerReading AccelerometerReading AccelerometerReading AccelerometerReading AccelerometerReading

Represents an accelerometer reading.

AccelerometerReadingChangedEventArgs AccelerometerReadingChangedEventArgs AccelerometerReadingChangedEventArgs AccelerometerReadingChangedEventArgs AccelerometerReadingChangedEventArgs

Provides data for the accelerometer reading– changed event.

AccelerometerShakenEventArgs AccelerometerShakenEventArgs AccelerometerShakenEventArgs AccelerometerShakenEventArgs AccelerometerShakenEventArgs

Provides data for the accelerometer-shaken event.

ActivitySensor ActivitySensor ActivitySensor ActivitySensor ActivitySensor

Represents an activity sensor that provides the activity and status of a sensor.

For an example implementation, see the activity sensor sample.

ActivitySensorReading ActivitySensorReading ActivitySensorReading ActivitySensorReading ActivitySensorReading

Represents the reading of an activity sensor that provides readings for the sensor.

ActivitySensorReadingChangedEventArgs ActivitySensorReadingChangedEventArgs ActivitySensorReadingChangedEventArgs ActivitySensorReadingChangedEventArgs ActivitySensorReadingChangedEventArgs

Represents data for the reading–changed event of the sensor.

ActivitySensorReadingChangeReport ActivitySensorReadingChangeReport ActivitySensorReadingChangeReport ActivitySensorReadingChangeReport ActivitySensorReadingChangeReport

Represents data for the sensor trigger.

ActivitySensorTriggerDetails ActivitySensorTriggerDetails ActivitySensorTriggerDetails ActivitySensorTriggerDetails ActivitySensorTriggerDetails

Represents details about the sensor triggering.

Altimeter Altimeter Altimeter Altimeter Altimeter

Provides an interface for an altimetric sensor to measure the relative altitude.

For an example implementation, see the altimeter sample.

AltimeterReading AltimeterReading AltimeterReading AltimeterReading AltimeterReading

Represents an altimeter reading.

AltimeterReadingChangedEventArgs AltimeterReadingChangedEventArgs AltimeterReadingChangedEventArgs AltimeterReadingChangedEventArgs AltimeterReadingChangedEventArgs

Provides data for the altimeter reading– changed event.

Barometer Barometer Barometer Barometer Barometer

Provides an interface for a barometric sensor to measure atmospheric pressure.

For an example implementation, see the barometer sample.

BarometerReading BarometerReading BarometerReading BarometerReading BarometerReading

Represents a barometer reading.

BarometerReadingChangedEventArgs BarometerReadingChangedEventArgs BarometerReadingChangedEventArgs BarometerReadingChangedEventArgs BarometerReadingChangedEventArgs

Provides data for the barometer reading– changed event.

Compass Compass Compass Compass Compass

Represents a compass sensor.

This sensor returns a heading with respect to Magnetic North and, possibly, True North. (The latter is dependent on the system capabilities.)

For an example implementation, see the compass sample.

CompassReading CompassReading CompassReading CompassReading CompassReading

Represents a compass reading.

CompassReadingChangedEventArgs CompassReadingChangedEventArgs CompassReadingChangedEventArgs CompassReadingChangedEventArgs CompassReadingChangedEventArgs

Provides data for the compass reading– changed event.

Gyrometer Gyrometer Gyrometer Gyrometer Gyrometer

Represents a gyrometer sensor.

This sensor returns angular velocity values with respect to the x, y, and z axes.

For an example implementation, see the gyrometer sample.

GyrometerReading GyrometerReading GyrometerReading GyrometerReading GyrometerReading

Represents a gyrometer reading.

GyrometerReadingChangedEventArgs GyrometerReadingChangedEventArgs GyrometerReadingChangedEventArgs GyrometerReadingChangedEventArgs GyrometerReadingChangedEventArgs

Provides data for the gyrometer reading– changed event.

Inclinometer Inclinometer Inclinometer Inclinometer Inclinometer

Represents an inclinometer sensor.

This sensor returns pitch, roll, and yaw values that correspond to rotation angles around the x, y, and z axes, respectively.

For an example implementation, see the inclinometer sample

InclinometerReading InclinometerReading InclinometerReading InclinometerReading InclinometerReading

Represents an inclinometer reading.

InclinometerReadingChangedEventArgs InclinometerReadingChangedEventArgs InclinometerReadingChangedEventArgs InclinometerReadingChangedEventArgs InclinometerReadingChangedEventArgs

Provides data for the inclinometer reading– changed event.

LightSensor LightSensor LightSensor LightSensor LightSensor

Represents an ambient-light sensor.

This sensor returns the ambient-light reading as a LUX value.

For an example implementation, see the light sensor sample.

LightSensorReading LightSensorReading LightSensorReading LightSensorReading LightSensorReading

Represents an ambient light–sensor reading.

LightSensorReadingChangedEventArgs LightSensorReadingChangedEventArgs LightSensorReadingChangedEventArgs LightSensorReadingChangedEventArgs LightSensorReadingChangedEventArgs

Provides data for the ambient-light sensor reading-changed event.

Magnetometer Magnetometer Magnetometer Magnetometer Magnetometer

Represents a magnetic sensor.

MagnetometerReading MagnetometerReading MagnetometerReading MagnetometerReading MagnetometerReading

Represents a magnetometer reading.

MagnetometerReadingChangedEventArgs MagnetometerReadingChangedEventArgs MagnetometerReadingChangedEventArgs MagnetometerReadingChangedEventArgs MagnetometerReadingChangedEventArgs

Provides data for the magnetometer reading– changed event.

OrientationSensor OrientationSensor OrientationSensor OrientationSensor OrientationSensor

Represents an orientation sensor.

This sensor returns a rotation matrix and a Quaternion that can be used to adjust the user's perspective in a game application.

For an example implementation, see the orientation sensor sample.

OrientationSensorReading OrientationSensorReading OrientationSensorReading OrientationSensorReading OrientationSensorReading

Represents an orientation-sensor reading.

OrientationSensorReadingChangedEventArgs OrientationSensorReadingChangedEventArgs OrientationSensorReadingChangedEventArgs OrientationSensorReadingChangedEventArgs OrientationSensorReadingChangedEventArgs

Provides data for the orientation-sensor reading-changed event.

Pedometer Pedometer Pedometer Pedometer Pedometer

Provides an interface for a pedometer to measure the number of steps taken.

For an example implemenation, see the pedometer sample.

PedometerDataThreshold PedometerDataThreshold PedometerDataThreshold PedometerDataThreshold PedometerDataThreshold

A threshold for the Pedometer sensor. When the threshold conditions are met, the sensor trigger will activate.

PedometerReading PedometerReading PedometerReading PedometerReading PedometerReading

Represents a pedometer reading.

PedometerReadingChangedEventArgs PedometerReadingChangedEventArgs PedometerReadingChangedEventArgs PedometerReadingChangedEventArgs PedometerReadingChangedEventArgs

Provides data for the pedometer reading– changed event.

ProximitySensor ProximitySensor ProximitySensor ProximitySensor ProximitySensor

Provides an interface for a proximity sensor to determine whether or not an object is detected.

For an example implementation, see the proximity sensor sample.

ProximitySensorDataThreshold ProximitySensorDataThreshold ProximitySensorDataThreshold ProximitySensorDataThreshold ProximitySensorDataThreshold

A threshold for the ProximitySensor. When the threshold conditions are met, the sensor trigger will activate.

ProximitySensorDisplayOnOffController ProximitySensorDisplayOnOffController ProximitySensorDisplayOnOffController ProximitySensorDisplayOnOffController ProximitySensorDisplayOnOffController

Provides a controller responsible for turning on or off the phone display based on the readings from the ProximitySensor.

ProximitySensorReading ProximitySensorReading ProximitySensorReading ProximitySensorReading ProximitySensorReading

Represents a reading from the proximity sensor.

ProximitySensorReadingChangedEventArgs ProximitySensorReadingChangedEventArgs ProximitySensorReadingChangedEventArgs ProximitySensorReadingChangedEventArgs ProximitySensorReadingChangedEventArgs

Provides data for the reading– changed event of the proximity sensor.

SensorDataThresholdTriggerDetails SensorDataThresholdTriggerDetails SensorDataThresholdTriggerDetails SensorDataThresholdTriggerDetails SensorDataThresholdTriggerDetails

Provides data for what sensor triggered the data threshold monitoring task.

SensorQuaternion SensorQuaternion SensorQuaternion SensorQuaternion SensorQuaternion

Represents a Quaternion.

SensorRotationMatrix SensorRotationMatrix SensorRotationMatrix SensorRotationMatrix SensorRotationMatrix

Represents a 3x3 rotation matrix.

SimpleOrientationSensor SimpleOrientationSensor SimpleOrientationSensor SimpleOrientationSensor SimpleOrientationSensor

Represents a simple orientation sensor.

For an example implementation, see the simple orientation sensor sample.

This sensor detects the current quadrant orientation of the specified device as well as its face-up or face-down status.

SimpleOrientationSensorOrientationChangedEventArgs SimpleOrientationSensorOrientationChangedEventArgs SimpleOrientationSensorOrientationChangedEventArgs SimpleOrientationSensorOrientationChangedEventArgs SimpleOrientationSensorOrientationChangedEventArgs

Provides data for the sensor reading–changed event.


ISensorDataThreshold ISensorDataThreshold ISensorDataThreshold ISensorDataThreshold ISensorDataThreshold

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


AccelerometerReadingType AccelerometerReadingType AccelerometerReadingType AccelerometerReadingType AccelerometerReadingType

Indicates the type of accelerometer.

ActivitySensorReadingConfidence ActivitySensorReadingConfidence ActivitySensorReadingConfidence ActivitySensorReadingConfidence ActivitySensorReadingConfidence

Specifies the confidence of a sensor reading.

ActivityType ActivityType ActivityType ActivityType ActivityType

Specifies activity types of a sensor.

MagnetometerAccuracy MagnetometerAccuracy MagnetometerAccuracy MagnetometerAccuracy MagnetometerAccuracy

The sensor's accuracy.

This short video gives an overview of how to calibrate the magnetometer's accuracy.

PedometerStepKind PedometerStepKind PedometerStepKind PedometerStepKind PedometerStepKind

The type of step taken according to the pedometer.

SensorOptimizationGoal SensorOptimizationGoal SensorOptimizationGoal SensorOptimizationGoal SensorOptimizationGoal

Indicates whether power or precision should be optimized for sensors.

SensorReadingType SensorReadingType SensorReadingType SensorReadingType SensorReadingType

Specifies the sensor reading type.

SensorType SensorType SensorType SensorType SensorType

Indicates the type of sensor.

SimpleOrientation SimpleOrientation SimpleOrientation SimpleOrientation SimpleOrientation

Indicates the orientation of the device.


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 @Windows.Devices.Sensors.SensorQuaternion?text=Quaternion and @Windows.Devices.Sensors.SensorRotationMatrix?text=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