WS2812 LED bar/How it works/07. What five LEDs draw
How it works · 07 of 9

What five LEDs draw

Each colour inside these LEDs runs at a constant 12 mA at full brightness, so one LED at full white is 36 mA and all five about 182 mA, not the 60 mA per LED often quoted for WS2812s. Brightness is a share of time, so the current falls in proportion. A USB port is meant to give 500 mA, and an ESP32-S3 on Wi-Fi wants some of it.

Twelve milliamps a colour

What five LEDs draw
30 mA
Brightness40 / 255
LEDs lit5 of 5
Colour
Per LED
5.95 mA
Bar
30 mA
With S3 on Wi-Fi
370 mA
30 mA for the bar. Even with the ESP32-S3 at its Wi-Fi peak the total, 370 mA, stays inside a USB port's 500 mA. Full white on all five is 182 mA, still inside it alone.

There is no resistor to pick on this bar. The chip in each LED holds each colour at a constant 12 mA at full brightness, across its supply range. So the current is a count:

  • one colour at full: 12 mA;
  • one LED at full white: 36 mA;
  • all five at full white: 180 mA, plus about 0.3 mA each for the chips, about 182 mA.

The WS2812 figure usually quoted, 60 mA per LED, is 20 mA a colour. It belongs to other parts. On this bar it would overstate the current by two thirds.

Brightness is a share of time

A colour at 128 is not a smaller current. It is the full 12 mA switched on for about half the time, more than a thousand times a second. Your eye averages it, and so does the supply. So the current scales with the value: 40 out of 255, the build sketch's brightness, is about a sixth.

A library's setBrightness() scales every value before it is sent, so it is the one line that caps the current whatever the rest of the sketch asks for.

Against a USB port

A computer's USB 2.0 port is meant to supply 500 mA. The bar at full white takes about 182 mA of that, which is fine alone. Add an ESP32-S3 transmitting on Wi-Fi, which peaks near 340 mA, and the total passes 500 for a moment. The usual result is a board that resets when the LEDs go bright.

At the sketch's brightness of 40 the bar takes about 30 mA at most, and the question goes away. For full white on a Wi-Fi project, feed VCC from its own 5 V supply and join its ground to the board's.

When it does not work

Everything says 60 mA per LED. Why does this book say 36?

60 mA is 20 mA per colour, the figure for the classic WS2812B and most strips. The XL-5050RGBC-WS2812B on this bar is specified at 12 mA per colour, so 36 mA per LED at full white. Both are arithmetic on a data sheet; for a strip of unknown parts, plan on 60.

The board resets when the bar goes bright white.

All five at full white draw about 182 mA through the 5V pin, and an ESP32-S3 transmitting on Wi-Fi can peak near 340 mA on the same USB port: a little over the 500 mA a port is meant to give. Keep setBrightness low, which the build sketch does, or feed VCC from its own 5 V supply with its ground joined to the board's.

Can I run the bar from the board's 3V3 pin to save current?

No. 3.3 V is under the LEDs' 3.5 V minimum supply, and the current is set inside each LED, so a lower supply saves nothing and promises nothing. VCC goes to 5V; the brightness setting is what saves current.

Dark, the bar still draws current.

About 0.3 mA per LED, 1.5 mA for the five: each LED's chip stays awake, listening for data, whatever colour it shows. It matters only on a battery. To take it to zero, the bar's VCC has to be switched off.

Where this goes next

Three wires to an ESP32-S3, and a sketch that walks five colours down the bar.

The first colours

Edit this page — content/books/ws2812-led-bar/what-five-leds-draw.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

WS2812 RGB LED Bar

Loading discussions…

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum