This folder contains all the code necessary to run the CO2 monitor and send data to an MQTT broker.
The components I'm using in this project are as follows. All of these can be found quite easily online for purchase.
- RPI SHD CO2 Sensor (Raspberry Pi CO2 Sensor Breakout board)
- I2C OLED Display
- Double Sided PCB Boards
NB: This assumes you are using the same sensor & OLED display as I am in this project. If you are using somethign different, you will have to modify the code accordingly.
To connect the pico and test this project, I used Thonny. Some of the below packages you may be able to install directly from Thonny, however if not you should be able to install them via the python REPL.
ssd1306
- Micropython Packageupip
- Micropython Packagemicropython-umqtt.simple
- Simple MQTT Clientmicropython-umqtt.robust
- Robust MQTT Client
From the Python REPL, enable and connect to wifi, and install the following package.
import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(ssid, password)
import upip
upip.install('micropython-umqtt.simple', '/lib')
upip.install('micropython-umqtt.robust', '/lib')
After installing these you can copy the contents of main.py
onto your own pico and run it.