APA102 LED Strip
Addressable RGB LED strip with clocked SPI-like data interface
The APA102 (also known as DotStar) is an addressable RGB LED that uses a two-wire clocked SPI-like protocol — separate data and clock lines — rather than a single-wire timing-sensitive protocol. This makes it significantly easier to drive at high speeds and from any GPIO pair.
| Pin | Direction | Description |
|---|---|---|
DI | Left | Serial data input |
CI | Left | Clock input |
+5V | Left | Power supply (5 V) |
GND | Left | Ground |
Configuration
Section titled “Configuration”| Option | Type | Range | Default | Description |
|---|---|---|---|---|
nodes | Number | 1–1000 | 1 | Number of LEDs in the strip |
Protocol
Section titled “Protocol”Each LED consumes a 32-bit frame:
| Bits | Content |
|---|---|
[31:27] | Start frame — 0b111 (3 ones) |
[26:24] | Global brightness (0–31) |
[23:16] | Blue (0–255) |
[15:8] | Green (0–255) |
[7:0] | Red (0–255) |
A full transmission starts with a 32-bit zero start frame, followed by one frame per LED, then an end frame of 32 ones (or n/2 clock pulses for long strips).
Simulation Notes
Section titled “Simulation Notes”The simulator renders each node in real time as SPI frames are received. The colour of each node reflects the last complete frame written to it, including the per-LED global brightness factor.
Limitations
Section titled “Limitations”- Maximum of 1000 nodes per strip instance
- End-frame requirements beyond 32 bits (for strips > 64 LEDs) are handled automatically
- No power consumption modelling
- No daisy-chain latency simulation between nodes