I put together a quick air quality monitoring solution for my home lab. I wanted to see how much my X1 Carbon, Sunlu S2 filament dryer, and WeCreat laser cutter impacted the air quality in my house.
I didn't do any internet research before hand and didn't realize there were similar things already out there like AirGradient or the Amazon Smart Air Quality Monitor for example.
All in this cost me about $150 in components (including shipping in the United States) so the AirGradient probably would have been a better idea but this was fun to make anyways. This is definitely higher quality than the Amazon Smart Air Quality Monitor but the AirGradient is likely about the same since it uses very similar sets of sensors.
This model includes a quick 3d printed enclosure that allows mounting the following components using M2 screws (M2 x 4 pan head screws if I recall correctly):
The PMSA003I is connected to the SCD-40 and the SDC-40 is then connected to the ENS 160 in daisy chain using 2 x STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long from. Then I snipped the ends off of a STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable - 150mm Long and soldered it directly to the Pi Pico GND (Black Wire, Pin 38), 3v3 out (Red Wire, Pin 36), SCL (GP5 / Pin 7), and SDA (GP4 / Pin 6) pins. That was then connected from the Pi Pico to the ENS160.
The enclosure could definitely use some improvements as I realized I didn't really leave a way to ACTUALLY mount the Raspberry Pi Pico in it's little slot. I wanted the separation to keep any heat generated by the Pi Pico away from the sensors, but forgot to leave a way to actually screw it in so I ended up running longer screws from the outside and maneuvered some nylon washers and nuts into place to secure it down. If I ever build a second one of these I will update this profile with any improvements I make.
I set it up using EspHome in Home Assistant with the following config:
esphome:
name: labenvironmentmonitor
friendly_name: LabEnvironmentMonitor
rp2040:
board: rpipicow
framework:
# Required until https://github.com/platformio/platform-raspberrypi/pull/36 is merged
platform_version: https://github.com/maxgerhardt/platform-raspberrypi.git
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "GetYourOwnKey"
ota:
password: "GetYourOwnPassword"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot in case wifi connection fails
ap:
ssid: "Labenvironmentmonitor"
password: "GetYourOwnPassword"
i2c:
scan: true
sensor:
- platform: pmsa003i
pm_1_0:
name: "PM1.0"
pm_2_5:
name: "PM2.5"
pm_10_0:
name: "PM10.0"
pmc_0_3:
name: "PMC >0.3µm"
pmc_0_5:
name: "PMC >0.5µm"
pmc_1_0:
name: "PMC >1µm"
pmc_2_5:
name: "PMC >2.5µm"
pmc_5_0:
name: "PMC >5µm"
pmc_10_0:
name: "PMC >10µm"
- platform: ens160
eco2:
name: "eCO2"
tvoc:
name: "Total Volatile Organic Compounds"
aqi:
name: "Air Quality Index"
update_interval: 60s
address: 0x53
compensation:
temperature: id_temperature_sensor
humidity: id_humidity_sensor
- platform: scd4x
co2:
name: "CO2"
temperature:
name: "Temperature"
id: "id_temperature_sensor"
humidity:
name: "Humidity"
id: "id_humidity_sensor"
- platform: absolute_humidity
name: Absolute Humidity
temperature: id_temperature_sensor
humidity: id_humidity_sensor