Neopixel Current

Adafruit’s Neopixels are RGB LEDs with a built-in current-limiting 400 Hz PWM controller and a serial data link. Successive Neopixels aren’t synchronized, so their PWM cycles can produce serious current spikes.

Lighting up just the red LED in two Neopixels at PWM 16/255 produces this current waveform (at 10 mA/div):

Neopixel current 10 mA - 16-0-0 0-1
Neopixel current 10 mA – 16-0-0 0-1

Each red LED draws about 20 mA, so when the two Neopixel PWM cycles coincide, you get a nasty 40 mA spike. When they don’t coincide, you get a pair of 20 mA pulses. Those pulses walk with respect to each other at a pretty good clip; the oscillators aren’t trimmed to precision.

Lighting up three Neopixels with PWM 16/255 on the red does exactly what you’d expect. The horizontal scale  is now 100 µs/div, making the PWM pulses five times wider:

Neopixel current 10 mA - 16-0-0 0-1-2
Neopixel current 10 mA – 16-0-0 0-1-2

The narrow spike comes from the brief shining instant when all three Neopixels were on at the same time. Now you have three PWM pulses, each with slightly different periods.

Remember that these are PWM 16/255 pulses. When they’re at full brightness, PWM 255/255, there’s only a brief downtime between pulses that last nearly 2.5 ms and they’ll overlap like crazy.

Obviously, the more Neopixels and the lower the average PWM setting, the more the average current will tend toward the, uh, average. However, it will have brutal spikes, so the correct way to size the power supply is to multiply the number of Neopixels in the string by the maximum possible 60 mA/Neopixel… which gets really big, really fast.

A 1 meter strip of 144 knockoff Neopixels from the usual eBay supplier will draw 144 x 60 mA = 8.6 A when all the pulses coincide. Worse, the supply must be able to cope with full-scale transients and all the fractions in between. A husky filter cap would be your friend, but you need one with a low ESR and very high capacity to support the transients.

No wonder people have trouble with their Neopixel strings; you really shouldn’t (try to) run more than one or two directly from an Arduino’s on-board regulator…

5 thoughts on “Neopixel Current

  1. I’m working with some circuitry that communicates through a cellular network interface. The current draw is all over the place, with 2A spikes and lots of transients. I ended up giving it its own power supply, complete with some low-ESR capacitors in parallel. Now to deal with having a radio transmitter next to my other circuitry. Radiated interference would probably be less of a problem with LEDs, but a long string would make a decent antenna, and with all those high-current edges, you’re going to get some radiation. Maybe bring an AM radio near it and give a listen?

    1. Good point!

      As nearly as I can see, the flex-PCB layout runs power along the edges and data down the middle, with 100 nF caps decoupling caps across each LED. Those parallel power traces look like a meter of crappy transmission line excited by sharp edges, so it ought to radiate nicely at any frequency you can imagine.

      I’ll put a short antenna on the spectrum analyzer and see what pops up…

      1. All that distributed decoupling should help a lot, and dampen out the effectiveness of it as an antenna as well. I’d be interested to see what it looks like on the spectrum analyzer.

        1. The short answer is: not much.

          I used a VHF-UHF rubber duck HT antenna, but it’s a foot away from the Neopixel strip and should respond to anything in that range. No major spikes anywhere, much to my surprise.

          I should try the big discone that’s lurking beside the window to get more-better response at lower frequencies…

Comments are closed.