Build Your Own CO2 Monitor
Building a DIY CO2 monitor is a rewarding project that teaches you about sensor technology while producing a functional device. The Sensirion SCD41 sensor makes this accessible even for beginners. Here is a step-by-step guide.
Parts List
- Sensirion SCD41 sensor module — photoacoustic CO2, temperature, and humidity sensor (approximately $50)
- Arduino Uno or ESP32 board — ESP32 recommended for WiFi capability (approximately $10-15)
- OLED display — 0.96-inch I2C SSD1306 (approximately $5)
- Breadboard and jumper wires (approximately $5)
- USB cable and power supply
- Optional: 3D-printed enclosure, NeoPixel LED for colour-coded alerts
Total cost: approximately $70-80, comparable to budget commercial monitors.
Wiring
The SCD41 uses the I2C protocol. Connect:
- SCD41 SDA to Arduino/ESP32 SDA (GPIO 21 on ESP32)
- SCD41 SCL to Arduino/ESP32 SCL (GPIO 22 on ESP32)
- SCD41 VCC to 3.3V
- SCD41 GND to GND
- OLED SDA/SCL to the same I2C bus
Software Setup
- Install the Arduino IDE and add ESP32 board support if using ESP32.
- Install the Sensirion I2C SCD4x library via Library Manager.
- Install the Adafruit SSD1306 and Adafruit GFX libraries for the display.
Basic Code Structure
Your sketch should:
- Initialise the I2C bus and both devices
- Call the SCD41 measurement function every 5 seconds
- Read CO2 (ppm), temperature, and humidity values
- Display readings on the OLED with colour-coded status
- Optionally send data to a WiFi endpoint or Home Assistant via MQTT
Calibration
The SCD41 supports automatic self-calibration (ASC). For manual calibration, expose the sensor to fresh outdoor air and use the forced recalibration command. Read our calibration guide for the full process.
Taking It Further
- Add a web dashboard — the ESP32 can host a simple web page displaying live readings
- Set up alerts — trigger a buzzer or push notification when CO2 exceeds your threshold. See CO2 alerts and automations.
- Log to a database — store readings in InfluxDB for long-term trend analysis using our tips from reading your monitor data
Compare your DIY build against commercial options in our best home monitors guide, and use the CO2 calculator to validate your readings against expected values for your room.