Building a DIY CO2 Monitor with Arduino

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

  1. Install the Arduino IDE and add ESP32 board support if using ESP32.
  2. Install the Sensirion I2C SCD4x library via Library Manager.
  3. 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.

Read More

At CO2Monitors.ai, we're committed to providing honest and thorough insights into the world of indoor air quality. Our content includes affiliate links, meaning we may earn a commission if you purchase through these links, at no additional cost to you. As an Amazon Associate I earn from qualifying purchases. This affiliate relationship does not influence our reviews and comparisons, as we strive to offer unbiased information.