This project is for an Indoor Air Quality Monitoring System using inexpensive components. Consumer IAQ meters can be purchased for $50, however most units cost over $100. This project shows you how to build a device that will display an IAQ reading based on the Total Volatile Organic Compounds (TVOCs) present in an indoor environment.
The BME680 sensor is designed for measuring static IAQ and also gives highly accurate measurements of changes in barometric pressure. A small OLED was chosen for enhanced visibility. The DAC, QT Touch, and onboard LED features of the XIAO SAMD21 allow this project to add more interactive features in future versions.
This design uses a 0.96" 128x64 OLED display, both the sensor and display connect to the XIAO SAMD21 using I2C.
MCU: Seeed Studio XIAO SAMD21 (Seeeduino)
Sensor: BME680
Screen: 0.96" Blue/Yellow 128x64 Pixel OLED
The XIAO SAMD21 from Seeed Studio uses an ARM Cortex M0+ design that has "multiple development interfaces: 11 digital/analog pins, 10 PWM Pins, 1 DAC output, 1 SWD Bonding pad interface, 1 I2C interface, 1 UART interface, 1 SPI interface."
The XIAO SAMD21 also has 4 onboard LEDs! The combination of DAC, QT Touch and LEDs seems perfect for projects that incorporate Sound, haptics, and visual cues in an affordable package. Getting into bootloader mode requires manually shorting the two pads visible in the picture below (guide in the above link).
I chose to try the XIAO SAMD21 after using the more powerful XIAO ESP32-S chips and appreciate the range of features throughout the XIAO lineup.
The Bosch BSEC algorithm measures Volatile Organic Compounds against a profile that is described as 'breath-VOC' in this post from the uThing documentation. The static IAQ metric is based on TVOC levels Bosch documentation states that the iaqAccuracy function will display '2' after calibration however I have not seen this. Attune has this great post with further information on the risks of poor indoor air quality due to TVOCs. Ventilation is an important part of indoor air quality and measuring TVOC levels can measure if HVAC systems are effective.
The fact that the iaqAccuracy metric doesn't move to display '2' after the calibration period caused this thread to descend into a small yet invigorating flame war on Adafruit's Forum. User snurt actually accuses Adafruit of damaging the sensor and is met with an appropriate response. My opinion is the iaqAccuracy metric is buggy and I plan to post about that on the Bosch forum here.
The BME680 sensor gives highly precise readings for barometric pressure that can be used to create weather forecasting metrics. I have been using the DIY-IAQ monitor shown in this tutorial since the end of September and am very happy with the performance.
There is some criticism online of the sensor for giving temperature readings that are +1C than expected. While beyond the scope of this tutorial, it seems possible to optimize the algorithms in the sensor libraries if you wish to adjust readings before displaying them.
I chose a version with Blue/Yellow pixels and any will work. This is a fairly common 4-pin I2C display and there may be variance between manufacturers. I sourced displays from Amazon for this project at a unit cost of under $3 each. I used the Adafruit_SSD1306 library for this Arduino project and it worked well. There are many files included in that library which is why the repo codebase only contains the sketch and bsec.h for now.
Challenges with Bosch Code & DocumentationI bought the BME680 sensors without fully considering the code license. The BSD-3-Clause license is good because it is open-source as long as you include a header of about 40 lines in any distribution.
Go here for all of the Bosch Sensortec Documentation and Code on BME680, you will need to sign a release. My repository includes bsec.h and two reference documents. Bosch includes a 60pp BSEC Integration Guide as part of the zip file which describes granular control over the sensor with examples of data structures.
Assembly Instructions | First BuildThe first build of the DIY-IAQ monitor uses a half breadboard to hold the XIAO SAMD21 MCU, a BME680 sensor, and a 0.96" 128x64 OLED display. Connect A4/A5 pins on the XIAO to SDA/SCL pins on the BME680 as described above. Connect the SDA/SCL pins from the display on the breadboard directly behind the BME680's SDA/SCL pins.
Connect the GND and 3v3 pins on the XIAO to the breadboard rail. Connect the VCC and GND pins from the display and sensor to the rail so they are powered by the XIAO. Plug a USB-C cable into the XIAO and then into a USB port or powerbank. Upon initial use the BME680 calibrates itself by heating the sensor for 48-72 hours. Post-calibration the 'iaqAccuracy' metric moves from '0' to '1' approximately 5 minutes after the XIAO is plugged in to a source of power.
Data Collection & Other FeaturesI'm learning MQTT now to record environmental data using an online platform. My goal is to create a small feature list that improves the display and adds weather forecasting metrics. The XIAO SAMD21 can act as a DAC enabling the addition of audio features to the project.
The DIY-IAQ shows elevated IAQ readings when I am using my Anycubic resin printer. IAQ levels show water-soluble resin results in a lower level than UV resin, and I am comfortable using the UV resin inside because the IAQ doesn't go over 110. This evidence reinforced the importance of waiting to print other materials like ASA and ABS until I install an exhaust and/or filter. I believe the BME680 sensor is accurate overall.
I created a basic enclosure and will add the STL file to this project after modifying the USB-C Port. I am designing a top to the enclosure that can be printed in clear PLA or cut out of acrylic. Please note that the XIAO SAMD21 does not have a power regulation feature, so it is not safe to add a battery and charge it via the USB-C port on the XIAO.
Thank you for reading my project, I hope you enjoy building the DIY-IAQ Indoor Air Quality Monitoring System!
Comments
Please log in or sign up to comment.