On/Off Body Detection
On/off body detection is about detecting whether a device is worn on the human body or not. This function can be implemented with Sensirion’s humidity sensors and offers various new use cases.

The propagation of smart features like noise cancelling, wireless connectivity and fitness tracking functions into headphones and other wearables alike is a hot topic in the industry. The information if a headphone is taken off while connected, allows the smartphone to pause the music and put on a loud ringtone rather than just ringing via headphones. Furthermore it enables smart battery management according to the user’s individual needs. Besides headphones, the on/off body detection feature is also applicable for other battery-driven devices like VR goggles, smart watches, fitness trackers or wearable medical devices.
Advantages of Using a Humidity Sensor for On/Off Body Detection
- Suitable for all form factors
- Contactless measurement
- Very reliable (can distinguish between human presence and object presence)
- Off the shelf product
- Cost efficient
- Low power consumption
- Provide environmental data
Recommended sensor: Humidity sensor SHTW2
On/Off Body Detection - Implementation
Working Principle

- Measurement of environmental humidity and temperature conditions
- Determination of human presence via environmental changes caused by the human body
- Signal processing and feature extraction techniques to detect state changes
Implementation Concept

- Skin aware and ambient aware sensor integration
- Sensirion headphone example demonstrating potential sensor integration
On/Off Body Algorithm
The humidity and temperature sensor measures the environmental conditions in its vicinity. Any object with a different temperature or humidity (e.g., due to perspiration), which gets close to the sensor influences the values measured. With a device integrating a humidity and temperature sensor in a way that it is close to the human skin when worn can detect these variations and process them to deduce whether the device is on body or off body.
This is visualized below on a real world data set. The solid red curve describes the humidity signal measured by a Sensiron SHTW2 humidity sensor integrated in an in-ear headphone (as depicted above). When the headphone is worn, the humidity signal increases compared to the ambient humidity conditions visualized with the solid blue line below. With signal processing and feature recognition algorithms, we can create a reliable binary signal depicting whether the device is on body or off body (green line below).

Algorithm Description
This is a high level description explaining the fundamentals of an easy to understand on/off body detection algorithm. Please refer to the source code for a more precise version of the algorithm. To further improve your product in various environmental conditions you can refer to other feature detection techniques, as described further down in this tutorial.
Algorithm:
This is a simple threshold detection algorithm, as used in many other applications. The transpiration is computed for every subsequently read output of the ambient and the skin sensor and stored in an array of fixed length. To detect a state change from on body to off body or vice versa, a gradient threshold determination is used:
For relative humidity and temperature values measured at times T1 and T2, we compute the transpiration TRANS_T1 and TRANS_T2 and detect a state change as follows:
Formula to Calculate Transpiration

Corresponding signal plot

Transpiration at time T1: TRANS_T1 Transpiration at time T2: TRANS_T2 (T2 > T1) if currentState == onBody { if TRANS_T2 - TRANS_T1 < -THRESHOLD currentState = offBody } else { if TRANS_T2 - TRANS_T1 > THRESHOLD currentState = onBody } return currentState
Learn more about perspiration rate measurements, physics and use cases here.
Patent Information
Aspects of this application are protected by Sensirion patent(s) US 2016162256 A1 (pending), EP 2851001 A2 (pending), CN 105677012 A (pending) and/or other patents pending. For commercial licenses, please contact Sensirion AG.
For the sake of clarity, no rights are granted for uses without a Sensirion sensor. Neither the grant of a license under the patent(s) mentioned nor any other information or recommendation presented on this website do absolve you from the obligation of investigating the possibility of infringement of third parties’ rights and, if necessary, clarifying the position.