r/arduino • • Aug 02 '26

Look what I made! Built a CO₂-triggered auto-window system with Arduino Nano + ENS160 — when the air gets bad, it just… opens by itself

The classroom gets stuffy because nobody wants to open ,then CO₂ builds up, everyone gets drowsy, and the teacher wonders why half the class looks half-dead.

So I used the ENS160 sensor monitors CO₂ equivalent concentration in real time. When it crosses 850 ppm, the servo rotates 0→90° and opens the window automatically. Once CO₂ drops back below 800 ppm, it closes again.

The OLED display shows live CO₂ / AQI / TVOC readings and current window state (WIN: OPEN / WIN: CLOSE).

A few things I think should to share: • Hysteresis control (850 ppm open / 800 ppm close) so the servo doesn't jitter at the threshold • servo.detach() after every move — completely silent when idle, no PWM buzzing

Still a work in progress — also has IR body temp screening, smoke alarm, auto lighting, and UV-mode disinfection. Happy to

Built with: Arduino Nano / ENS160 / SSD1306 OLED / SG90 servo

26 Upvotes

2 comments sorted by

4

u/TheRunningFox2 Aug 02 '26

Your data fluctuates quite a bit. You should look into low pass filtering or atleast averaging the measurements.

1

u/Feeling_Pin7594 Aug 03 '26

Maybe add in fan control :0