Raspberry Pi Pico weather display (MicroPython)
Your first MicroPython project: temperature and humidity on an OLED.
Shop by category
Shop all componentsA glowing thermometer you can read across the room. The DS18B20 probe measures the temperature, and the program lights a proportional part of the 12-LED ring in colours that go from green to red. Use it by the fridge, the aquarium or the baby's room.
Tick anything you already have and the total updates.
Waterproof stainless-steel probe that reads liquid or soil temperature from −55 to +125 °C (±0.5 °C).
Sixteen individually addressable RGB LEDs on one data wire.
4.7 kΩ pull-up between DATA and VCC; 330 Ω in series with DIN
Follow the colours: red is power, dark grey is ground, blue is a signal.
main.py# Pico thermometer ring: a NeoPixel ring that lights more LEDs as it gets warmer (MicroPython)
from machine import Pin
import neopixel, onewire, ds18x20, time
N = 12
ring = neopixel.NeoPixel(Pin(15), N)
ow = ds18x20.DS18X20(onewire.OneWire(Pin(14)))
probes = ow.scan()
COLD_C, HOT_C = 20, 40 # nothing lit at 20 C, all lit at 40 C
def colour(i):
f = i / (N - 1) # 0 at the first LED, 1 at the last
return (int(80 * f), int(80 * (1 - f)), 0) # green to red, kept dim to save the supply
while True:
ow.convert_temp()
time.sleep_ms(750)
t = ow.read_temp(probes[0])
lit = int(max(0, min(1, (t - COLD_C) / (HOT_C - COLD_C))) * N + 0.5)
for i in range(N):
ring[i] = colour(i) if i < lit else (0, 0, 0)
ring.write()
print("%.1f C %d LEDs" % (t, lit))
time.sleep(1)
The 4.7 kΩ pull-up is missing or DATA is on the wrong pin. Check the yellow wire.
Add the 330 Ω resistor in series with DIN and share GND with the board.
6 parts: DS18B20 Waterproof Temperature Probe – 1m Cable, WS2812 RGB LED Ring (16 LEDs), Resistor Assortment Kit (30 Values), Raspberry Pi Pico, Solderless Breadboard (830 points) and Dupont Jumper Wires (40 pcs). Tools: Digital Multimeter and Wire Stripper and Cutter. On this page you can tick the parts you already have and add only the rest to your cart.
It is a beginner project and takes about 45 minutes. The build on this page has 4 steps.
No. This page has the complete, tested code (main.py).
About ₹598 for the parts at the prices on this page, plus tools if you do not have them. Quantity price breaks lower the cost when you build several.
1-Wire bus and pull-up resistors; Addressable LEDs and colour mixing.
Ideas that reuse this build: Pico rainbow LED ring and Pico room climate OLED. They are listed under Take it further on this page.
Your first MicroPython project: temperature and humidity on an OLED.
A web page with ON and OFF buttons that switches a relay over Wi-Fi.
A warm ring light that fades up at dusk and down at dawn.
Turn a Pi and a touchscreen into a home command centre with a clock and to-do list.
Learning project. Check every circuit and the datasheet of each part before you power it up.