Video goes here
Add youtube: VIDEO_ID to this page's front matter. The video loads when a reader presses play.
What you will do
- Work out how much current 200 pixels can draw and pick a 5 V supply
- Inject power along the strand so the far end stays the right color
- Wire the data line with a level shifter, a resistor, and a capacitor
Bill of materials
| Item | Part | Qty | Notes |
|---|---|---|---|
| 1 | ESP8266 or ESP32 development board | 1 | Any board with a free GPIO pin and a USB port |
| 2 | 200 addressable pixels, 5 V WS2812B type | 200 | Strips, strings, or loose pixels all work. Check the voltage on the label. |
| 3 | 5 V DC power supply, 10 A or larger | 1 | Sized in step 1. Use an enclosed supply. |
| 4 | 74AHCT125 level shifter | 1 | Turns the board's 3.3 V data into a clean 5 V signal |
| 5 | Resistor, 330 to 470 ohm | 1 | Goes in series with the data wire |
| 6 | Electrolytic capacitor, 1000 uF, 10 V or higher | 1 | Across the power input at the first pixel |
| 7 | Stranded wire, 16 to 18 AWG, red and black | 1 | For power. About 3 m total. |
| 8 | Inline fuse holder and fuse | 1 | Rated for your supply's output |
| 9 | Screw terminal block or lever connectors | 3 | For the power injection points |
Tools Wire strippers Screwdriver Multimeter Soldering iron
0 of 0 checklist steps done
A single string of 200 pixels looks simple, but it can pull more current than any USB port or development board can give. This part gets the power and data wiring right, so the sketches in the next parts behave the same way every time.
Step 1: Work out the power budget#
Each pixel has three tiny LEDs. At full white, with all three on, one pixel can draw about 60 mA. Multiply that by the number of pixels to get the worst case.
| Pixels | Worst case at full white | Supply to buy |
|---|---|---|
| 50 | 3 A | 5 V, 5 A |
| 100 | 6 A | 5 V, 8 A |
| 200 | 12 A | 5 V, 10 to 15 A |
Real animations almost never light every pixel at full white. The sketch in the next part caps the brightness, which lets a 10 A supply run 200 pixels comfortably. If you want headroom to go brighter later, buy the larger supply now.
- Count your pixels and write the number down
- Multiply by 0.06 to get the worst-case amps
- Pick a supply rated at or above your planned brightness
Step 2: Fuse and connect the supply#
Put the fuse in the red wire, as close to the supply as you can. The fuse protects the wire. If something shorts, the fuse opens before the wire gets hot.
- Cut a length of red and a length of black wire for the supply side.
- Fit the fuse holder in the red wire.
- Connect red to the supply's +V terminal and black to -V (also marked COM).
- Leave the supply unplugged.
- Fuse installed in the red wire
- Red on +V, black on -V, screws tight
- Supply still unplugged
Step 3: Inject power along the strand#
Power drops as it travels down a long string of pixels. The far end gets less voltage, and the colors there turn orange or dim. The fix is to feed power in at several points, not only at the start.
For 200 pixels, feed power at the start, about a third of the way in, about two thirds of the way in, and at the far end. Each feed runs back to the supply on its own pair of wires.
- Run a red and black pair from the supply to the first pixel.
- Run another pair to pixel 67 or so, and another to pixel 134.
- Run one more pair to the last pixel.
- Join all the red wires at the supply with a terminal block, and all the black wires the same way.
- Four red and black pairs run from the supply
- Reds joined together, blacks joined together
- Capacitor fitted across red and black at the first pixel, stripe on the black side
Step 4: Wire the data line#
The pixels listen for a 5 V signal, but the board puts out 3.3 V. Many pixels work with that, and many fail in odd ways. A level shifter makes it reliable.
- Power the 74AHCT125 from the same 5 V as the pixels.
- Connect the board's data pin to one input on the level shifter.
- Connect that gate's output through the 330 to 470 ohm resistor to the first pixel's data input.
- Tie the level shifter's output-enable pin to ground so the gate stays on, and tie the unused inputs to ground.
Now join the grounds. The supply ground, the pixel ground, the level shifter ground, and the board's ground must all connect together. Without a shared ground the data signal has no reference, and the pixels flicker or show random colors.
Step 5: Check it before you program it#
Use the multimeter before the first power-up.
- With everything unplugged, measure resistance between red and black at the first pixel. It should not read as a short.
- Plug in the supply and measure voltage at the first pixel and at the last pixel. Both should read close to 5 V.
- Unplug the supply again before changing anything.
- No short between red and black
- About 5 V at the first pixel
- About 5 V at the last pixel
Troubleshooting#
The last pixels look orange or dim. Voltage is dropping along the strand. Add another power injection point near the dim section.
The first pixel flickers or shows random colors. Check the shared ground first. Then check that the resistor is in the data line and the level shifter has power.
The supply clicks on and off, or the lights reset. The supply is too small for the brightness you are asking for. Lower the brightness in code or use a larger supply.
Nothing lights. Check the data direction. Pixels have an input end and an output end, usually marked with an arrow. Data must enter at the input end.
What is next#
With power and data wired, the next part loads a first test sketch and lights the whole string with a moving rainbow. See Part 2: Hello, pixels.
Got stuck, or got a different result?
Leave a comment on the video with what you see. Include your board, your power supply, and what you see happening.
Open the video comments