Parts
WS2812B addressable LED: pinout, timing, current and 3.3 V data
By Bulan Sarkar
The WS2812B pinout, top view with the lens up, is 1 VDD top left, 2 DOUT bottom left, 3 VSS (ground) bottom right at the cut corner and 4 DIN top right. Data goes in at DIN and leaves at DOUT for the next LED.
Each one is a red, green and blue LED with its own controller in a 5 × 5 mm package, and a strip is just a long chain of them on one data wire. This page covers the timing, how much current a strip draws and why a 3.3 V board drives it without a guarantee. Every figure comes from Worldsemi's own datasheet, the only maker datasheet for the part.
Datasheet: Worldsemi WS2812B-V5/W Intelligent control LED integrated light source (PDF)Ask Datasheet Guru about the WS2812B
Pinout by package
Top view, lens up: VDD top left, DOUT bottom left, VSS bottom right at the cut corner, DIN top right.
The cut corner on the top marks pin 3, ground.
Source: Worldsemi WS2812B-V5/W Intelligent control LED integrated light source, p. 2 (pin configuration drawing and pin function table: 1 VDD, 2 DOUT, 3 VSS, 4 DIN); Worldsemi WS2812B-V5/W Intelligent control LED integrated light source, p. 2 (mechanical drawing: 5.0 × 5.4 × 1.57 mm, pads 0.9 mm)
Which one do you have?
The current part is the WS2812B-V5, and its datasheet is the one this page reads. The package is 5.0 × 5.4 × 1.57 mm with four pads, one at each corner. The cut corner on the top marks pin 3, ground.
Strips, rings and matrix boards are sold as "WS2812B" or under the NeoPixel name. Some carry look-alike chips from other makers, which have datasheets and limits of their own. If a strip misbehaves where the numbers below say it should work, the chip may not be a WS2812B at all.
Ratings
The supply range is narrow: 3.7 V to 5.3 V. That is 5 V with a little room either side, so a 5 V adapter is right and a 12 V one is far outside it. The data input may go from −0.3 V to 0.7 V above VDD, which matters when the controller and the strip are powered separately: data must not arrive before the strip has power.
| Parameter | WS2812B-V55050 |
|---|---|
| Supply voltage VDD | 3.7 to 5.3 V |
| Logic input voltage VI | −0.3 V to VDD + 0.7 V |
| Operating temperature Topt | −40 to 65 °C |
| Storage temperature Tstg | −40 to 85 °C |
| Moisture sensitivity level | MSL 5a: 24 hours out of the bag |
The operating range stops at 65 °C. Each LED at full white turns about 180 mW into heat, so check the temperature of a bright strip inside a closed channel.
Timing, data threshold and current
| Parameter | WS2812B-V55050 |
|---|---|
| Input high voltage VIHVDD = 5 V, 25 °C | 0.63 VDD min |
| Input low voltage VIL | 0.7 V max |
| Input current II | ±1 µA max |
| Input capacitance CI | 15 pF max |
| DIN to DOUT delay tPLZCL 15 pF, RL 10 kΩ | 300 ns max |
| Current per colourLED test condition | 12 mA |
| Quiescent current | 0.6 mA (centre value) |
| Brightness, red / green / blue IV12 mA | 310 / 780 / 215 mcd typ |
| Wavelength, red / green / blue λd | 621 / 520 / 471 nm typ |
| 0 code: high, then low T0H, T0L | 220 to 380 ns, 580 ns to 1 µs |
| 1 code: high, then low T1H, T1L | 580 ns to 1 µs, 580 ns to 1 µs |
| Reset (latch) low time RES | more than 280 µs |
| Data rate | 800 kbit/s |
| Colour order | G, R, B, highest bit first |
Each bit is a high pulse followed by a low one. A short high (220 to 380 ns) is a 0 and a long high (580 ns to 1 µs) is a 1. At 800 kbit/s a bit takes 1.25 µs. A low lasting more than 280 µs ends the frame: each LED then shows the colour it was sent.
The first LED keeps the first 24 bits it sees and passes everything after them on, reshaped, through DOUT. So the second LED gets the second 24 bits, and so on down the chain. Within each 24 bits the order is green, red, blue, highest bit first. Sending red first swaps red and green on the strip.
3.3 V data: why it works on the bench and fails later
The datasheet says a high must reach 0.63 × VDD. At 5 V that is 3.15 V, and at 5.3 V it is 3.34 V. An ESP32 drives its pins to about 3.3 V with a light load, which clears 3.15 V by 150 mV. That is why a strip often works straight from one.
The guaranteed figure is lower. Espressif promises only 0.8 × 3.3 V = 2.64 V for a high, 510 mV short of what the LED needs at 5 V. A long wire or a supply a little above 5 V can tip it over, and the first LED reads garbage. The two lines in Figure 3 cross at 4.19 V: only below that supply is the ESP32's guaranteed high enough.
The fix that costs least is a 74AHCT125 buffer powered from 5 V between the board and DIN. Its input counts anything over 2.0 V as a high and its output swings to the 5 V rail. Tie its enable pin to ground. Our 3.3 V to 5 V level shifter guide compares it with the other options; it keeps the BSS138 module for I²C, not LED data.
What it is good for
- Strips, rings and matrices where every LED needs its own colour, from one data pin.
- Status lights on a board: one WS2812B gives any colour from one pin, with no resistors.
- Long chains: the sheet promises at least 1024 pixels at 30 frames a second, and up to 5 m between two LEDs without extra parts.
It is the wrong part for plain white lighting. A 12 V LED strip on a MOSFET does that job with no controller and no data line. For a single LED on a pin, see LED circuits.
Worked example: a 5 m strip at 60 LEDs per metre
Take the common strip: 60 LEDs per metre, 5 m, so 300 LEDs on 5 V. The datasheet tests each colour at 12 mA and gives a quiescent current of 0.6 mA.
1. One LED at full white. 3 × 12 mA + 0.6 mA = 36.6 mA.
2. The whole strip at full white. 300 × 36.6 mA = 11 A, or 54.9 W at 5 V.
3. The strip with every LED off. 300 × 0.6 mA = 180 mA, 900 mW spent on doing nothing.
4. One frame. 300 × 24 bits × 1.25 µs = 9 ms, plus the 280 µs reset: 9.28 ms. That allows at most 108 frames a second.
5. Check against the sheet. 1024 pixels take 31 ms per frame, so 32.3 frames a second: the datasheet's "30 fps at 1024 pixels" holds.
A supply of at least 11 A covers the worst case. Most effects never light every LED white at full brightness, so a smaller supply often runs; if you choose one, cap the brightness in software to match it. The power dissipation lesson covers where those 55 W end up.
Worked example in numbers
- One LED, full white
- 36.6 mA
- 300 LEDs, full white
- 11 A
- Data high needed at 5 V
- 3.15 V
- Fastest refresh, 300 LEDs
- 108 fps
Tips and checks
- Feed data into the DIN end. Most strips print an arrow showing the direction; data sent into DO goes nowhere.
- Join the ground of the controller to the ground of the strip supply. Without it the data line has no reference and the colours flicker at random.
- Power the strip before or with the controller, never after. The data pin must stay within 0.7 V of VDD, and a live data line into an unpowered strip breaks that.
- Send green, red, blue. If red and green come out swapped, the library is set to RGB order.
- Budget 36.6 mA per LED at full white and pick the supply and wire for it, or limit the brightness in code.
- Keep the strip under 65 °C, the top of its operating range. Touch-check a bright strip inside a closed channel after ten minutes.
Substitutes
We list no drop-in substitute. Other chips sold for the same job, from Worldsemi and from other makers, change the timing, the supply range or the pin order, and we have not checked their datasheets for this page. Look for the chip's own datasheet before you mix two types in one chain.
A bench check
- Power the strip alone from 5 V, data unconnected. Nothing should light, and the current should be about 0.6 mA per LED.
- Join the grounds, connect the data line to DIN of the first LED and send one LED at dim red. If the wrong LED lights, or the colour is wrong, check the colour order and which end you are feeding.
- Light the whole strip white at a low brightness and measure the voltage at the far end. A large drop there means the strip needs power fed in at both ends.
- If the first LED flickers or shows random colours from a 3.3 V board, put a 74AHCT125 in the data line before you change anything else.
The common mistakes: data fed into the DO end, no shared ground, a 12 V adapter, a supply sized for one LED instead of the strip, and red and green sent in the wrong order.
What we'd do
Run the strip from a 5 V supply sized for 36.6 mA per LED, or cap the brightness to the supply you have. From a 3.3 V board, put a 74AHCT125 on 5 V in the data line from the start rather than hoping the bare pin is enough. Join the grounds, feed DIN, and send green first.
Questions people ask
What is the WS2812B pinout?
Top view, lens up: 1 VDD top left, 2 DOUT bottom left, 3 VSS (ground) bottom right at the cut corner, 4 DIN top right.
What voltage does a WS2812B need?
3.7 V to 5.3 V on VDD, so 5 V in practice. Its data input needs a high of at least 0.63 × VDD, 3.15 V at 5 V.
Can an ESP32 drive a WS2812B directly?
Often, but not by the datasheets. A typical 3.3 V output clears the 3.15 V threshold by 150 mV; the guaranteed 2.64 V does not. A 74AHCT125 buffer makes it reliable.
How much current does a WS2812B strip draw?
About 36.6 mA per LED at full white, so 11 A for 300 LEDs, and 0.6 mA per LED even when they are all off.
What colour order does the WS2812B use?
Green, red, blue, 8 bits each, highest bit first: 24 bits per LED.
Is a NeoPixel the same as a WS2812B?
NeoPixel is a product name used for strips and boards built on the WS2812B and similar chips. Check which chip a given product uses before relying on these numbers.
Buying the WS2812B in India
WS2812B strips sell by the metre at 30, 60 and 144 LEDs per metre, and as rings, single boards and loose 5050 LEDs. Some listings say WS2812B over a clone chip, so buy from a seller who names the maker, and run the bench check above on arrival. Our guide to buying electronic components in India compares ten online sellers and covers how to spot fakes.
One email a month from the bench
New circuits, lessons, part guides and calculators, on the first Sunday of each month.
Used in these lessons
Lessons that go deeper
Datasheets this page was checked against
- Worldsemi, WS2812B-V5/W Intelligent control LED integrated light source (V6.1 (in the file name; no date printed))
Makers revise datasheets. If the copy you download has a newer revision and a number here disagrees with it, the datasheet wins, and we would like to hear about it.