Measuring air quality in my home (part 1)

March 23rd, 2017

I lived for about three years in Beijing and Shanghai. This was around 2012, when air pollution was fast becoming a matter of concern. Multiple studies were singling out particulate matter below 10 µm in diameter (PM10) and below 2.5 µm in diameter (PM2.5) as key contributing factors to lung cancer.

Particulate matter size comparison from the EPA before they got defunded.

Trying to protect both my then-girlfriend (now wife 💕) and myself, I started looking at air purifiers. But most purifiers, at the time, didn’t come with embedded air quality sensors. You were just supposed to turn them on and hope for the best. That’s unsatisfactory for several reasons:

The middle filter has a solid 50 days of life left, according to the thresholds from the great folks at Smart Air Filters. I bought a few of their cheap purifiers while in China.

I decided to buy an air quality sensor. At the time, the only widely available ones were the Dylos line of products. How these devices work is quite simple. A small fan creates an airflow through a duct; a laser shines a beam through the airflow; and a photodetector registers when the beam is scattered by particles in the airflow. If you want to know more, there’s a good teardown.

This gives us an estimate of the particle count per unit of volume. In our case, Dylos displays the particle count per 0.01 cubic foot of air. Yes, that’s barbaric, but it’s America and everything is possible, so I’m just grateful they didn’t do it in fl. oz.

More expensive air quality sensors, like the ones used by governments, do not use the laser approach, and measure PM2.5 in a more civilized µg/m3.

The issue is that there is no exact conversion from particle count to weight. Fortunately, correlation is high and approximate conversion formulas exist. This allows us to compare interior air quality measured by a Dylos, with exterior air quality measured by a government station.

Empreinte. Huile sur toile, 2008, Odile Ferron-Verron.

The Dylos was instrumental (/r/dadjokes) in helping me fight pollution in my home in China. At the end of the day, though, it was a losing fight. Staying stuck in your home because going out may give you cancer is exactly as awful as it sounds. There’s probably a dystopian YA movie somewhere with a similar plot. (It also reminds me of Hugh Howey’s excellent Wool series.)

China sacrificed the environment to let breakneck industrialization raise hundreds of millions of people out of poverty. I don’t completely blame them, but I do feel hugely for the people and families who live there. And now that I’m back under the blue skies of Northern California, I know exactly why they are worth preserving.

Part 2 will be about how to pipe together a Serial-to-USB cable, a Raspberry Pi, Redis, InfluxDB, Grafana, and Rust to stream Dylos measurements straight to my homepage.