← all posts
// smart-home · air-quality

Analyze indoor air quality locally

Here's the rule I run by: no CO2, particulate, or VOC sensor gets a model wired to it until I can write its trigger condition in four lines, and no model gets write access to a fan, valve, or alarm. Everything else is negotiable.

Small-board air-quality builds draw two flavors of bad advice: treat the board like a gaming rig, or write off anything short of a frontier chatbot. Both miss the useful middle: quiet jobs near the sensors that work without a cloud account, the same discipline behind fully local RAG. The payoff is that it keeps running.

This job needs trend and occupancy context, not fluent health commentary: a CO2 curve that climbs after dinner and stays up until someone opens a window is useful, a paragraph about elevated CO2 causing drowsiness is not, because the model doesn't know your kitchen. Start from a board reading a few rooms and their ventilation state: storage, power, cooling, and the consuming service matter more than the chip on the label.

the four lines that decide what you buy

Write the event, input, output, and deadline in four lines. "Add AI to the sensor feed" is not a job. "When the bedroom holds CO2 above its occupied baseline overnight, log a trend note and offer one ventilation reminder" is, and writing it out shows which parts never needed a model: a threshold and a rolling average cover most of it. Validate each sensor against a reference and compare it to an occupied baseline, not a spec-sheet number: a drifting VOC sensor or a bloated Home Assistant database moves a reading more than a model revision does.

Keep a short field record:

board / OS / power supply / cooling
sensor set and last calibration check
occupied vs unoccupied baseline, per room
polling interval, warm-up time, sustained rate
memory, temperature, wall power
false alert, missed alert, recovery path

Accuracy alone isn't enough. Check for duplicate alerts, reboot survival, and safe behavior when inference is down. Nobody in the house should need to know which container is broken just to crack a window.

thresholds hold the leash, not the model

The common failure is feeding raw ppm numbers into a model and trusting whatever causal story comes back. A generative layer can interpret a question or summarize trends, but should never stand alone between a reading and a fan, valve, or alarm. Put ranges, permissions, and timeouts in deterministic code that doesn't care how eloquent the model felt that morning. Treat MQTT payloads and voice transcripts as untrusted data, not instructions.

Privacy needs the same full-path thinking, not just "it runs locally." Local inference stops one upload, but logs, dashboards, and backups can still leave copies: a CO2 curve is a decent proxy for who's home and asleep, the same retention question behind keeping meeting transcripts private. Decide what's collected, how long it lives, who can pull it. The most private reading is the one never logged.

power, heat, and the reboot test

Run this as an appliance, not something you SSH into out of curiosity. Use a service manager or a pinned container, keep configuration separate from the model files, and write a health check that proves the actual function, not that a process merely holds a port. Back up the controller state: the node that fails is always the one wedged behind the water heater.

Run it long enough for the enclosure to reach thermal equilibrium and measure at the wall: a self-heating enclosure drags a humidity or VOC reading off. If the board throttles or corrupts its own storage, it isn't ready, however good one reading looked. Use the model to describe measured patterns, not diagnose the people breathing the air, and let the ventilation trigger fall back to a plain threshold when it's down.

What I give up on purpose: the chatty version of this, no fluent paragraph guessing why I'm tired and blaming the bedroom, no single natural-language interface over every device in the house. In exchange: a fan trigger that survives an outage, a privacy story I can explain to whoever else lives here, and a board in a closet I can forget about for a year.

#air-quality#sensors#privacy