← PS-3 · THE BITSY BOARD CHALLENGE

WS2812 done right

YOU WILL BE ABLE TO
  • Explain one-wire addressable control at block level.
  • Justify the data resistor and the bulk capacitor the generator insists on.
  • Work the power budget for eight pixels and state the firmware contract.
  • Read the strip's three-component construction in the schematic.

The rainbow pixels are the Bitsy's flashiest subsystem and its most instructive: eight full-colour LEDs, one GPIO. Each WS2812 pixel contains its own driver chip; data enters the first pixel at 800 kHz on a single wire, the pixel keeps its first 24 bits — eight each of green, red, blue — and regenerates the rest downstream. The chain is a shift register you can see. One pin, because the pixels do the work.

The generator will not give you a bare strip, and the two extra components are the lesson. A roughly 330 ohm DATA RESISTOR sits between GP16 and the first pixel's DIN: the line carries fast edges into a stub of wire, and the resistor damps ringing and shields the first pixel's input from spikes when supplies come up in the wrong order. And a 100 uF BULK CAPACITOR sits across the strip's power: every pixel switches its LEDs at once, and the capacitor answers the surge locally so the rail does not sag. Your spec names both — data_resistor and decoupling are required fields, and forgetting them earns "U2: ws2812_strip8 requires data_resistor" and "U2: ws2812_strip8 requires decoupling" — and the schematic shows chip, resistor, capacitor: 3 components, 6 traces.

Now the budget, because eight pixels can OUT-EAT the board. Full white, full brightness is roughly 8×60=480 mA8 \times 60 = 480\,\text{mA} — against a 3.3 V rail whose guidance is about 300 mA for everything, radio included. The hardware is not broken; the CONTRACT is that firmware keeps brightness inside the budget, and the bulk capacitor smooths the peaks that remain. This is the third time power has bounded a design in this track — the transistor's load, the servo's stall, the pixels' white — and it will not be the last: current budgets, not pin counts, are what actually limit small boards.

WORKED EXAMPLE

Budget math

  1. The classroom effect runs all eight pixels at one-quarter brightness, with mixed colours averaging half of full white's current at that setting. Estimate the draw.
  2. Full white, full brightness: 8×60=480 mA8 \times 60 = 480\,\text{mA}.
  3. Scale it: 480×0.25×0.5=60 mA480 \times 0.25 \times 0.5 = 60\,\text{mA} — one-fifth of the rail guidance.
  4. Comfortable — and the reason "dim and colourful" is the firmware default.
About 60 mA.

PRACTICE

Q1

Why does adding a ninth pixel cost zero additional GPIOs?

Q2

Name the two generated companions and give one sentence each on their job.

Q3

Which required fields does ws2812_strip8 add beyond pin, and which check enforces them?

Q4

Full red at full brightness on all eight: estimate and verdict.

WS2812 done right · PS-3 · iLearnSTEM Electronics