Create an indoor air quality monitor station with tinkerforge.com bricklets and a raspberry pi zero.
The station uses an Integrated Air Quality (IAQ) sensor (BME680) and a CO2 sensor (SCD30) to monitor air quality inside the room. An alert sound is generated, when both sensors detect bad air quality. The alert level can be adjusted via setup. The project is based on a modification of the Tabletop Weather Station.
![Image 2](/images/IMG_6940.png width="70" height="70")
A graph is plotted for both sensor outputs (IAQ and CO2):
The air quality - especially inside classrooms - came into focus in relation with aerosol formation causing Covid 19 infections. Monitoring can provide data to ensure in time room ventilation. Good air quality can be achieved and aerosol formation can be avoided.
Indoor air quality characteristic is related to CO2-concentration and Air Quality Index. The different quality ranges are illustrated below.
The CO2 Bricklet (SCD30) provides the CO2 concentration in ppm. The Bricklet also measures temperature and humidity. These values are used for internal compensation and can additionally be read out.
The IAQ index is a measure for the quality of air. To calculate the IAQ index the Bricklet (BME680 detects ethane, isoprene (2-methylbuta-1,3-diene), ethanol, acetone and carbon monoxide (often called VOC, volatile organic components) by adsorption. These gas measurements are combined with the measurements of air pressure, humidity and temperature to calculate the final IAQ index.
There are 3 alert level available via setup. Preset is level 3.
Alert level | CO2 (ppm) | IAQ |
---|---|---|
3 | 2000 | 200 |
2 | 1500 | 150 |
1 | 1000 | 100 |
Here you find the plot of data recorded during one day inside the living room. You can easily recognize the moment when ventilation was initiated.
Before starting the project you should get the following parts from tinkerforge shop:
Quantity | Part | Price (in €) |
---|---|---|
1 | CO2 Bricklet 2.0 | 89.99 |
1 | Air Quality Bricklet | 29.99 |
1 | LCD Bricklet 128x64 | 32.99 |
1 | HAT Zero Brick | 14.99 |
1 | Tabletop Weather Station | 15.99 |
4 | Bricklet Cable (7p - 7p) | 0.79 |
1 | Mounting Kit 12 mm | 1.69 |
2 | Mounting Kit 9 mm | 1.69 |
1 | Mounting Kit for Raspberry PI Zero | 1.99 |
Further you need the following parts for the raspberry. A raspberry zero wm is recommended because it fits into the tabletop station enclosure:
Quantity | Part | Price (in €) |
---|---|---|
1 | Raspberry Pi Zero WM | 19.99 |
1 | USB A to USB micro cable | 3.99 |
1 | SD Card 16 GB | 12.99 |
1 | USB Power Supply | 6.99 |
Assembly of the station is in analogy to the Tabletop weather station. You should fix the raspberry zero with double-sided adhesive tape. Be careful not damaging the bricklet cables.
The best way to install the necessary software on Raspberry is to prepare the SD card on a PC or Mac. Use Raspberry Pi Imager. Then prepare the image for headless operation of the raspberry (ssh and vnc). It is recommended to set up also your Wifi preferences, the pi zero has no ethernet port.
When you have got remote access to your raspberry, install the Python IDLE next. You further have to set up the tinkerforge Brick Deamon and Brick Viewer. You can now test the HAT connection and the Bricklet functionality. Write down the UID's of the HAT Brick and all Bricklets. You have to enter the UID's in he Python Code before running the program.
Before you can run the application you have copied from this site please install the API for Python.
To autostart the python program after rebooting you can add a line in crontab. So, you don't have to start the Python code remotely over VNC.
I'm happy to help if there are any questions.
It would be great to see how others use the project. So please contribute!