← All parts

WS2812B Addressable LED

WS2812B

Worldsemiinterface io display

The WS2812B is an addressable RGB LED with an integrated control IC in a 5050 package. A single-wire 800Kbps data line cascades pixels, each offering 256 brightness levels per color.

In stock

Specifications

8
Operating Voltage
3.5 to 5.3 V
Data Rate
800 Kbps
Color Depth
24 bit
Scan Frequency
400 Hz
Input Capacitance
15 pF
Operating Temperature Range
-25 to 80 C
Interface
Single-wire NZR cascadable serial
Package Types
5050 SMD

Pinout

4
PinNameFunctionsNotes
1VDD
POWER
LED power supply
2DOUT
GPIO
Control data signal output to next pixel
3VSS
GND
Ground
4DIN
GPIO
Control data signal input

Interactive pinout

Highlight:
WS2812B

Click a pin to copy its name · tap a tag above to spotlight a bus.

Logic level & voltage

Runs on 3.5-5.3 V (per the datasheet specs) and uses a single-wire timed serial protocol. At 5 V supply a 3.3 V data line is marginal — level-shift it.

Typical uses

  • Addressable RGB LED strips and matrices
  • Ambient / status lighting and signage
  • Wearable and prop lighting

Wiring notes & gotchas

  • Add a ~300-500 Ω series resistor on DIN and a big cap (e.g. 1000 µF) across the supply.
  • Shift a 3.3 V MCU's data up to 5 V (e.g. 74HCT logic) for reliable first-pixel timing.
  • Budget ~60 mA per LED at full white and inject power for long strips.

Commonly used with

3

Starter code

Community starter examples — minimal, unofficial, and provided to get you wiring fast. Verify against the manufacturer datasheet before relying on them.

Arduino (C++)

Arduino library: Adafruit NeoPixel

arduino
// WS2812B addressable RGB LEDs — community starter example
#include <Adafruit_NeoPixel.h>

#if defined(ESP32)
  #define LED_PIN 5
#else
  #define LED_PIN 6
#endif
#define NUM_LEDS 8

Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip.begin();
  strip.setBrightness(60);
  strip.show();
}

void loop() {
  for (int i = 0; i < NUM_LEDS; i++) {
    strip.setPixelColor(i, strip.Color(0, 150, 0));   // green
    strip.show();
    delay(80);
  }
  for (int i = 0; i < NUM_LEDS; i++) strip.setPixelColor(i, 0);
  strip.show();
  delay(300);
}

MicroPython

python
# WS2812B addressable LEDs (ESP32) — community starter example
# uses the built-in `neopixel` module
from machine import Pin
import neopixel, time

NUM = 8
np = neopixel.NeoPixel(Pin(5), NUM)   # DIN on GPIO5

while True:
    for i in range(NUM):
        np[i] = (0, 60, 0)            # dim green
        np.write()
        time.sleep_ms(80)
    for i in range(NUM):
        np[i] = (0, 0, 0)
    np.write()
    time.sleep_ms(300)

Wiring

PinArduino Uno R3ESP32 DevKitC (WROOM-32)Notes
VDD+5V5V5 V; budget ~60 mA per LED at full white
VSSGNDGNDCommon ground with the board
DIND6GPIO5Data in; add a ~330 ohm series resistor

Related parts

6