Source: https://mokxi.com/parts/ws2812
Updated: 2026-09-27

Part

# Addressable RGB LEDs

RGB LEDs on one wire, as a strip or a 16 wide panel.

or see every part

- 4 pins
- 3 properties

Drawn live by the editor's own code, at the size you see it.

Reference

## Every one of its 4 pins

Pin

Role

What it does

VDD

Input or output

Supply.

VSS

Input or output

Ground.

DIN

Input

The pulse-coded data line in.

DOUT

Output

Whatever is left of the frame after this device's own LEDs, for chaining.

This part

## What it does

WS2812B LEDs, sold as NeoPixels, put a red, green and blue LED and a small controller in every pixel and chain them all on one data wire. There is no clock: each bit is a high pulse whose length is the bit, about 0.4 microseconds for a nought and 0.8 for a one, twenty-four bits a pixel, green first, and fifty microseconds of quiet makes every LED take up its new color at once. Mokxi’s part decodes those pulses from the pin’s own edges inside the datasheet’s timing windows, and abandons a frame it cannot read the way a real strip does. The same part is a strip, a ring or a matrix, up to 1024 LEDs. Because the timing needs a fast core, the WS2812 driver and the Adafruit_NeoPixel calls run on the ESP32-C3 and ESP32-C6 here. Power draw is not modeled, so a long strip never browns out a board.

How to use it

## How to use WS2812B NeoPixels with an ESP32

DIN to a GPIO, VDD to 5 V, VSS to GND, and a ground shared with the board. The Adafruit_NeoPixel calls compile as they stand: create the strip with its length and pin, set colors with setPixelColor(), and call show() to send them. Keep the brightness down on a real strip, because each pixel can draw up to 60 milliamps at full white.

On a real Arduino Uno the Adafruit library drives WS2812s with hand-timed assembly. In Mokxi the WS2812 driver needs a faster core, so it runs on the ESP32-C3 and ESP32-C6.

Part pin

Board pin

DIN

GPIO 5

VDD

5 V

VSS

GND

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

One green pixel

Reference

## The 3 properties you can set

Property

Default

What it means

count

8

how many LEDs.

layout

strip (or ring, matrix)

strip, ring or matrix.

serpentine

false

whether a
matrix is wired boustrophedon (every other row reversed), which the wiring decides
and the data alone cannot say.

How it is modeled

## What is true about the Addressable RGB LEDs, here

### What is modeled

layout = "ring" bends the same row of LEDs into a circle, LED 0 at twelve o'clock
and the rest clockwise, exactly how the rings people buy are numbered. A ring is a
strip electrically, so nothing about the wiring or the firmware changes, only the
picture does. Nothing is shown until the latch: 50 microseconds of a quiet line ends
the frame, and every LED takes up its new color at once, the way a real strip does.

### Not modeled

No brightness curve beyond a straight RGB value, and no power draw per LED, so a
strip here never browns out a board's supply the way a long real one can.

The decode is the datasheet's windows. A high pulse under 125 ns is a glitch and
is ignored; from there to 600 ns is a nought and from 600 ns to 950 ns is a one, 950 ns
being T1H at the top of its ±150 ns tolerance. The low between bits is checked too
(at least 300 ns after a one and 700 ns after a nought, both the bottom of their
tolerances), and a stream that breaks either rule abandons the frame, the way a real
strip stops following one it cannot read. The total bit period is not checked on top
of that: the datasheet's own figure is 1.25 us ±600 ns, which constrains nothing once
both halves are, and real strips take faster streams than 1.25 us happily. The 300 ns
of forward delay per device is modeled as a flat 150 ns.

The latch is 50 microseconds of quiet, which is the original WS2812B figure; a
WS2812B-V5 wants 280 microseconds, so a driver written against this one can produce a
frame that never latches on newer strips. The color order is fixed at GRB (there is
no RGBW and no way to say a strip is wired otherwise), and there is no per-LED
refresh, no gamma, no thermal limit and no maximum of anything except the 1024 LEDs one
part will hold.

From WS2812 addressable LEDs, in full.

Projects

## See the Addressable RGB LEDs in a project

Shown here on: ESP32-C3-DevKitM-1, ESP32-C6-DevKitC-1

Learn

## Where it turns up in a lesson

### In a learn article

- ESP32 NeoPixel (WS2812B) Rainbow Tutorial

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio, no real internet), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

STM32F411 Black Pill

The Black Pill on our own Cortex-M4 core. Pick a program and press Run.

BBC micro:bit V2

The nRF52833 board with its 5x5 LED matrix, buttons A and B and a speaker. Wire the rings to a breadboard.

See every part

## Wire up the Addressable RGB LEDs

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building Open the editor
