NeoPixel ring (12)
The NeoPixel ring is twelve WS2812B LEDs laid out in a circle, pixel 0 at the top and the rest running clockwise. It costs $10, is wired exactly like the stick — one data line, one 5 V supply — and speaks the same neopixel.NeoPixel API, so anything you write for one runs on the other by changing the pixel count. It suits clocks, dials, VU meters and anything that wants an angle.
Pins
| Pin | What it is | Type |
|---|---|---|
| DIN | Data in (800 kHz) | io |
| 5V | Supply 5 V | power |
| GND | Ground | ground |
| DOUT | Data out, to the next board's DIN | io |
DIN receives the 800 kHz data stream, DOUT forwards the leftover bytes to the next board, and 5V/GND power the ring. On a real Pi the data line lives on GPIO18 (PWM), which the neopixel library uses under the hood.
Wiring it in circuit.py
from wiring import *
pi = Pi()
ring = NeoPixelRing()
pi.GPIO18 >> ring.din
pi.V5 >> ring.v5
ring.gnd >> pi.GNDChain a stick and a ring by wiring the first board's DOUT to the second's DIN; the second board's pixels start at index 12. Keep the 5 V and GND wires shared and short.
Driving it in main.py
import board
import neopixel
from time import sleep
pixels = neopixel.NeoPixel(board.D18, 12, auto_write=False)
pixels.brightness = 0.3
while True:
for tick in range(12):
pixels.fill((0, 0, 0))
pixels[tick % 12] = (0, 80, 200)
pixels[(tick + 6) % 12] = (200, 0, 0)
pixels.show()
sleep(0.15)The ring is just a list of 12 pixels; math.sin and friends turn a list index into a position on the circle.
Electrical notes
- Twelve LEDs at full white draw up to
12 × 60 = 720 mAfrom 5 V, plus about 12 mA idle. That is well past what a Pi header should supply continuously — a separate 5 V supply with a common ground is the right answer, and the simulator warns above 1 000 mA. - Everything else matches the stick: 20 mA per channel nominal, 800 kHz data rate, GRB byte order, and a data line that prefers 3.5 V or more at a 5 V supply.
- Keep brightness below 1.0 when many pixels are white; the judge only fails on damage, but the power meter and the warning are there to teach the real budget.
Simulator vs real hardware
- The part consumes 12 pixels' worth of the data stream and forwards the rest through
DOUT; pixel 0 is at the top of the canvas and indices run clockwise, matching the real board's silkscreen. - Current follows the same model as the stick: idle current plus channel sum, measured against the 5 V rail.
- Protocol timing and root requirements are simulated away; on a bench you would also see a first-pixel glitch if the data line is too long, and voltage drop around the ring on thin wires.
brightnessscales all channels in the simulator exactly as the library does before sending.
Going deeper
- NeoPixel stick (8) — the same part in a row, with the wiring details spelled out.
- neopixel library for
fill, slices andauto_write. - Recipe: the NeoPixel level meter lights a bar; point it at the ring and bar indices become an angle.
- 5 V power budgets: see the breadboard power supply.
Further reading
- WS2812B datasheet (Worldsemi) — the LED controller inside every pixel.
- Adafruit CircuitPython NeoPixel API —
NeoPixel,brightnessandshow(). - Adafruit NeoPixel Überguide — power injection, level shifting and wiring rings.