LamaPLC: RGB / RGBW addressable LEDs

WS28xx: addressable RGB LEDs The WS28xx (WorldSemi) series consists of addressable RGB LEDs that integrate a driver IC and LED chips into a single package or circuit. These LEDs allow for individual control of color and brightness through a single-wire digital signal, making them popular for custom lighting projects.

The SK6812 is an individually addressable LED driver IC often considered the direct successor or “upgraded version” of the WS2812B. While it shares the same single-wire control protocol, it introduces a dedicated fourth channel for true white light (RGBW) and operates at a higher PWM frequency for smoother dimming.

Code Compatibility

If you swap a WS2812B (RGB) strip for an SK6812 (RGBW) strip, you must update your code. The controller needs to send 32 bits instead of 24. If you don't, the colors will “shift” down the line, appearing as static or incorrect.

Popular WS28xx Models

The series uses a common communication protocol, but models vary in voltage, control accuracy, and reliability.

  • WorldSemi WS2812B (Standard 5V): The most common model, with the IC embedded directly within the 5050 LED package. It runs on 5V DC, enabling high pixel density since each LED is individually addressable. However, it lacks a backup data line; if an LED fails, the signal can't pass through to the rest of the strip.
  • WorldSemi WS2811 (External IC 12V/24V): This model employs an external driver chip, usually mounted on the PCB rather than inside the LED. In strips, it typically controls groups of three LEDs as a single pixel, reducing detail in complex animations but offering a cost-effective solution for large displays.

WS28xx: addressable RGB LEDs

  • WorldSemi WS2813 (Reliable 5V): An improved version of the WS2812B, featuring a dual-signal data line. Its “breakpoint resume” function ensures the strip continues working if one LED fails (except when two consecutive LEDs fail). It also has a higher PWM frequency (2kHz versus 400Hz) for smoother dimming.
  • WorldSemi WS2815 (Reliable 12V): Similar to the WS2813 but operates on 12V DC. This higher voltage greatly minimizes “voltage drop,” allowing longer runs (up to 5 meters) without requiring power injection at multiple points. It also includes a backup data line, like the WS2813.

Technical Comparison

FeatureWS2811WS2812BWS2813WS2815SK6812
Voltage12V / 24V5V5V12V5V (mostly)
Color Channels3 (RGB)3 (RGB)3 (RGB)3 (RGB)4 (RGB + White)
Data Length24-bit per pixel24-bit per pixel24-bit per pixel24-bit per pixel32-bit per pixel
PWM Frequency~400 Hz~400 Hz~2.0 kHz~2.0 kHz~1.2 kHz
Addressability3-LED segmentsIndividualIndividualIndividualIndividual
Backup DataNoNoYes (Dual signal)Yes (Dual signal)No
White QualityMixed (Blue-ish)Mixed (Blue-ish)Mixed (Blue-ish)Mixed (Blue-ish) Pure (Dedicated chip)
IC LocationExternalBuilt-inBuilt-inBuilt-inBuilt-in

Selection Guide WS28xx: addressable RGB LEDs Choosing the right model depends on the scale and complexity of your project:

  • For high-density, short runs: Use WS2812B for its low cost and individual control.
  • For long-distance installations: Use WS2815 to minimize voltage drop and increase reliability with its backup data line.
  • For large-scale budget lighting: Use WS2811 (12V) when individual control of every LED is not required.
  • For critical failure prevention: Use WS2813 (5V) or WS2815 (12V) so a single dead LED doesn't break the entire animation.
  • The WS2813 and WS2815 are superior for permanent installations because of their dual data lines. If one LED dies, the signal jumps to the next.
  • SK6812 wins if you need high-quality white light. Because it has a dedicated white phosphor chip, you can achieve “Warm White” or “Natural White” that looks like a real light bulb.

SK6812 RGB vs. SK6812 RGBW

  • SK6812 RGB: A standard 3-channel chip (24-bit data). It is a direct, drop-in replacement for the WS2812B. It creates white light by mixing Red, Green, and Blue together.
  • SK6812 RGBW: A 4-channel chip (32-bit data). It adds a physically separate, dedicated white-phosphor element inside the LED casing to deliver pure, high-CRI white light.
FeatureSK6812B
WS2812B
SK6812 RGBW (Cool White)SK6812 RGBWW (Warm White)SK6812 RGBNW (Natural White)
Emitted Light Format3-in-1 (RGB)4-in-1 (RGB + White)4-in-1 (RGB + White)4-in-1 (RGB + White)
White Channel TypeNone (Faked using RGB)Cool White (CW)Warm White (WW)Natural / Neutral White (NW)
Color Temperature~6000K–7000K (Bluish tint)6000K – 6500K2800K – 3200K4000K – 4500K
Data Length per Pixel24-bit (8-bit per channel)32-bit (8-bit per channel)32-bit (8-bit per channel)32-bit (8-bit per channel)
PWM Frequency~400 Hz~1200 Hz~1200 Hz~1200 Hz
Voltage Drop SensitivityHighModerate (Slightly more tolerant)Moderate (Slightly more tolerant)Moderate (Slightly more tolerant)
Max Power per Pixel~60 mA (Full White via RGB)~80 mA (All 4 channels maxed)~80 mA (All 4 channels maxed)~80 mA (All 4 channels maxed)
Best Used For…Budget matrixes, gaming setups, dynamic animations.Modern task lighting, commercial displays, crisp white accents.Cozy home illumination, living rooms, under-cabinet ambient lighting.Photography lighting, workspace illumination, reading areas.

Warnings

Inrush Current & Buffer Capacitor

Turning on the power supply causes a massive, sudden spike in current. This voltage surge can immediately fry the control IC of the first few LEDs.

The solution: Place a 1000 µF (or at least 470 µF) electrolytic capacitor across the positive (+) and negative (-) rails. Position it as close to the start of the LED strip as possible to smooth out voltage spikes.

Logic Level Voltage Issues (3.3V vs. 5V)

The article focuses almost entirely on 5V Arduino boards. It completely overlooks that modern 3.3V microcontrollers (RP2040, ESP32, Raspberry Pi) are out of the official WS2812B specification for a logical “high” signal.

The solution: Without a fast hardware Level Shifter (like the 74HCT125), the data signal will be highly unstable, leading to flickering, wrong colors, or no light at all.

Software Interrupt Conflicts

The WS2812B single-wire protocol requires strict nanosecond timing. On standard AVR chips (like Arduino Uno/Nano), libraries completely disable interrupts while executing the data transmission (strip.show() or FastLED.show()).

The consequence: If your code relies on background routines—like reading I²C/SPI sensors, monitoring serial data, or tracking button presses with interrupts—you will suffer data loss or frozen animations. (Note: Using the RP2040's hardware PIO solves this by bypassing the CPU entirely).

Frame Rate (FPS) and Strip Length Bottlenecks

The protocol transmits at a fixed speed of 800 kHz. Sending data for 1 bit takes exactly 1.25 µs. Therefore, a single 24-bit RGB LED takes 30 µs, plus a 50 µs reset latch signal.

The limitation: Long strips introduce physical refresh bottlenecks. For example, a strip with 1,000 LEDs takes ~30.05 ms to update just once. This caps your maximum possible fluid speed at roughly 33 FPS. For longer setups, you must split the load across multiple GPIO pins in parallel.

SK6812 White-Blending Inefficiencies

While the article notes the dedicated white channel of the SK6812, it skips a software efficiency loophole.

The consequence: Basic code often mixes Red, Green, and Blue to achieve white light. This wastes energy and generates excessive heat. Advanced firmware utilizes explicit White Blending to turn off the RGB elements entirely and use only the dedicated white phosphor chip, significantly slashing overall power consumption.

If you'd like to support the development of the site with the price of a coffee — or a few — please do so here.

Here's a handy tip: you can quickly save this page as a PDF by clicking “export to PDF” in the menu on the right side of the screen.

2026/02/14 23:38

LEDs Addressing

The WS28xx series uses a daisy-chain addressing mechanism where each LED (or group of LEDs) has no fixed hardware address. Instead, they are indexed by their physical position in the chain.

The communication follows a “data-stripping” or “self-addressing” protocol:

  • Data Packet Intake: The first LED in the series receives a long stream of data from the controller. It “takes” the first 24 bits (8 bits each for Green, Red, and Blue) and applies that color to itself.
  • Signal Forwarding: After consuming its 24 bits, the first LED reshapes the remaining signal and passes it to the next LED via its Data Out (DOUT) pin.
  • Sequential Processing: The second LED now treats the next 24 bits as its own, consumes them, and passes the remaining bits down the line. This process repeats until every LED has received its 24-bit color value.
  • Reset Signal: To finalize the update, the controller holds the data line low (typically for > 50 µs), which “latches” the colors and prepares the LEDs for the next frame.

Arduino & Addressable LEDs

Example 1: Arduino & WS2812B

To control WS2812B LEDs with an Arduino, the FastLED and Adafruit NeoPixel Libraries are the most popular options. Both require you to define the data pin, the number of LEDs, and the color order (usually GRB for WS2812B).

FastLED is highly optimized and offers advanced color control features like HSV (Hue, Saturation, Value).

#include <FastLED.h>
 
#define LED_PIN     6          // Pin connected to Din on the strip
#define NUM_LEDS    10         // Number of LEDs in your strip
#define BRIGHTNESS  50         // Set brightness (0-255)
#define LED_TYPE    WS2812B    // Model type
#define COLOR_ORDER GRB        // Standard for WS2812B
 
CRGB leds[NUM_LEDS];           // Initialize the LED array
 
void setup() {
  // Power-up safety delay
  delay(3000); 
  FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS);
  FastLED.setBrightness(BRIGHTNESS);
}
 
void loop() {
  // Simple "Larson Scanner" effect
  for(int i = 0; i < NUM_LEDS; i++) {
    leds[i] = CRGB::Blue;      // Set current LED to Blue
    FastLED.show();            // Update the strip
    delay(50);
    leds[i] = CRGB::Black;     // Turn it off for the next frame
  }
}

Important Hardware Considerations

  • Power: Each LED can draw up to 60mA at full white brightness. For more than 10–15 LEDs, use an external 5V power supply rather than the Arduino's 5V pin to avoid damage.
  • Common Ground: If using an external power source, you must connect the power supply's ground (GND) to the Arduino's GND pin.
  • Protection: Place a 330–470 Ω resistor between the Arduino data pin and the strip's DIN to prevent signal spikes.

Example 1: Arduino & SK6812

To control SK6812 RGBW LEDs, you must account for the fourth white channel. If you use standard RGB code, the colors will “drift” because the strip expects 32 bits per pixel instead of 24.

The Adafruit NeoPixel Library is the easiest way to handle the extra white channel on Arduino.

This script cycles through Red, Green, Blue, and then the Dedicated White chip.

#include <Adafruit_NeoPixel.h>
 
#define PIN          6   // Data pin
#define NUMPIXELS   10   // Number of LEDs
 
// IMPORTANT: Use 'NEO_GRBW' for SK6812 RGBW models
Adafruit_NeoPixel strip(NUMPIXELS, PIN, NEO_GRBW + NEO_KHZ800);
 
void setup() {
  strip.begin();
  strip.setBrightness(50); // Set brightness (0-255)
  strip.show();            // Initialize all pixels to 'off'
}
 
void loop() {
  // 1. Pure Red
  colorWipe(strip.Color(255, 0, 0, 0), 50); 
 
  // 2. Pure Green
  colorWipe(strip.Color(0, 255, 0, 0), 50); 
 
  // 3. Pure Blue
  colorWipe(strip.Color(0, 0, 255, 0), 50); 
 
  // 4. Pure White (Using the dedicated 4th channel)
  colorWipe(strip.Color(0, 0, 0, 255), 50); 
 
  // 5. Warm Mix (RGB + White)
  colorWipe(strip.Color(100, 50, 0, 200), 50); 
}
 
// Function to fill dots one after the other with a color
void colorWipe(uint32_t color, int wait) {
  for(int i=0; i<strip.numPixels(); i++) {
    strip.setPixelColor(i, color);
    strip.show();
    delay(wait);
  }
}

Key Differences in SK6812 Code:

  1. The Flag: You must use NEO_GRBW in the setup. If your LEDs are the “Warm White” or “Cool White” specific version, the order might occasionally be NEO_WRGB, but NEO_GRBW is the industry standard for SK6812 Datasheet specifications.
  2. The Color Command: strip.Color(R, G, B, W) now accepts a fourth parameter.
    1. strip.Color(0, 0, 0, 255) turns on only the white element (most efficient).
    2. strip.Color(255, 255, 255, 0) mixes RGB to make white (less accurate, uses more power).

Hardware Tip for SK6812

Since SK6812 strips have four emitters per pixel, they draw more current than WS2812B strips. Ensure your 5V power supply can handle roughly 80 mA per pixel if you plan to run both RGB and white channels at full brightness simultaneously.

Sensor topics on lamaPLC

PageDateTags
2026/04/23 21:51, , , , , , , , ,
2026/04/15 17:21, , , , , , , , ,
2026/04/11 18:29, , , , , , , , , ,
2026/04/15 19:34, , , , , , ,
2026/04/23 21:52, , , , , , , , , ,
2026/03/22 03:14, , , , , , ,
2026/04/23 21:52, , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , ,
2026/05/12 18:40, , , , , , ,
2026/05/13 00:06, , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , ,
2026/04/23 21:52, , , , ,
2026/04/23 21:52, , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , ,
2026/04/23 21:52, , , , , , , ,
2026/04/23 21:52, , , , , ,
2025/05/31 23:32, , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , ,
2023/07/01 17:29, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , ,
2026/04/23 21:52, , , ,
2026/04/23 21:52, , , , , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , , , , , , , , , , , , , ,
2026/04/11 18:28, , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , ,
2026/04/23 21:52, , , , , ,
2026/04/23 21:52, , , ,
2026/04/23 21:52, , , , , , ,
2026/04/23 21:52, , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , ,
2026/04/23 21:52, , , , , , , ,
2025/09/23 18:59, , , , ,
2026/02/14 18:42, , , , , , ,
2026/04/23 21:52, , , , , ,
2026/04/23 21:52, , , , , , , , , , ,
2026/05/12 21:06, , , , , , ,
2026/05/12 21:04, , , , , , ,
2026/04/15 19:42
2026/04/15 19:41, , , , , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , ,
2023/06/25 00:43, , , , , ,
2026/04/23 21:52, , , , , , , , , , ,
2026/04/23 21:52, , , , , , , ,
2026/04/23 21:52, , , , ,
2026/05/15 15:17, , , , , , , , , , , , , ,
2026/02/15 00:00, , , , , , , , ,
2026/05/12 22:18, , , , , , , , , , , , , , , ,
2026/04/23 21:52, , , , , , , , , , , , , , , , ,
2026/02/14 18:49, , , , , ,
2026/04/23 21:52, , , ,
2026/04/23 21:52, , , , , , , ,


This page has been accessed for: Today: 1, Until now: 277