I recently became interested in being able to get a sense of the quality of air we breath everyday indoors. Some of the most common indicators of unhealthy air quality are high levels of dust, volatile organic compounds (VOCs), CO2, CO, flammable gasses, and formaldehyde (HCHO). High levels of these pollutants can lead to countless health problems, so I wanted to have a device that can alert me to open a window or start my air purifier and purge or clean the stagnant air. However, I was unable to find a device online that was able to detect all of these particles and gases, so I decided to make a DIY device that does just that. This air quality device periodically takes readings from 6 sensors, displays them onto the e-Paper display, and sends the values to an InfluxDB (a time-series data base) set up on Google Cloud, so I can get live readings from a browser through Grafana. Code for the entire project can be found here.

Through 6 sensors, the device can detect high levels of any of the following: particulate matter (PM 2.5 and PM 10), VOCs, CO2, CO, 8 flammable gasses, HCHO, temperature, and humidity.  

Sensors 

Each sensor was integrated through the following interface: 
Honeywell PM sensor – UART 
Sensirion VOC sensor – I2C
CO2 sensor – UART 
CO sensor – Analog voltage 
HCHO sensor – Analog voltage 
Flammable gasses sensor – Analog voltage

e-Paper – SPI 

 

Integration

All sensors were integrated through an event-driven framework that I had developed earlier. The framework can be found here

To make the project a bit more challenging, I also added an e-Paper display and wrote its library from scratch. The library allows users to type strings, draw rectangles, and display images directly to the display while handling internally the nitty-gritty bit-manipulations involved in moving the data into the correct addresses. Code for the library can be found here

 Code

Next Steps

This is an ongoing project, so my next steps are to make the assembly easier and the code adaptable so anyone with a bit of technical background can build their own version of the device. I will also work to make the firmware and electrical design more power efficient, so that a single charge can last several days. 

An ESP-32 operates the device and is powered by a 3.7V lipo battery
Designed a custom PCB to make the electronics as compact as possible
Went through a few iterations before getting to the design I liked