WS2812B NeoPixel ring
A ring of addressable RGB LEDs (WS2812B): with ONE pin you choose the color of each LED. The neopixel module already comes in the MicroPython firmware. You change the colors in memory (np[i] = (r, g, b)) and send everything at once with np.write(). Watch the current draw: many LEDs at strong white exceed what the USB can supply — use low brightness.
Pinout
| Pin | Connect to | Note |
|---|---|---|
| DIN | GPIO (e.g. 5) | data input of the first LED |
| 5V | VIN (5 V) | |
| GND | GND | the same GND as the ESP32 |
| DOUT | DIN of the next ring/strip | daisy chain; can be left unconnected |
The AI that remembers your life and lives on your computer
- Long-term memory with the source of every answer
- Works offline: your data stays on your PC
- Reads PDFs, slides, photos and meeting recordings
Essential plan free forever
MicroPython example
from machine import Pin
import neopixel
import time
np = neopixel.NeoPixel(Pin(5), 12) # DIN on GPIO5, 12-LED ring
np[0] = (255, 0, 0) # LED 0 red (r, g, b from 0 to 255)
np.write() # only shows after write()
time.sleep(1)
# a green dot going around the ring
while True:
for i in range(12):
np.fill((0, 0, 0))
np[i] = (0, 40, 0) # low brightness spares the USB
np.write()
time.sleep(0.1)
Specifications
| Item | Value | Source |
|---|---|---|
| Pins | DIN, 5V, GND, DOUT | Typical datasheet values |
| Current draw | up to ~60 mA per LED at full white (rule consumo-usb) | Typical datasheet values |
| Daisy chain | DOUT of one goes to the DIN of the next | Typical datasheet values |
| Driver | neopixel (already in the firmware) | Docs.micropython.org/en/v1.29.0/esp32/quickref.html (NeoPixel driver) |
| LEDs on the ring | 8, 12, 16 or 24 | PyPlaca component catalog — Under review: quantities of the lab rings |
| DIN level with the ESP32 (3.3 V) | the simulator accepts it | Under review: input threshold of the WS2812B powered with 5 V |
| LED 0 position | at the bottom, next to the pads; counting clockwise | Under review: check on the lab ring |
Values marked "Under review" will still be checked against the parts in the lab.