Battery-powered occupancy sensors are becoming increasingly common in smart buildings, meeting rooms, public transportation, and security systems. While traditional camera-based solutions can provide accurate people counting, they introduce privacy concerns, require significant processing power making battery powered applications difficult and often perform poorly in low-light environments.
Far infrared (FIR) thermal sensors offer a different approach. Instead of capturing images, they measure the thermal radiation emitted by people and surrounding objects. This makes them inherently privacy friendly while maintaining reliable operation in complete darkness.

The Melexis MLX90642 is a 32 × 24 pixel thermal infrared array that combines high thermal sensitivity with a compact footprint, making it well suited for physically compact and accurate occupancy sensors. When paired with the Melexis People Detection Library, the sensor can detect human presence, estimate the number of occupants, and provide location information without requiring machine learning training or cloud connectivity. The library performs background modelling, foreground extraction, blob tracking and counting using optimized algorithms designed for resource-constrained embedded systems. It supports a wide range of 32-bit microcontrollers and requires only modest Flash and RAM resources.
The embedded software itself has also been designed with low-power systems in mind. The simplified algorithm can execute in approximately 1 to 2 ms per frame on a Cortex-M4 running at 180 MHz while requiring only around 14 KB RAM. Even full tracking mode requires approximately 40 KB RAM and remains suitable for many mainstream microcontrollers. Fixed-point arithmetic eliminates the need for floating-point hardware, further reducing system cost and power consumption.

One of the key advantages of thermal sensing is that detection does not depend on visible movement. Since the algorithm analyses temperature differences instead of visual features, occupants can still be detected while sitting still. The system also remains unaffected by changing lighting conditions, shadows, or complete darkness, making it suitable for applications such as offices, elevators, corridors, and smart home automation.

Four subjects in an elevator (90° mounting)
As a result, useful thermal images become available significantly earlier than when full stabilization is reached. This enables an efficient duty-cycling strategy where the sensor is periodically powered on, captures the required thermal frames for occupancy analysis, and is then powered down again. A new application note from Melexis examines how different ON/OFF intervals affect both image quality and average power consumption, allowing designers to optimize battery life without compromising counting performance.


For access to the People Counting Library and the application note describing active/sleep operation of FIR sensors, please click below and get in touch!
Type "MELEXIS" in the message field to inquire about the People Counting Library.
