Take an addressable LED strip (e.g. with chipset WS2801) that you might control with an Arduino. I understand that there are clock and data lines, and the data propagates through shift registers on each LED, extracting the information for that pixel (RGB).

I'd like to know more detail. How do the RGB values passed through the data line influence the intensity of the diodes? What logic is involved in doing this? Is it based on PWM or continuously changing the voltage of the diodes? I can't find a schematic.

  • 2
    PWM, exactly as their datasheet says. – Ignacio Vazquez-Abrams Aug 1 '16 at 23:44
  • I can't prove this or I would make it an answer, but I'm pretty sure it's an 7-bit PWM value that is controlled by the 7-bit color input. – Daniel Aug 1 '16 at 23:45
  • If you want us to explain exactly how a LED strip works, you have to tell us exactly which model you mean. – pipe Aug 2 '16 at 0:22
  • @pipe they stated the IC type... – Passerby Aug 2 '16 at 1:16

You can see exactly how the WS2801 chip works by looking at the data sheet.

It shows that you serial data line and the clock to shift in an 8 bit value for red, for green, and for blue. Then the chip generates a PWM pulse whose width is controlled by the 8-bit value. And the chip outputs the PWM pulses to the Red LED, the Green LED, and the Blue LED. Furthermore, it measures the amount of current through each LED and adjusts it based on the external feedback resistor (one each for Red, Green and Blue).

enter image description here

Datasheet: https://cdn-shop.adafruit.com/datasheets/WS2801.pdf

While your question stated the WS2801 I suspect you mean the WS2812, that is the part most commonly used in a addressable LED strip.
The WS2801 is an LED controller requiring external LEDs, the WS2812 is an LED and controller in one. Either way the two parts are very similar however they do use a different electrical connection for the data link.

The datasheet for the WS2812 can be found here (the data on the WS2801 is also on that site in the LED driver IC section).

These parts have a very simple 1 wire interface that allows them to be chained together: WS2812 image from world-semi site

It's not quire like a shift register, that would imply that the first data out from the processor was for the furthest LED in the chain. It's the exact opposite, the first data is for the nearest LED.
The first LED reads the first 24 bits of data (8 bits of Green then Red then Blue) on the Din line while keeping its Dout line idle and uses that data to set up PWM drivers for it's 3 internal LEDs. After 24 bits of data have been received the device goes into pass-through mode, any further data is sent onto the Dout pin without having any internal affect.

If the data line goes idle for over a fixed length of time then the device exits the pass-through mode and will read the next set of data it receives and update the internal PWM rates appropriately.

This system means that a theoretically unlimited number of LEDs can be chained together as long as the driver is able to keep spitting the data out without too long a pause (and you have a large enough power supply). However the maximum refresh rate possible drops as the chain gets longer.

The system works very well if you want to refresh all the LEDs at once. It does not however allow you to change a single LED without changing any others (except the first one). e.g. If you only want to only update LED3 in a chain then as a minimum you must send the data for LED1, LED2 and LED3.

Generally speaking, any digital led controller works by taking a digital input in a fixed format, generally n bits for the Red channel, n bits for G, then B, where n is the precision/steps of its PWM (typically bits 128 or 8 bits 255), possibly some value for all on/off or dot correction, and then uses a PWM timer to pulse the output at those values. Then it passes excess data to the next, if it's a shift register type IC.

The WS2801 isn't really addressable, as data is passed on in a dumb way.

The LEDs in a addressable strip will each be controlled by some sort of drive circuitry. There are a couple of standard methods for implementing this. The simplest method uses a pair of wires and timed sequences. Each LED driver chip has a decent amount of logic. This consists mainly of some timers, counters, and a shift register. The shift register is connected between the data input pin and data output pin. The counters are used to generate PWM signals to drive the LEDs. The state machine controls everything, commanding the shift register to shift data through and on to the next chip at the appropriate time and also to load the new data into the PWM registers once the entire string has been loaded with new data. Since the shift registers are connected end to end, the sequence in which the data is transferred down the string determines which drive chip it ends up in.

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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