peplow labs

Why I stopped feeding WS2812 data from 3.3 V

· 3 min read · #led #rp2040 #micropython

Moved from the old blog in October 2026. Schematic redrawn, the old one was a photo of paper.

Short note, because I keep explaining this to people.

The WS2812B datasheet says the input high level is at least 0.7 × VDD. With VDD = 5.0 V that is 3.5 V. An RP2040 or ESP32 gives you 3.3 V at best, a bit less under load. So by the datasheet it should not work at all. In practice it often works, because the real threshold of most chips is lower than the guaranteed minimum. “Often” is the problem.

I tested three things I had in the drawer, with a Pico driving the data line directly from GP16, and a lab supply for the LEDs:

Strip 4.7 V 5.0 V 5.2 V
A: 60 LED/m, bought 2019 ok ok first LED flickers
B: 144 LED/m, 2023 ok random colours, first 1–3 LEDs wrong colours everywhere
C: ring of 16, “V5” on the reel ok ok ok

0.7 × VDD for these voltages is 3.29 V, 3.50 V and 3.64 V. The pattern fits: higher supply, higher threshold, more errors. 4.7 V is what I get from a USB port through a thin cable, so on the desk everything worked. On the balcony the same strip got a proper 5.2 V power supply and went crazy.

Interesting detail: errors appear mostly at the first LED. Every WS2812 regenerates the signal for the next one at its own 5 V level, so only the first chip sees the weak 3.3 V input. If the first LED decodes a bit wrong, the wrong data goes down the whole chain.

The fix

A 74AHCT125 between the MCU and the strip, powered from 5 V. The “T” is important: AHCT has TTL input levels, so 2.0 V is already a valid high, even at 5 V supply. A plain 74HC125 at 5 V has the same 3.5 V problem as the LED. I tried a 74HC first because I had it, of course it didn’t help.

74AHCT125 level shifter between the Pico and the strip

The circuit I use now. R1 330 Ω close to the strip end of the wire, C2 across the strip supply.

Other options that also work:

  • SN74AHCT1G125, the single gate version in SOT-23-5, if you have only one strip.
  • The “sacrificial pixel”: power the first LED through a diode (1N4001, about 0.7 V drop). Its VDD is 4.3 V, threshold 3.0 V, and it regenerates a proper 5 V signal for the rest. Ugly, but needs no IC.
  • Run everything at 4.7 V. Works, but the blue LEDs get visibly weaker and you depend on the supply staying low.

Test code

MicroPython on the Pico. Every 8th pixel white, the rest dim red. If the data is corrupted you see it immediately: green or blue pixels appear where nothing should be.

from machine import Pin
import neopixel
import time

N = 60
np = neopixel.NeoPixel(Pin(16), N)

def pattern(level=40):
    for i in range(N):
        if i % 8 == 0:
            np[i] = (level, level, level)
        else:
            np[i] = (level // 4, 0, 0)
    np.write()

while True:
    pattern()
    time.sleep_ms(20)   # refresh often, so flicker is easy to see

With the 74AHCT125 in place, strip B at 5.2 V ran the pattern for a full night without one wrong pixel. Without it, the first wrong colour appeared after a few seconds.

Questions or corrections: marek@peplow-labs.info. There are no comments here, but I read the mail.