cookbook/reference/led-types.md
Comprehensive guide to LED chipsets supported by FastLED.
Difficulty Level: ⭐ All Levels
Time to Find Information: 3-5 minutes
Prerequisites: None
You'll Find:
| LED Type | Clock Pin | Voltage | Speed | Notes |
|---|---|---|---|---|
| WS2812B | No | 5V | 800 KHz | Most popular, "NeoPixel" |
| SK6812 | No | 5V | 800 KHz | Similar to WS2812B, RGBW available |
| WS2813 | No | 5V | 800 KHz | Backup data line |
| APA102 | Yes | 5V | 1-20 MHz | "DotStar", faster refresh |
| SK9822 | Yes | 5V | 1-20 MHz | Similar to APA102 |
| WS2801 | Yes | 5V | 25 MHz | Older, requires clock |
| LPD8806 | Yes | 5V | 20 MHz | Older strip type |
| P9813 | Yes | 5V | 15 MHz | Common in modules |
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);
Characteristics:
#define LED_TYPE APA102
#define COLOR_ORDER BGR
FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);
Characteristics:
// Note: FastLED doesn't natively support RGBW, use workaround:
#define LED_TYPE SK6812
#define COLOR_ORDER GRB
FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);
Characteristics:
#define LED_TYPE WS2813
#define COLOR_ORDER GRB
FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);
Characteristics:
Different LED types use different color orders:
// Common orders:
GRB // WS2812B, WS2813, most strips
RGB // Some WS2811, APA106
BGR // APA102, SK9822
BRG // Rare
void testColorOrder() {
leds[0] = CRGB(255, 0, 0); // Should show RED
leds[1] = CRGB(0, 255, 0); // Should show GREEN
leds[2] = CRGB(0, 0, 255); // Should show BLUE
FastLED.show();
// If wrong, try different COLOR_ORDER in setup
}
Pros:
Cons:
Pros:
Cons:
Pros:
Cons:
Pros:
Cons:
Data Rate: 800 KHz
Color Depth: 8-bit per channel (24-bit RGB)
Voltage: 5V (±0.5V)
Current per LED: ~60mA at full white
Protocol: Single wire, timing-based
Timing Tolerance: ±150ns
Data Rate: Variable, up to 20 MHz
Color Depth: 8-bit per channel + 5-bit global brightness
Voltage: 5V (±0.5V)
Current per LED: ~20mA at full white
Protocol: SPI-like (clock + data)
Timing Tolerance: Not critical (clocked)
Data Rate: 800 KHz
Color Depth: 8-bit per channel (24-bit RGB or 32-bit RGBW)
Voltage: 5V (±0.5V)
Current per LED: ~60mA at full white (RGB), ~80mA (RGBW)
Protocol: Single wire, timing-based
Timing Tolerance: ±150ns
Microcontroller GPIO ──[220Ω resistor]──> LED Strip DATA
Microcontroller GND ───────────────────> LED Strip GND
Power Supply 5V ───────────────────> LED Strip VCC
Power Supply GND ───────────────────> LED Strip GND + MCU GND
Microcontroller MOSI ──[220Ω resistor]──> LED Strip DATA
Microcontroller SCK ──[220Ω resistor]──> LED Strip CLOCK
Microcontroller GND ───────────────────> LED Strip GND
Power Supply 5V ───────────────────> LED Strip VCC
Power Supply GND ───────────────────> LED Strip GND + MCU GND
Problem: LEDs show incorrect colors
Solution: Try different COLOR_ORDER values (GRB, RGB, BGR, etc.)
Problem: First LED unreliable Solution: Add 220-470Ω resistor on data line near microcontroller
Problem: First N LEDs work, rest don't Solution:
Problem: LEDs flicker randomly Solution:
| Feature | WS2812B | APA102 | SK6812 | WS2813 |
|---|---|---|---|---|
| Speed | ⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐ | ⭐⭐ |
| Reliability | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ |
| Cost | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
| Ease of Use | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
| Availability | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ |