Guides › CO₂ traffic light

English · Svenska · فارسی

🚦 CO₂ traffic light for the home office

“How do I build a light that turns red when my room needs fresh air?”

Stale air makes you tired long before you notice it. A real CO₂ sensor and a ring of LEDs show it at a glance: green is fine, yellow means open a window soon, red means now.

Cost$30–60
Time1 evening
LevelFirst build
PowerUSB

Ask IotMentor

What to buy

PartWhy this oneRough cost
ESP32 or ESP32-C3 boardWiFi is optional here, but it lets you log readings or add a phone alert later.$4–8
Sensirion SCD40 sensor boardMeasures CO₂ directly, using light and sound (photoacoustic sensing). Also gives temperature and humidity.$20–45
WS2812 LED ring, 8–16 LEDsEach LED can show any colour, all driven from one pin.$3–8
USB power supplyThe sensor measures every few seconds, so this isn't a battery project.you likely have one

Prices are rough ranges, not quotes. Check the current price and stock before you order.

What to install

No code needed: ESPHome supports both the SCD40 and LED rings. You write a short settings file: read CO₂ every 30 seconds and set the colour by level. It runs on the board by itself; Home Assistant is optional.

A common rule of thumb: green below 1000 ppm (parts per million), yellow from 1000 to 1400, red above 1400. Outdoor air is about 420 ppm.

Build it in three steps

  1. Read CO₂. Connect the SCD40 over I²C, a two-wire connection (SDA and SCL, plus 3.3V and ground). Print the readings, then breathe near it: the number should jump.
  2. Light the ring. Connect the ring's power and ground, and its data input through a small resistor (about 330 Ω). Show a test colour.
  3. Join them. Map CO₂ to colour, and keep the brightness low: a desk light at full brightness is distracting.

What catches people out

Your version is different?

Ask IotMentor with your own details: distance, power, budget, experience. It asks a few questions back, then gives you a plan like this one, free.

Ask IotMentor

Starts with: “How do I build a light that turns red when my room needs fresh air?” Add your own details before you send it.

More guides