Air Quality Monitor With Raspberry Pi RP2040
by gubutek in Circuits > Microcontrollers
31 Views, 1 Favorites, 0 Comments
Air Quality Monitor With Raspberry Pi RP2040

)
This is the final version with PCB, display, sensor and casing improvement. I used RP2040-Zero micro-controller to gather data from
1. PMS5003ST particulate matter, formaldehyde, humidity and temperature sensor
2. SGP30 air quality sensor (CO2eq and TVOC) The results are displayed on 2.2" LCD screen.
There are also reserved slots for future expansion with extra sensors
You can download all the files from my Github
Supplies
This is a mini version of RP Pico. It fits small project better because you don't need to use all the GPIO anyway. You will have a compact design using this. More important is the price, this one is cheaper that the original Pico.
This LCD will have alot of space for all the information provided by the sensors
You can measure particulate matter level with this one. It also measure the formaldehyde concentration as well as temperature and humidity. This can be replaced by PMS5003 + SHT31 but you won't be able to get the formaldehyde level.
This is Multi-gas (VOC and CO₂eq) sensor.
You will need some tool and material for soldering
- Wires and female headers for the circuit.
- Soldering iron
- Cutter
- M2 screws for assembling the unit
3D Printing Case and Support

I packed everything in the case which has a lot of holes for better air circulation. The STL files are provided so you can print it if you wanna make one.
I also designed support pieces for the LCD. You will need to 3d print and add them to the LCD.
Get the PCB


This unit uses LCD and PMS5003ST. There are a lot of wiring so handmade control board is not an option. I designed the PCB with KiCAD. You can use the Geber files to order PCB from any manufacture. The first thing is to solder all the sockets and headers for all the components.
Assemble







There are 2 main groups to assemble
Group 1 includes
- Main PCB
- RP-2040 Micro controller
- LCD
- Front part of the case
Group 2 are for
- PMS5003ST sensor
- SGP30 sensor
- Back part of the case
There are two I2C buses in the RP2040. According to my test, the SGP30 works well with the I2C1. The I2C0 can be reserved for any extra I2C sensor.
Then you can assemble the front and back case together
Add the Code and Test

In the python code LCDSgp30Pms5003st.py, you will need to add the libraries for the sensors we used as well as the LCD screen
- pms5003st.py
- adafruit_sgp30.py
- ili9225.py
- myfont20sb.py
You can use any program to add the code LCDSgp30Pms5003st.py on RP2040-Zero (I used Thorny)
All the code is uploaded on my Github
Modification and Future Development

As you can see the new version cost a lot more because of the PMS5003ST sensor.
The price is 85.5 for main components only compared to the 13.25 of version 2. That is for the particular matter and formaldehyde function.
You can reduce the cost by using the PMS5003 and SHT31 together and the cost will be around 57 CAD (version V2.5) and you won’t have the formaldehyde level. Actually, you will only need that if you have 3D printer running around you.
For normal air monitors the V2 or V2.5 should be enough. I would add another CO sensor in the future as well as gas sensor cause I have a gas furnace running. The beauty of this new PCB is that you can add more sensors if needed. There are two I2C ports on the PCB for any extra sensors.
Enjoy
That's all for today. I hope you can learn more about this microcontroller as well as those sensors. Feel free to play with the code. Happy making!