WS2812B Pinout: A Complete Guide to Programming Your LED Strip

WS2812B pins are VDD, DOUT, VSS and DIN. Use this pin table, data timing reference and worked power examples to plan a strip connection.

JS

Jack Shi

Author

Oct 5, 2026

Updated

8 min read

Read Time

Quick answer: According to the WorldSemi WS2812B datasheet, the four pins are 1 VDD (power), 2 DOUT (data output), 3 VSS (ground), and 4 DIN (data input). Send controller data into DIN and use DOUT to carry data onward.

This guide separates the package pinout from power sizing and data requirements. It covers the low-voltage side of a strip connection, the timing in the supplied datasheet, and worked estimates for a pixel load and its supply cable.

WS2812B pin functions and data direction

DIN receives the control signal; DOUT sends it onward. According to the WorldSemi pin-function table, the package connections are:

Package pinNameFunctionConnection role
1VDDLED power supplySupply positive
2DOUTControl data outputData toward the next pixel's DIN
3VSSGroundSupply ground reference
4DINControl data inputData from the controller or preceding pixel

Read this as a package pin table, not a left-to-right connector diagram. Identify the package orientation from its drawing before applying the numbering. The useful distinction is between power, ground, incoming data and outgoing data; reversing the meanings of DIN and DOUT changes which end receives the controller signal.

Supply voltage and controller logic levels

Plan the power and the data signal together. According to Adafruit's NeoPixel guidance, pixels powered at 5 V ideally receive 5 V data; a 3.3 V microcontroller should use a logic level shifter such as the 74AHCT125 or 74HCT245.

The reason is a voltage threshold. According to the WorldSemi electrical-characteristics table, the minimum input-high level is 0.7 × VDD, while the maximum input-low level is 0.3 × VDD.

Worked logic-level example

Assumed inputs: VDD = 5 V and controller high output = 3.3 V. Applying the datasheet thresholds cited above:

  • Minimum high = 0.7 × VDD = 0.7 × 5 = 3.5 V.
  • Maximum low = 0.3 × VDD = 0.3 × 5 = 1.5 V.
  • Controller shortfall = required high − assumed output = 3.5 − 3.3 = 0.2 V.

That assumed output falls below the specified high threshold. It is not a sound basis for claiming guaranteed operation. Match the supply and signal levels before treating a software change as the solution.

Data format and timing

Send 24 bits per pixel in GRB order, most significant bit first. The WorldSemi datasheet specifies that format and an 800 Kbps data rate. The payload is measured in bits per pixel, not bytes per strip; GRB means green, then red, then blue.

According to the timing table in that same WorldSemi datasheet, the nominal pulse durations are:

Transmitted bitHigh timeLow time
00.4 µs0.85 µs
10.8 µs0.45 µs

Each listed high or low interval has a tolerance of ±150 ns. The specified total bit period is 1.25 µs ±600 ns, and the reset/latch interval is a low signal lasting more than 50 µs, according to the WorldSemi timing specification.

These timings come from the older datasheet copy linked here. Check the datasheet for your actual strip revision before implementing timing directly. Keeping the data order, pixel count and latch interval distinct makes it easier to identify whether an error concerns colour ordering, payload length or signal timing.

How much current should the supply provide?

Use a stated current assumption, and budget for the brightest pattern you intend to display. According to Adafruit's power guide, 20 mA per pixel is a rule of thumb for mixed colours and animations; 60 mA per pixel is its worst-case estimate for maximum-brightness white. The latter is Adafruit's estimate, not a current specification from the WorldSemi datasheet used here.

Worked power example

Assumed inputs: 60 pixels, a 5 V supply, and the two Adafruit current assumptions cited above. The formulas are I = pixel count × current per pixel and P = V × I:

  • Mixed-colour current = 60 × 20 mA = 1,200 mA = 1.2 A.
  • Mixed-colour power = 5 × 1.2 = 6 W.
  • Full-white current = 60 × 60 mA = 3,600 mA = 3.6 A.
  • Full-white power = 5 × 3.6 = 18 W.

These estimates cover the pixels only. Add any separately powered controller or accessories to the budget. According to Adafruit, a supply with more available current than the pixels need is acceptable: the load draws what it requires. Raising the supply voltage is not the equivalent of adding current capacity.

For comparison with other strip types, the LED strip calculator estimates power from length and strip type. Its current interface offers only 12 V and 24 V options and has no WS2812B preset, so use the pixel calculation above for this project instead of substituting one of those settings.

Resistor, capacitor and connection checklist

The data resistor and supply capacitor serve different connections. According to Adafruit's best practices, use a 300–500 Ω resistor between the controller output and the first pixel's input, positioned close to that pixel. Its guidance also recommends a 500–1,000 µF capacitor rated at least 6.3 V across supply positive and negative before connecting to a large power source.

Use this low-voltage checklist:

  • Follow the DIN/DOUT roles in the pin table when tracing the data path.
  • Place the recommended resistor in the data path and the capacitor across the supply, rather than treating both as data-line components.
  • According to Adafruit, if connecting a live circuit, connect ground first, then supply positive, then data. With a separate pixel supply, power the pixels before the microcontroller to avoid parasitic powering through the data line.

If your power supply requires mains wiring, use a qualified electrician for that part.

Voltage drop and power-feed placement

Plan power-feed placement as well as total supply capacity. According to Adafruit's power guide, feeding power at the head, tail, middle or several points can improve distribution; for colour consistency, it recommends keeping every pixel within 1 m of a power connection.

Worked supply-cable example

Assumed inputs: 5 V supply, 3.6 A load, 5 ft one-way cable length, and 18 AWG copper. The voltage drop calculator uses 6.385 Ω per 1,000 ft as the calculator's planning figure for this wire. Its model includes both outgoing and return conductors:

  • Loop length = 2 × one-way length = 2 × 5 = 10 ft.
  • Resistance = resistance per foot × loop length = (6.385 ÷ 1,000) × 10 = 0.06385 Ω.
  • Voltage drop = I × R = 3.6 × 0.06385 = 0.22986 V.
  • Drop percentage = (drop ÷ supply) × 100 = (0.22986 ÷ 5) × 100 = 4.5972%, about 4.6%.
  • Cable-end voltage = supply − drop = 5 − 0.22986 = 4.77014 V, about 4.77 V.

That calculation covers the feed cable, not additional resistance in connectors or the strip. It explains why a power budget alone does not describe the voltage delivered to the pixels.

FAQ

Which pin receives data from the controller?

According to the WorldSemi pin table, DIN is pin 4 and receives control data; DOUT is pin 2 and outputs it. Use the package drawing to establish orientation before numbering pins.

Can a 3.3 V controller drive the strip directly?

According to Adafruit, use a logic level shifter when driving pixels powered at 5 V from a 3.3 V controller. Its guidance distinguishes this from pixels powered by a 3.7 V LiPoly cell, where it says 3.3 V data is acceptable.

Does every pixel always draw 60 mA?

No. According to Adafruit, 60 mA is the maximum-brightness-white estimate, while 20 mA per pixel is a mixed-colour planning rule. Neither figure is a measurement of your particular animation.

How long can the controller data wire be?

According to Adafruit's best practices, about 1–2 m is usually workable, while substantially longer controller-to-pixel wiring can become unreliable. This guidance concerns the data lead, not power-feed spacing.

Why does the far end turn brown or dim?

According to Adafruit's power guide, voltage drop can make distant pixels look brown because blue and green need more voltage than red. Its power-distribution recommendation is to keep pixels within 1 m of a feed connection for better colour consistency.

JS

Jack Shi

Founder & editor, LEDask

Jack Shi builds and writes LEDask, an independent LED-lighting tools project operated by clooms. He designs the calculators, checks their formulas and reference values against published engineering data, and writes the guides across the site.

LED LightingEnergy EfficiencyHome Electrical