The Inspiration
Many years ago, I watched a Tom Scott video about how air quality can affect cognitive performance. From that point on, I felt very conscientious(paranoid) about the quality of air in my home. To boot, I don't have centralized air, so the idea that my home might have more carbon dioxide than necessary is a concern.
Rather than let this rational concept vex me for the foreseeable future, I figured I would put my skills to the test and actually measure my indoor air quality.
The Solution
My solution: multiple small devices placed around my home, taking readings from the air and aggregating data into a dashboard to show me what the problems are and in what areas. Easy enough, surely.
I bought an ESP32 dev board (DOIT v1) which would serve as a microcontroller that could connect to the internet and relay data back to a server. I also purchased an SCD40 from Digikey, an I2C module for detecting CO2. Since I would be taking periodic samples of the air, the slowness of I2C was not a problem. In fact, it would allow me to add modules as needed during the prototyping phase.
Initial Implementation
Thankfully, there were already premade libraries by Adafruit for the SCD40. It made programming a cinch. I could take periodic readings and send the data to a time-series database (InfluxDB) using nothing but POST requests. No heavy lifting from the ESP32—I could do all my querying on my homelab.
The initial CO2 readings were not great, but not particularly concerning or unusual for the time of year. There was also an issue of calibration, but I'll talk about that later.
Expanding the Sensor Array
I wasn't quite satisfied yet. The National Weather Service measures things like Carbon Dioxide (CO2), Ozone (O3), and many Volatile Organic Compounds (VOCs) such as smoke or exhaust from cars. In the summer, Canada has had some wildfires which produce a lot of VOCs. It would be good to know how much is leaking into my home. Also, any fumes or exhaust that my oven produces can have an effect on air quality. I have a small animal, which are much more sensitive and vulnerable to these.
For this, I purchased an SPS30 from Digikey, as well as a BME280 to measure things like temperature, humidity, and air pressure. Thanks to the I2C design, it was as simple as plug and play (and code). A real boon for prototyping.
Testing and Validation
I tested the system by opening my window. There was a clear drop in temperature, CO2 levels, and humidity levels. This is actually recommended by the manufacturers to help calibrate the sensors.
The Calibration Challenge
This is the tricky part. These components work well and were programmed easily. Knowing that they're accurate is the hard part, and that's the real product that actual air quality sensor companies create. This is why I didn't show the PM (particulate matter) graphs from the SPS30—I have no clue how accurate they are.
At the very least, I can verify the humidity and temperature readings and approximate the CO2 from the weather report. The SPS30 also takes about a week to fully calibrate internally.
That's really the drawback of building your own air quality monitor. It's much cheaper and you can configure things how you like with no worry about malicious things like data stealing, but you have no idea how accurate it is.
When you buy a pre-configured air quality monitor, what you're really buying is peace of mind. You can be assured that the monitors are calibrated properly and to within specifications (assuming you buy from a reputable company). Mine seems accurate, but without proper tooling, I have little way of knowing.
Next Steps: PCB Design
Since this is a prototype, I can't keep it forever. It's wasting my precious breakout boards. Also, it's a liability when you have a pet who loves stringy things. I took it upon myself to whip up a circuit design schematic. From here, I could just send the design to some PCB manufacturing website and they would send me the board. All I would have to do is solder on the components.
But before I pull the trigger on that, I want to take some time to both calibrate the parts and decide if I think they provide enough of a picture of the quality of my air. Maybe I might want some spectroscopy sensor to detect certain gases and their quantity.
Outdoor Monitoring Concept
I also had the idea that I could get a pretty good indication of their calibration (and how badly insulated my home is) if I made a monitor for outside. There are more challenges involved with this. I need to design some sort of casing that can keep the elements off of the board while also being able to let it breathe and actually read the air.
I learned an old solder quick-fix once: you could take clear acrylic nail polish and coat traces on boards to make them non-conductive on those spots. Dipping a whole board in nail polish might not be the right move either, but maybe some Scotchgard might help. I'll have to do some research and experimenting before I pull the trigger on that either.
Future Enhancements
The last thing I would want to work on would be OTA (Over The Air) updates. It can be kind of a pain to connect it and flash the firmware every time. If I could configure OTA, that would solve that hassle.
If I were to fully dive into this multiple monitor configuration, I might have to consider creating a server for them to "phone home" to. I plug in a domain name and they all register in the same little UI. This would make updating and version tracking seamless.
This project demonstrates that building DIY environmental monitoring systems is accessible to makers and engineers, but it also highlights the real value proposition of commercial products: calibration and validation. The journey continues, with PCB design, weatherproofing, and OTA updates on the horizon.