If you’ve got this far, you probably already know how important it is to measure indoor CO₂ levels. Poor ventilation causes CO₂ levels to rise above 1000 ppm, leading to drowsiness, loss of concentration and, at high levels (>2000 ppm), health problems. But the key question is: Why CO₂ Gadget and not just any other meter on the market?
The problem with commercial meters
Over the last few years, I have tested dozens of commercial and DIY CO₂ meters. The commercial ones have a number of recurring problems:
- Mandatory cloud storage — Many “smart” meters require an account, an app and a subscription. Your data leaves your home without your control.
- No real integration with Home Assistant — If you have a home automation system, commercial meters rarely offer deep integration. When they do, it is usually partial and slow.
- Calibration not possible or restricted — CO₂ (NDIR) sensors require regular calibration. Commercial devices either do not allow this or make it difficult.
- Proprietary hardware — You cannot add sensors, change the control logic or adapt the firmware to suit your needs.
- High price for what they offer — A good commercial air quality monitor costs €100–200 and rarely features a high-quality display, a particle sensor or decent connectivity.
Why build one yourself?
Building your own CO₂ monitor using the ESP32 has clear advantages:
- Full control over the firmware and data — Nothing leaves your local network without your permission.
- Full customisation — You choose the sensors, the display, the wake-up logic, the alarm thresholds, and anything else you can think of.
- Native integration with Home Assistant — MQTT Discovery automatically detects the device and creates all the entities (sensors, settings, controls).
- Cost-effective — For €30–50, you get an ESP32, an NDIR sensor, a display and a case – all of a higher quality than many off-the-shelf models.
- Learning — You’ll learn about sensors, MQTT, BLE, deep sleep, calibration and ESP32 programming. It’s an excellent educational project.
Why CO₂ Gadget and not other DIY firmware options?
There are other firmware options for CO₂ sensors using the ESP32. Some of them are excellent. But CO₂ Gadget stands out in several ways:
- Sensor coverage — Supports over 20 sensors for CO₂, particulate matter, temperature, humidity, pressure, VOCs and NOx. You’re not tied to a single model.
- 5 communication protocols — Wi-Fi (REST + WebSocket), BLE (GATT + BTHome v2), MQTT with Discovery, ESP-NOW, and HTTP API. You choose whichever one you need.
- High-quality web interface — Apple-inspired design with light/dark themes, real-time charts, and full configuration via the browser. It’s not just a basic HTML5 page.
- Low actual fuel consumption — Aggressive deep sleep mode (10–30 µA), wake-up via CO₂ threshold, wake-up via timer, wake-up via button. Up to 3 months on a single 18650 battery.
- Advanced calibration — Manual and automatic (ABC), with support for sensors set to forced calibration (SCD4x forced mode).
- Full documentation in Spanish — Step-by-step guides, an FAQ with over 33 questions, a documented REST API, and an explanation of the build configuration.
- Active community — Telegram, GitHub with issues resolved, frequent releases.
- GPLv3 Licence — Genuinely open source. You can fork, modify and redistribute it.
Project philosophy
CO₂ Gadget is based on a simple premise: A useful CO₂ meter must be reliable, integrable and open source. Reliability is ensured by using high-quality NDIR sensors (Sensirion SCD4x, SCD30, MH-Z19) and by implementing correct calibration. Integration is provided by MQTT Discovery, the REST API and BTHome v2. The open-source nature of the project is ensured by the GPLv3 licence and the public repository on GitHub.
There’s no hidden telemetry, no “premium features”, no lock-in. What you see in the code is what your device actually runs.
Who is CO₂ Gadget for?
- Classrooms and offices — Monitor air quality in real time and receive alerts when ventilation is insufficient.
- Bedrooms — Silent mode without a display, with wake-up triggered by high CO₂ levels and BLE notifications to your mobile.
- Meeting rooms — E-Ink display visible to everyone, integrated with the cinema’s booking system.
- Homes with Home Assistant — Automated systems based on CO₂, particulate matter or VOCs: activate ventilation, open windows, switch on extractor fans.
- Hobbyists and makers — An educational project featuring real sensors, MQTT, BLE, deep sleep mode and a fully-fledged web interface.
- Researchers and educators — Export data to CSV/JSON for analysis in Python/R, or via MQTT to InfluxDB/Grafana.
Getting started is easy
If you’re interested in the project, you have two options:
- Quick installation (recommended) — Use the web installer from the home page. Select your hardware, flash it from your browser, and in 5 minutes you’ll have a working meter.
- Build from source code — Clone the repository, configure platformio.ini with your hardware and feature flags, and build with PlatformIO. More control, more possibilities.
For specific queries, please refer to the FAQ or join the Telegram channel.