Reads temperature (°C) and humidity (%) values using a DHT22 sensor and displays them over the serial console.
| DHT22 Pin | Pico W Pin | Description |
|---|---|---|
| VCC | 3.3V | Power |
| DATA | GPIO16 | Sensor Data |
| GND | GND | Ground |
| (Optional) | 10kΩ resistor between VCC and DATA | Pull-up for stable readings |
The DHT22 is a digital sensor that measures:
- Temperature (range: -40°C to +80°C)
- Humidity (range: 0% to 100%)
The Pico W communicates using single-wire timing via MicroPython’s dht module.
- Flash MicroPython firmware to your Pico W
- Open Thonny IDE → select MicroPython (Raspberry Pi Pico)
- Save the code as
main.pyon the Pico W - Open the Shell window → View live sensor readings every 2 seconds
- Display readings on SSD1306 OLED
- Send data over Wi-Fi to a web dashboard
- Log data to an SD card