Addressable RGB LEDs, often called smart pixels, are digital electronic devices that can display individually controlled colors and brightness levels. Unlike conventional RGB LEDs, which typically require separate electrical control of the red, green, and blue channels, addressable RGB LEDs receive digitally encoded color information through a data interface.

This makes it possible to control hundreds or even thousands of LEDs individually, using a relatively simple wiring arrangement.

But how does each LED know which color information belongs to it? And how can a controller communicate with thousands of LEDs using just a single data signal?

To understand the basic principles of 3-wire addressable RGB LEDs, let’s take a closer look at one of the most widely used examples: the WS2812B.

Understanding the WS2812B Interface

The WS2812B combines three LED color elements—red, green, and blue—with an integrated control circuit in a single package.

Its interface requires three electrical connections:

  • VDD (+5 V) – Power supply connection, nominally 5 V DC.
  • GND – Ground connection.
  • DIN (DI) – Digital data input.

In addition to these connections, each WS2812B has an important digital data output (DOUT or DO), which allows multiple LEDs to be connected in a chain.

Unlike conventional RGB LEDs, the WS2812B does not require separate external control signals for the red, green, and blue channels. Instead, its internal circuitry interprets the incoming digital data and controls the three color elements accordingly.

How RGB Color Data Is Organized

To display a specific color, each WS2812B receives 24 bits of digitally encoded color information.

These 24 bits are divided into three 8-bit color channels:

  • 8 bits for green (G)
  • 8 bits for red (R)
  • 8 bits for blue (B)

Each channel can represent 256 intensity levels, ranging from 0 to 255.

Combining the three channels provides:

256 × 256 × 256 = 16,777,216 possible RGB color combinations.

One important detail is the order in which these color values are transmitted.

The WS2812B typically expects data in GRB order, meaning that the green channel is transmitted first, followed by red and blue.

Other addressable RGB LED types may use different channel orders, including RGB.

Each WS2812B requires 24 bits of color data, with 8 bits per color channel. The diagram illustrates the GRB data order used by the WS2812B. RGB is another commonly used data order in addressable LED systems.

Connecting Multiple LEDs in a Chain

One of the most useful characteristics of the WS2812B is its ability to operate in a cascaded arrangement.

The digital output (DO) of each LED is connected to the digital input (DI) of the next LED in the chain.

This means that a single digital controller output can communicate with a large number of addressable LEDs.

The controller sends a continuous stream of digital data to the first LED. The data then travels through the chain, with each LED processing the information intended for it and forwarding the remaining data to the next LED.

Note the LED cascading arrangement: the digital output (DO) of each LED is connected to the digital input (DI) of the next LED in the chain.

How Does Each LED Receive Its Own Color Data?

Here we come to an interesting question.

When a digital LED controller transmits a stream containing hundreds or thousands of binary zeros and ones, how does each LED know which 24 bits belong to it?

The answer is surprisingly simple.

Each WS2812B takes the first 24 bits of the incoming data stream for its own color information and forwards the remaining data to the next LED.

The second LED then takes the first 24 bits of the data it receives, which correspond to the second group of 24 bits in the original stream.

The same process continues along the entire LED chain.

For example, consider a chain of three WS2812B LEDs.

The controller transmits a sequence of 72 bits:

  • Bits 1–24: Color information for LED 1.
  • Bits 25–48: Color information for LED 2.
  • Bits 49–72: Color information for LED 3.

Each LED effectively removes its own 24-bit color word from the data stream and passes the remaining information downstream.

This arrangement eliminates the need to assign individual numerical addresses to the LEDs.

Instead, the position of each LED in the chain determines which part of the data stream it receives.

Simple, isn’t it?

Understanding the Reset Signal

There is another important question.

How does the LED know when a new sequence of color data begins?

The WS2812B uses a reset condition, generated by holding the data signal LOW for a sufficiently long period.

For many commonly documented WS2812B versions, this reset interval is specified as at least 50 µs. However, the required minimum interval can differ between chip revisions, so the datasheet for the specific device should always be checked.

The reset condition marks the end of the current data transmission and prepares the LEDs to receive a new sequence of color information.

After the reset interval, the first 24 bits of the next transmission again belong to the first LED, the following 24 bits belong to the second LED, and so on.

The reset condition also causes the received color data to be latched into the LED output control circuitry.

In practical applications, this allows the controller to update the colors of the entire LED chain by transmitting a new data sequence followed by the required reset interval.

The first LED consumes the first 24 bits of the data stream, making the next 24-bit group the color command word for the second LED in the chain. A sufficiently long LOW interval resets the data reception sequence and latches the new color values.

WS2812B Data Timing and NRZ Encoding

Another important aspect of the WS2812B interface is the timing of the control data.

The WS2812B uses a single-wire communication protocol with a nominal data rate of 800 kbps, corresponding to a bit period of approximately 1.25 µs.

The protocol uses Non-Return-to-Zero (NRZ) encoding, where binary 0 and 1 are distinguished by the duration of the HIGH and LOW portions of each data pulse.

A logical 0 is represented by a relatively short HIGH pulse followed by a longer LOW period.

A logical 1 is represented by a longer HIGH pulse followed by a shorter LOW period.

Since there is no separate clock line, the LED’s internal timing circuitry interprets the incoming pulses based on their timing characteristics.

The following diagram illustrates the typical timing of logical 0 and 1 values for a WS2812B LED.

Typical WS2812B data timing. Binary 0 and 1 are distinguished by the duration of the HIGH and LOW portions of each bit. Exact timing specifications and tolerances depend on the WS2812B revision.

For detailed electrical characteristics and signal timing requirements, refer to the WS2812B datasheet.

Why Timing Matters for LED Controllers

In most applications, users do not need to generate these precisely timed signals manually. This task is handled by a dedicated LED controller or by software and hardware designed to support the WS2812B communication protocol.

Nevertheless, understanding the timing requirements is important, particularly when controlling large numbers of LEDs.

At a nominal data rate of 800 kbps, transmitting a single 24-bit color word requires approximately:

24 × 1.25 µs = 30 µs per LED.

For a chain of 1,000 LEDs, the transmission alone takes approximately:

1,000 × 30 µs = 30 ms.

The reset interval must then be added before the next complete update.

This means that a single chain of 1,000 WS2812B LEDs cannot be updated much faster than approximately 33 complete frames per second, even under ideal conditions.

For applications requiring higher refresh rates, such as video displays or large dynamic LED installations, this becomes an important system design limitation.

One way to overcome this limitation is to divide the LED installation into multiple shorter chains and control them in parallel.

For example, ten parallel chains of 100 LEDs each can receive their color information simultaneously, significantly reducing the time required to update the entire installation.

Of course, this requires a controller capable of generating multiple synchronized data streams.

Conclusion

The WS2812B demonstrates how a relatively simple digital interface can provide individual control of a large number of RGB LEDs.

By combining 24-bit color information, cascaded data forwarding, and precisely timed single-wire communication, the WS2812B makes it possible to create complex lighting effects without requiring individual control wires for every LED.

However, the simplicity of the wiring should not hide

Close Menu