Optimizing room occupancy estimation on the edge: A TinyML and sensor network approach

• TinyML-based system achieves real-time room occupancy estimation on the ESP32. • Combines environmental sensing with edge-based machine learning for smart buildings. • Random Forest model outperforms others with R² = 0.923 and MAE = 0.217. • Low latency (997 µs) and minimal storage (1.426 MB) ensure edge deployment feasibility. • Offers a low-cost, privacy-conscious alternative for occupancy detection. This research study has developed a new method of determining room occupancy in real time using TinyML (Machine Learning) and an ESP32 Microcontroller to create more efficient smart buildings that consume less energy. It consists of collecting environmental data from non-intrusive sensors, including CO₂ concentration, temperature, humidity, light intensity, and human presence. Machine Learning models provide support in predicting occupancy levels with sufficient accuracy based on the collected environmental data. From the tested machine learning models (Linear Regression, K-Nearest Neighbors, Decision Tree, Gradient Boosting, Random Forest, XGBoost), Random Forest model outperformed all others with the lowest Mean Absolute Error (MAE = 0.217), Mean Square Error (MSE = 0.115), and highest R² score (0.923) when measured against testing datasets. The occupancy predictive model has a very low inference latency (997 μs) and a small amount of memory stamps to conserve resources, using only 1.426 MB storage and 1.175 MB memory when deployed in an ESP32. These results validate the ESP32’s capability for accurate, low-latency, edge-based occupancy estimation, providing a low-cost, energy-efficient solution for enhancing real-time automation in smart building environments.

Authors

Institutions

Publication Details

Journal
Results in Engineering
Published
2026-01-14
DOI
https://doi.org/10.1016/j.rineng.2026.109107
Primary Topic
Building Energy and Comfort Optimization
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Optimizing room occupancy estimation on the edge: A TinyML and sensor network approach

Pushkar Sharma, Ayush Sinha, Mehal Pandkar, Shashank Nambiar
Results in Engineering
Building Energy and Comfort Optimization
article

Optimizing room occupancy estimation on the edge: A TinyML and sensor network approach

Pushkar Sharma, Ayush Sinha, Mehal Pandkar, Shashank Nambiar
article en

Abstract

• TinyML-based system achieves real-time room occupancy estimation on the ESP32. • Combines environmental sensing with edge-based machine learning for smart buildings. • Random Forest model outperforms others with R² = 0.923 and MAE = 0.217. • Low latency (997 µs) and minimal storage (1.426 MB) ensure edge deployment feasibility. • Offers a low-cost, privacy-conscious alternative for occupancy detection. This research study has developed a new method of determining room occupancy in real time using TinyML (Machine Learning) and an ESP32 Microcontroller to create more efficient smart buildings that consume less energy. It consists of collecting environmental data from non-intrusive sensors, including CO₂ concentration, temperature, humidity, light intensity, and human presence. Machine Learning models provide support in predicting occupancy levels with sufficient accuracy based on the collected environmental data. From the tested machine learning models (Linear Regression, K-Nearest Neighbors, Decision Tree, Gradient Boosting, Random Forest, XGBoost), Random Forest model outperformed all others with the lowest Mean Absolute Error (MAE = 0.217), Mean Square Error (MSE = 0.115), and highest R² score (0.923) when measured against testing datasets. The occupancy predictive model has a very low inference latency (997 μs) and a small amount of memory stamps to conserve resources, using only 1.426 MB storage and 1.175 MB memory when deployed in an ESP32. These results validate the ESP32’s capability for accurate, low-latency, edge-based occupancy estimation, providing a low-cost, energy-efficient solution for enhancing real-time automation in smart building environments.

Results in EngineeringVol. 29
Vellore Institute of Technology University (IN)
Openalex Percentile: Top 89%
Building Energy and Comfort Optimization
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.