← dani vilanova / projects / air monitor
building · resuming sep 2026

AIR/MONITOR

A box on the desk that tells me what I am actually breathing: particulates, CO₂, temperature, humidity. Hand-wired, firmware written from scratch, every step logged.

spent so far
13,27 €
parts bought
7
firmware
1.084 lines
status
back on it
§01

why

motivation

I wanted to know whether the room I am sitting in is actually ventilated or whether I should open a window. Same at night: what the numbers look like with the window open versus shut.

I like deciding things from data.

§02

v1 → v2

the plan changed
v1 · feb 2026
Arduino Uno R3
  • Local display only
  • No network
  • 2 KB of RAM to work in
  • Powered over USB
v2 · sep 2026
ESP32
  • Wifi, so the data leaves the room
  • Real CO₂ instead of a gas proxy
  • Battery, so it moves around the house
  • Printed case
what the change costs, and it is not money The 1.084 lines of firmware are written for the Uno, and a good half of them exist only to fight its 2 KB of RAM: page-buffer mode on the display, trimmed buffers, a software serial port because the Uno has exactly one hardware UART. On the ESP32 none of that is needed, so this is not a port, it is a simplification.

One electrical detail worth knowing before buying: the ESP32 runs at 3.3 V, not 5 V. The display and the temperature sensor are fine, but the MQ-135 swings up to 5 V and needs a divider before it touches an ADC pin. The particulate sensor actually gets easier: its serial was already 3.3 V and on the Uno it was the awkward wire.
§03

bill of materials

7 bought · 5 to buy
ComponentWhat forSourcePriceStatus
PMS5003 G5Laser particulate, PM1 / PM2.5 / PM10AliExpress7,73 €bought
AM2302 / DHT22Temperature and humidityAliExpress0,69 €bought
MQ-135Gas trend, standing in for CO₂AliExpress0,74 €bought
OLED SSD13060.96" 128×64 displayAliExpress0,84 €bought
Capacitor kitsElectrolytic and ceramicAliExpress2,53 €bought
SPDT slide switchesBuzzer enableAliExpress0,74 €bought
Uno R3, DS1302, buzzer, buttonsBoard, clock, alarm, navigationstarter kit0,00 €on hand
v2 · still to buy
ESP32 dev boardReplaces the Uno. Wifi, three hardware UARTs, room to breatheto decide?to buy
MH-Z19C or MH-Z19DTrue CO₂ by NDIR, the number this is all aboutAliExpress, link saved?to buy
Battery and chargingSo it can sit in the bedroom overnight without a cableto decide?to buy
Bigger displayOptional. 0.96" gets tight with four readings and a chartto decide?maybe
EnclosureNeeds airflow over the particulate sensor, not a sealed box3D print?to print
Spent so far7 parts, all of v113,27 €
→ arrastra la tabla
§04

build log

21 entries · the ones worth reading
2026-02-08

The clock lied to me

Spent an evening trying to talk I²C to a module that turned out to be a DS1302, a three-wire part that has never spoken I²C in its life. The chip was marked. I just had not looked.

2026-02-08

Making the display stop flickering

Clearing the whole screen every frame made it strobe. Switched to text mode and overwrote only the characters that changed. On a board with 2 KB of RAM you do not get to be wasteful.

2026-02-08

A traffic light, then an arrow

Green, amber, red for the air, plus a trend arrow on PM2.5. The first arrow was ambiguous enough that I replaced it with UP / DN / OK and slowed it down so it could actually be read.

2026-02-20

Multi-screen UI with per-sensor charts

Three buttons, one screen per sensor, each with min, max, mean and a rolling chart. This is where it stopped.

§06

links

what is public
§05

where it is now

paused feb, back sep

It got as far as a working breadboard. Then it sat still from February to September. Picking it back up means finishing the parts list, moving to the ESP32, and printing a case that lets the air through.