Projects / SmartAir
SmartAir
A low-cost sensor box that checks room air quality and whether people are in the room, and switches a ventilation fan on only when needed.
The Problem
Poor indoor air affects health, but running a fan all day wastes electricity. The aim was a cheap system that improves air only when it needs to.
What I Built
A single sensor node reads temperature, humidity, pressure, light, and estimated CO2 and TVOC every 5 seconds. Two small decision-tree models run on the device itself, so no cloud is needed. One detects whether the room is occupied. The other sets an air-quality class of Good, Moderate or Poor, and a relay switches a fan or exhaust on that basis. An OLED display shows the readings.
The node also publishes its readings over MQTT so they can be stored and viewed on a live Grafana dashboard.
My Role
First author of the paper. I did the core system design, prototype assembly, deployment and testing, and developed and deployed the on-device algorithm.
Technical Details
Sensors: BME280 (temperature, humidity, pressure), BH1750 (light) and CCS811 (estimated CO2 and TVOC). Telemetry path: the ESP32 publishes JSON over MQTT to a Mosquitto broker, Telegraf stores it in InfluxDB and Grafana shows the dashboard.
Results
- Occupancy model on two public test sets: accuracy 97.82% (F1 0.9709) and 99.26% (F1 0.9826).
- Air-quality control model: macro-F1 0.9999 against threshold-derived labels.
- Validated end to end in a 60-minute run in a residential kitchen in Dhaka (January 2025).
- Bill of materials for one node: about Tk. 3,015, excluding enclosure and fans.
Limitations and What I Would Improve
- The air-quality labels come from CO2 and TVOC threshold rules, so the 0.9999 score shows the tree reproduces those control rules, not that it learned health outcomes.
- The occupancy tree splits mainly on light level, which caused some false "unoccupied" results when the node was mounted high and the door was open. Occupancy only gates the "Moderate" case, and "Poor" air triggers ventilation regardless, so severe cases are unaffected.
- The CCS811 is a low-cost proxy sensor, not lab-grade.
Gallery

