Addressable LEDs

From Electronic Fursuits
Jump to navigation Jump to search

Addressable LEDs often are given a PWM frequency which is unrelated to the frequency at which the data bus runs on. It corresponds to the frequency at which each R, G, B LED in the LED puck is turned on and off to set its brightness. The LED is usually on 100% power for a fraction of time during the period, the longer it stays on the brighter it looks. If the LED color value is V (from 0 to 255) on time is (V/255)th of the period. The PWM frequency is only relevant for people who do POV applications (persistence of vision) or who turn on LEDs for a fraction of time shorter than the PWM period. In that case it is possible the LED never gets a chance to turn on, so it may appear black sometimes, or stay on too long. For most applications you don't care.

WS2812 (Neopixel)

Commonly known as Neopixels, the WS2812 is probably the most well-known addressable LED. Their low PWM rate of 430Hz makes them prone to flicker and a bad choice for persistence of vision displays. However, they are very well-supported by most Arduino libraries, and are very attractive because they only require one data line, making them easier to add to a project where microcontroller pins are scarce.

PWM Frequency 430Hz
Voltage 5V
Global Dimming N/A
Data Lines 1

SK6812 (Neopixel)

The SK6812 is a clone of the WS2812B, with some slight variations. It has a higher PWM frequency (1.1kHz), making it less noticeably flickery, but still too slow for most persistence of vision applications. Its timing is slightly faster, but should be mostly interchangeable with neopixels.

PWM Frequency 1.1kHz
Voltage 5V
Individual Dimming PWM
Data Lines 1

APA102 (DotStar)

The APA102, commonly referred to as DotStar, is an addressable LED which boasts a high PWM rate, high-speed updating via its SPI protocol, and is well-suited for persistence of vision applications. It tends to be more expensive than Neopixels and needs an extra pin, but because it uses standard SPI, hardware SPI can be used, which may decrease overhead. One quirk is it needs to receive an extra clock cycle for every 2 pixels displayed! The data sheet is not clear about that but Tim's Blog demonstrates that requirement. This comes from the way data is latched by each LED: the clock coming out is delayed by 1/2 a cycle to generate a clean data line pulse.


PWM Frequency >19kHz
Voltage 5V
Individual Dimming PWM
Global Dimming PWM
Data Lines 2

SK9822

The SK9822 is a slightly improved knockoff of the APA102. According to its datasheet, it is protocol compatible, but this isn't strictly true; unlike the APA102, it requires 32 trailing zero bytes to latch in the data. As a side effect, this means all of the LEDs on a string will update at once, not one after the other as they receive data, making them a good choice for large displays. It also has linear global dimming, reducing flicker other LEDs show when both global and individual dimming are used together.

PWM Frequency 4.7kHz
Voltage 5V
Global Dimming Linear
Individual Dimming PWM
Data Lines 2