https://github.com/natepichler/ESP32-air-quality-sensor
In my woodshop, I have a few forms of dust control.
- Overhead air cleaner
- 3/4 hp dust collector (for the table saw)
- Shop vac
I have always been cautious of my exposure to wood dust while working in there, so I wear a mask most of the time. Being who I am, I wanted to quantify the quality of the air I was potentially breathing, as well as assess the effectiveness of my various dust control solutions.
After doing research and browsing through sensors on DigiKey, I settled on the following configuration:
Microcontroller: ESP32-S2-DevKitM-1
Considerations for this part included the RPi Pico, Arduino Nano, ESP32, and ESP8266, and I chose to go with an ESP32 board for a few reasons.
ESP32 boards have WiFi (and some have bluetooth) built-in. The ESPHome integration also makes it easy to connect with my HomeAssistant instance for data logging and automations. If I was not interested having that connection, a Pico or Nano would have sufficed.
In addition, I needed a board with enough pins to connect all of the sensors, with some to spare in case I wanted to add other sensors in the future.
Particulate sensor: SPS30
This air particulate sensor, made by Sensirion, measures and outputs both number concentration (#/cm3) and mass concentration (μg/m3) for particles ranging from 0.5 μm to 10 μm.
This range covers common particle sizes from various woodworking tasks, from small particles from sanding to large particles from sawing.
Temperature and Humidity: DHT22
The DHT22 sensor is pretty standard, so there’s not much to say about it.
Here is a helpful link about DHT sensors from Adafruit. https://learn.adafruit.com/dht
Display: SSD1327 Grayscale 1.5″ 128×128 OLED
In addition to this OLED display, I considered using an LCD display, however I wanted to include more information than I was able to display, so I went with an OLED. There isn’t much to say about this either, It was just a good size and a good value.
Interface
Having the data shown in HomeAssistant as well as on the screen was great, however figured it would be helpful to have a way where I can quickly reference the air quality from anywhere in the shop. For this, I settled on a “stoplight” system, with three LEDs to show me green (good), yellow (fair), and red (poor).
I also wanted the sensor to collect data all the time, rather than just when I am in the shop. This way, I can better assess the effectiveness of my dust collection systems (I often run them on a timer when I leave the shop) as well as the current temperature and humidity (temperature is particularly helpful during the winter. I can be notified if the shop is close to freezing and then turn on the heater).
Having the display and stoplight on 24/7 was not ideal. I dealt with this by adding a toggle switch to the unit. When the toggle is on, the LEDs and the display are enabled. When the toggle is off, the controller will not illuminate the LEDs or power the display.
Final Unit
After testing on a breadboard, I soldered headers to a section of perf-board to hold the ESP32 module, as well as JST XH connectors for the sensors. The assembly was mounted in a 4″x4″ weatherproof PVC junction box with hot glue. The junction box required some carefully spaced holes to mount the switch, LEDs, display, and USB cable. The SPS30 and DHT22 sensors are mounted on the top of the box with sticky back Velcro.
I mounted the unit to the side of my overhead air cleaner in an attempt to get an accurate reading of the air I’m actually breathing in (close to head height, central in the shop).
My GitHub has a more technical explanation this, as well as the code and circuit sketches of the final unit.