A Novel Approach to Occupancy Detection
2025-10-01 | By Nate_Larson
License: See Original Project Proximity Time-of-Flight (ToF)
As we work towards making our devices and spaces “smart” for convenience, security, and energy savings, the primary focus has been on occupancy detection. Obviously, we don’t need to expend energy for lighting and maintaining comfort settings if nobody is present, so there are real cost savings to be had by implementing a properly functioning system. There are many different approaches to occupancy detection, all of which have their caveats, so we must make thoughtful decisions when selecting our approach for an application. This is why it is always interesting when a new approach to occupancy detection is realized, and that is what Elosoft has done with their Occupancy Counter Sensor.
Occupancy Detection: You have options!
While there are many different ways to implement occupancy detection, they all have their strengths and weaknesses, so it’s important to always evaluate your particular situation and choose the best option for your unique scenario. Below are some of the traditional occupancy detection methods, along with key takeaways for each.
PIR
What it is:
Passive infrared sensors detect changes in long-wave IR (body heat) across a field of view.
Pros:
Low cost
Low power
Simple to integrate
Cons:
Detects motion rather than presence, so false negatives are common when occupants are static
Limited line-of-sight coverage
Requires thermal differential between targets and ambient
Learn more:
Passive Infrared Sensors product training module
mmWave
What it is:
Millimeter-wave sensors use active RF radar to measure micro-motion, range, angle, and sometimes velocity.
Pros:
Can detect micro-motions, such as breathing
Works in darkness or through many non-metallic materials
Strong privacy compared to cameras
Cons:
May require careful calibration
Antenna orientation and placement impact performance
Vulnerable to false triggers due to air movement, such as fans and AC
Learn more:
Functional Test Report of DFRobot C1001 mmWave Sensor
Computer Vision
What it is:
Video or CCTV cameras combined with on-device or server-based AI models for identifying the presence of people.
Pros:
Can provide detailed presence information, such as headcounts and directional movement
Allows easy creation of zones within the field of view
Custom-trained models can be implemented for improved accuracy or to identify specific traits or individuals
Cons:
Privacy concerns
High bandwidth/power requirements
Vulnerable to poor lighting conditions
Learn more:
Understanding computer and machine vision
Thermal Vision
What it is:
IR thermopile arrays or thermal cameras that map heat signatures.
Pros:
Better privacy than RGB cameras
Works in all lighting conditions
Custom-trained models can be implemented for improved accuracy or person counting
Cons:
Lower resolution makes counting more difficult
Susceptible to temperature conditions
Line of sight only
Learn more:
Thermopile Arrays VS Lepton Micro Thermal Camera Module | Thermal Integration Made Easy
CO2 Sensing
What it is:
Measures carbon dioxide levels as an indirect indicator of occupancy.
Pros:
Excellent for long-term ventilation control
Immune to lighting and thermal conditions
Data can be applied to HVAC performance monitoring
Cons:
Slower response time than other methods (minutes vs. seconds)
Highly influenced by ventilation or open windows
Unable to provide real-time individual counts
Learn more:
How to Use Smart Air Quality Sensors for Environmental Monitoring
Wi-Fi / Bluetooth Analytics
What it is:
Detects mobile devices or RF changes.
Pros:
May be able to use existing network infrastructure
Scales easily to large areas
Good for analyzing trends and space utilization
Cons:
Accuracy depends on user devices and behavior
MAC randomization/privacy features reduce reliability
Low accuracy through location and headcount estimates
Learn more:
A new approach to occupancy detection!
Elosoft’s HPC-LV occupancy counter sensor takes a different approach. The sensor simplifies the logic for the user by handling all the complex onboard logic and providing a straightforward output indicating whether the room is occupied or not. It does this by utilizing two onboard laser time-of-flight sensors to track passing persons and keep count of the room’s occupancy.
As with any occupancy detection method, there are details to take into account when using this sensor. First, this sensor is designed for a room with a single point of entry/exit, as it needs to count each individual entering and leaving the space to ensure an accurate count is maintained. Second, the orientation of the sensor is paramount, as it has a predefined direction of travel to know how many people are entering the room versus leaving. Luckily, the sensor has an onboard LED that flashes to indicate the number of occupants detected in the room, which helps ensure mounting accuracy.
It is worth noting that, when the sensor is first powered on, it takes approximately 8 seconds to self-calibrate, so during this time, the field of view of the sensor should be kept clear of occupants or obstructions. Additionally, the sensor has a sensing range of approximately 1 meter, and it must be able to “see” the opposite side of the doorway or hallway in which it is mounted for it to track occupancy status correctly.
A simple demonstration
To demonstrate the effectiveness of this sensor, I put together a simple proof-of-concept demo using only the sensor and an Arduino Uno R4 WiFi. While this is just a basic build, it provides the groundwork to fully implement the sensor through MQTT, ESPHome, direct connection to a lighting controller, or a solid-state relay with an activation current of no more than 15mA.
This simple code displays a happy face on the LED matrix when the sensor detects occupancy, or a sad face when the room is vacant. In practice, you would not need to utilize both the NC and NO contacts – this was done simply to demonstrate that both pins toggle together when the state changes.
Wiring
The senor is designed to operate on 5-12V DC, making it easy to power from the Arduino board. Below are the connections:
HPC-LV sensor → Arduino Uno R4 WiFi
Code
#include "Arduino_LED_Matrix.h" // Include the LED_Matrix library ArduinoLEDMatrix matrix; // Create an instance of the ArduinoLEDMatrix class //Pin defines #define NCPIN 2 #define NOPIN 3 int val; void setup() { // put your setup code here, to run once: pinMode(NCPIN, INPUT_PULLUP); pinMode(NOPIN, INPUT_PULLUP); Serial.begin(115200); while (!Serial && (millis() < 5000)); // wait up to 5 seconds while serial initializes. matrix.begin(); // Initialize the LED matrix while (millis() < 8000); // allow sensor 8 seconds after powerup to initialize and self-calibrate } void loop() { // put your main code here, to run repeatedly: if(digitalRead(NCPIN) == LOW){ digitalWrite(LED_BUILTIN, LOW); val = 0; matrix.loadFrame(LEDMATRIX_EMOJI_SAD); } else if (digitalRead(NOPIN) == LOW) { digitalWrite(LED_BUILTIN, HIGH); val = 1; matrix.loadFrame(LEDMATRIX_EMOJI_HAPPY); } //Serial.println(val); }
Conclusion
The folks at Elosoft have taken a unique approach to occupancy detection, with a smart, privacy-friendly sensor that takes care of the logic and calibration, allowing for a simple interface for integration into virtually any smart home/office system. While care should be taken when mounting the sensor, once mounted in an acceptable manner, the electrical implementation of the sensor is quite simple.
Elosoft provided the STL file for the snap-together case displayed in this project. Although intended for resin printing, I was able to print it on my FDM printer, and it worked fine, making for a clean, easy mounting option for the sensor.