Skip to content
MCU Atlas

ESPHome indoor air-quality monitor (CO2, PM2.5)

An ESPHome config for a DIY air-quality monitor measuring CO2, particulates, temperature, humidity and pressure.

Difficulty:BeginnerSource available

Photos

ESPHome indoor air-quality monitor (CO2, PM2.5) photo 1
ESPHome indoor air-quality monitor (CO2, PM2.5) photo 2

Photos: koenvervloesem.github.io

Key Facts

  • Chip: ESP32
  • Sensors: CO2, PM2.5/PM10, BME280
  • Framework: ESPHome
  • Feedback: RGB LED or display

About This Project

Koen Vervloesem's project provides a tested ESPHome configuration for an indoor air-quality monitor, built on a perfboard in a project box. It measures CO2 with a Senseair S8 or SCD-series sensor, PM2.5/PM10 with a PMS5003-type sensor, and climate with a BME280, then optionally shows status via an RGB LED or display. Everything reports into Home Assistant, and CI keeps the config building.

Source & Attribution

Source: GitHub
License: MIT
Last verified: 10/15/2026
ESPHome indoor air-quality monitor (CO2, PM2.5)

How to Build It

An ESPHome configuration for a DIY indoor air-quality monitor that measures CO2, fine dust (PM2.5/PM10), temperature, humidity and pressure. A traffic-light LED shows the air quality at a glance, and the readings go to Home Assistant.

Parts Needed

  • ESP32 (or ESP8266) board
  • CO2 sensor: MH-Z19B or T6615 (or Senseair S8 per our BOM)
  • Particulate sensor: Nova SDS011 (or PMS5003)
  • BME280 breakout (3.3V version)
  • Red/yellow/green LEDs or an RGB LED
  • 5V boost converter if running from a battery; perfboard and project box

Steps

  1. 1

    Wire it up

    Follow the connection table in the README. On an ESP32: BME280 on I2C (GPIO21/22), the CO2 sensor's UART on GPIO35/32, the SDS011's UART on GPIO34/33, and the LEDs on spare GPIOs. Power the CO2 and dust sensors from a steady 5V.

  2. 2

    Install ESPHome

    Use the ESPHome add-on in Home Assistant or install the esphome CLI with pip.

  3. 3

    Configure

    Pick the YAML for your board from the repo and add a secrets.yaml with your Wi-Fi details (plus an API key or OTA password if you want them).

  4. 4

    Flash

    Run esphome run with your YAML file to compile and upload over USB. Later updates can go over Wi-Fi.

  5. 5

    Add to Home Assistant

    Home Assistant discovers the device. Add it, then build a dashboard or automations, for example opening a window when CO2 gets high.

  6. 6

    Tips

    CO2 sensors need a few minutes to warm up. The SDS011 has a limited lifespan, so the config reads it periodically rather than continuously.

Bill of Materials

Parts list

5 parts · 4 linked

Heads up: some Buy links are affiliate links. If you buy through one, MCU Atlas may earn a small commission at no extra cost to you. It never changes which parts we list. How this works

Not included: 3D-printed case, wire, solder, USB cable

Download CSV

Related Projects

AirCube: ESPHome desk air-quality cube with charts
Illustration
ESP32
An all-in-one ESPHome air monitor showing temperature, humidity, CO2 and PM2.5 with 12-hour trend charts on a small screen.
Intermediate·Code
4 parts listed
CO2 Monitor That Fails Visibly: SCD30 ESPHome node with real fault handling
Illustration
ESP32ESP32-C3
An ESPHome/Home Assistant CO2 node engineered so a dead sensor reads unknown and raises a fault, never a frozen last-good number. SCD30 + XIAO ESP32-C3.
Beginner·Code
4 parts listed
Smart Meteo: battery e-ink CO₂ and air monitor
Illustration
ESP32ESP32-C6
A battery-powered ESP32-C6 e-ink CO₂ and air-quality monitor that runs months per charge, joins Home Assistant over MQTT or Matter, and keeps everything local.
Advanced·Code
7 parts listed