The WS2812b color LED uses some kind of duty cycle encoding to encode three states:

  • one
  • zero
  • reset

This can be seen in the following figure: WS2812 Protocol

(Source: https://cpldcpu.files.wordpress.com/2014/01/ws2812_protocol.png)

What's the name of the used encoding?

It's not classic Pulse Width Modulation (PWM).

While this question What encoding is used in this signal? asks for a name of a similar modulation, it does not give a name for the modulation.

  • \$\begingroup\$ Looks to be just a made up one. Not unusual to have a sync pattern then some data. You see similar ones used elsewhere, not having a global name either. \$\endgroup\$
    – old_timer
    Nov 25, 2018 at 19:47

2 Answers 2


AFAIK it doesn't have a fixed name, apart from 'the WS2812 protocol'. As described, it is a fixed-cell pulse-width encoding.

FYI: in practice, it isn't fixed-cell at all: provided that the pauses (T1L, T0L) are shorter than Treset, all that matters is the pulse width (T0H, T1H). This makes it a plain pulse-wdith encoding, and it makes bit-banging waaaaay easier.

  • 1
    \$\begingroup\$ This looks like a variant of 1-wire protocol encoding scheme, also referred as "PWM", in this case it looks like 33/66% PWM. The protocol was invented by Dallas Semiconductor, now a part of MAXIM. home.roboticlab.eu/en/examples/sensor/1-wire \$\endgroup\$ Nov 25, 2018 at 20:36
  • 2
    \$\begingroup\$ I don't see what this unidirectional protocol has to do with the bi-directional dallas/maxim 1-wire protocol. And IMO PWM is a strange term to describe this protocol, because it isn't a Modulation, it is an Encoding. So yes, it is a pulse-width encodong, just like 1-wire, and dozens of others. \$\endgroup\$ Nov 25, 2018 at 20:44

This is what World-Semi calls it, they make the WS2812B

The data transfer protocol use single NZR communication mode. After the pixel power-on reset, the DIN port receive data from controller, the first pixel collect initial 24bit data then sent to the internal data latch, the other data which reshaping by the internal signal reshaping amplification circuit sent to the next cascade pixel through the DO port. After transmission for each pixel,the signal to reduce 24bit. pixel adopt auto resha -ping transmit technology, making the pixel cascade number is not limited the signal transmission, only depend on the speed of signal transmission.

  • \$\begingroup\$ This does not answer my question. I asked for the signal modulation name, but not how communication works. \$\endgroup\$
    – Paebbels
    Nov 26, 2018 at 0:36
  • 3
    \$\begingroup\$ The question was "What's the name of the used encoding?" The manufacturer calls it "single NZR communication mode". I think that does answer the question. \$\endgroup\$
    – CrossRoads
    Nov 26, 2018 at 1:36
  • \$\begingroup\$ I get your point, but I believe this is a typo. There is no NZR code (according to Google), but NRZ (Non-Return to Zero`). NRZ is a general term and the basis for many codes. \$\endgroup\$
    – Paebbels
    Nov 26, 2018 at 8:32
  • \$\begingroup\$ Next suggestion would be to browse the Adafruit Neopixel library of the FastLED.h library and see if they call it something else. \$\endgroup\$
    – CrossRoads
    Nov 26, 2018 at 15:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.