Raspberry Pi Pico weather display (MicroPython)
Your first MicroPython project: temperature and humidity on an OLED.
Shop by category
Shop all componentsThe LDR module reports dark or light and the Pico fades a 16-LED ring smoothly towards warm white or off. MicroPython includes a neopixel driver, so there is nothing extra to install.
Tick anything you already have and the total updates.
Light-dependent resistor with a comparator: its output flips when the light falls below the level set by the trimmer.
Sixteen individually addressable RGB LEDs on one data wire.
Follow the colours: red is power, dark grey is ground, blue is a signal.
main.py# Pico night light: LDR module + WS2812 ring (MicroPython, built-in neopixel module)
from machine import Pin
import neopixel
import time
ldr = Pin(14, Pin.IN) # module DO: 1 = dark on most boards
ring = neopixel.NeoPixel(Pin(15), 16)
level = 0 # 0..255 current brightness, for a gentle fade
while True:
target = 120 if ldr.value() == 1 else 0
level += (target - level) // 8 or (1 if target > level else -1 if target < level else 0)
for i in range(16):
ring[i] = (level, level * 2 // 3, level // 4) # warm white
ring.write()
time.sleep(0.03)
Some modules invert DO. Change == HIGH to == LOW in the code.
Add the 330 Ω resistor in series with DIN and share GND with the board.
6 parts: Digital LDR Light Sensor Module – LM393, 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 ₹579 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.
Addressable LEDs and colour mixing; Thresholds set in hardware vs software.
Ideas that reuse this build: Arduino relay version. 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.
Turn a Pi and a touchscreen into a home command centre with a clock and to-do list.
Logs every movement in a room with a timestamp, ready for a spreadsheet.
Learning project. Check every circuit and the datasheet of each part before you power it up.