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

IMG_1790.JPG
Air Quality Monitor (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

RP2040-Zero

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.

LCD 2.2"

This LCD will have alot of space for all the information provided by the sensors

PMS5003ST

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.

SGP30

This is Multi-gas (VOC and CO₂eq) sensor.


You will need some tool and material for soldering

  1. Wires and female headers for the circuit.
  2. Soldering iron
  3. Cutter
  4. M2 screws for assembling the unit

3D Printing Case and Support

Capture.PNG

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

vlcsnap-2025-04-24-12h04m17s527.png
vlcsnap-2025-04-24-12h05m39s592.png

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

vlcsnap-2025-04-24-12h05m39s592.png
vlcsnap-2025-04-24-12h07m01s930.png
vlcsnap-2025-04-24-12h09m19s842.png
vlcsnap-2025-04-24-12h10m29s664.png
vlcsnap-2025-04-24-12h11m13s846.png
vlcsnap-2025-04-24-12h11m26s984.png
vlcsnap-2025-04-24-12h12m29s943.png

There are 2 main groups to assemble

Group 1 includes

  1. Main PCB
  2. RP-2040 Micro controller
  3. LCD
  4. Front part of the case

Group 2 are for

  1. PMS5003ST sensor
  2. SGP30 sensor
  3. 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

IMG_1782b.JPG

In the python code LCDSgp30Pms5003st.py, you will need to add the libraries for the sensors we used as well as the LCD screen

  1. pms5003st.py
  2. adafruit_sgp30.py
  3. ili9225.py
  4. 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

price.jpg

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!