← Back to timelineDIY CO₂ Air-Quality Monitor

Engineering

DIY CO₂ Air-Quality Monitor

A keyring-sized ~€30 CO₂ monitor — market survey, first PCB, Sensirion SCD40/41 photoacoustic sensor and a low-power STM32 L0 tuned down to 265 µA average, written up mistakes and all.

  • engineering

Starting with the market, not the circuit

Before drawing a schematic, the project asks whether it should exist. The wishlist: a high-end sensor, battery powered, small enough for a keyring, three months without charging, one reading every 1–20 minutes. Existing monitors sell for €30–60 but last about a day on a charge and are the size of a glasses case — so there was a gap. A qualitative round with friends plus a 45-response survey at engineering school confirmed modest interest and pointed at a €20, car-key-sized target. Not a breakthrough, and the article says so plainly.

Sensor, buses, and a first PCB

The Sensirion SCD40/41 measures CO₂ by photoacoustic spectroscopy: infrared light tuned to CO₂’s absorption band excites the molecules, and the resulting pressure vibrations are picked up by a tiny microphone in the chamber. Around it, I2C carries the probe and SPI drives the e-paper screen and SD card, with PMOS transistors gating power to each so idle draw approaches zero. The MCU is an STM32 L0 — chosen after a first PIC board was abandoned over a €100 programmer. The board was panelised in KiCad to fit several copies into one 100 × 100 mm order.

What it cost in mistakes

The write-up highlights its own errors in red. The I2C pull-ups were left off the first board and had to be patched in with wire, then re-routed to the sensor’s power PMOS once they turned out to leak current continuously. Firmware is plain C in STM32CubeIDE, with custom headers inspired by Arduino libraries and the e-paper datasheet, and a one-line ImageMagick script to generate display bitmaps. A shunt and precision ADC test bench got average consumption down to 265 µA at a reading every 10 minutes. The killer was the power supply: a 50 mAh CR1225 coin cell couldn’t sustain it. V1 is a learning prototype, not a product — V2 means a rechargeable lithium cell, a charger IC and USB-C.