Skip to content

Instantly share code, notes, and snippets.

Sensirion SCD30
https://www.mouser.co.uk/ProductDetail/Sensirion/SCD30?qs=rrS6PyfT74fdywu4FxpYjQ%3D%3D
Raspberry Pi Pico (U1)
https://www.raspberrypi.org/products/raspberry-pi-pico/
0.96 OLED SSD1306 (U2)
https://www.amazon.co.uk/SSD1306-Self-Luminous-Display-Compatible-Raspberry-Blue-Yellow/dp/B08FD643VZ/
(other versions are available - make sure the pins are in the order: GND, VCC, SCL, SDA when viewed from the screen
# Requires the following micropython libraries - install these to the Pi Pico with Thonny
# errno, ffilib, os, scd30, signal, ssd1306, stat
# Rename this file to "main.py" and save to the Pico so that it runs automatically on power on.
import time
import math
from machine import Pin, I2C
from machine import WDT
from scd30 import SCD30
from ssd1306 import SSD1306_I2C