Source: https://mokxi.com/parts/apa102
Updated: 2026-11-22

Part

# APA102 (DotStar) LED strip

Addressable LEDs with a clock: any speed works, and each LED has a 5-bit brightness on top of its color.

See every part

- 6 pins
- 1 setting
- In 1 project

Drawn live by the editor's own code, at the size you see it.

At a glance

## The APA102 (DotStar) LED strip in brief

What it is, and every setting the properties panel gives it.

The APA102, also sold as DotStar, SK9822 or APA102C, is an addressable RGB LED strip with both a data wire and a clock wire. Each LED reads the data line on the rising edge of the clock, so the board sets the pace: a slow digitalWrite() loop, hardware SPI, or an interrupt in the middle of a frame all work, unlike a WS2812 whose bits must be timed to a fraction of a microsecond. Each LED frame is 32 bits: 111, a 5-bit global brightness in 31 steps, then blue, green and red, 8 bits each, most significant bit first. The count setting sets how many LEDs the strip has, 1 to 1024. The model shows each LED's average color, not the PWM flicker underneath, and the strip draws no current, where a real one pulls up to about 60 mA an LED at full white. No maximum clock rate is enforced because the datasheet gives none.

Family

Outputs

Pins

6

count

8

Pins

## 6 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

Role

What it does

VCC

Input or output

Supply, 5 V (the datasheet's typical; 5.5 V max). Printed 5V on a DotStar strip.

CI

Input

Clock in, from the board.

DI

Input

Data in, from the board.

GND

Input or output

Ground.

CO

Output

Clock out, to the next strip's CI.

DO

Output

Data out, to the next strip's DI.

How to use it

## How to use the APA102 (DotStar) strip with an Arduino

The DotStar rainbow project runs a 30-LED APA102 strip on an Arduino Uno R3. A rainbow flows along the strip while the Serial Monitor reports how long each show() takes. The strip's VCC goes to the Uno's 5V pin through the breadboard power rail, GND to the Uno's GND pin the same way, DI to pin 4, and CI to pin 5. The part's count setting is set to 30 LEDs.

The sketch uses the Adafruit_DotStar library and makes the strip with Adafruit_DotStar strip(LEDS, DATA_PIN, CLOCK_PIN, DOTSTAR_BGR). DotStar_BGR is the datasheet's blue, green, red order; some real strips are wired the other way, but on this part DOTSTAR_BRG swaps red and green. In loop() the sketch calls strip.rainbow(first) to spread one turn of the color wheel over the strip, times strip.show() with micros(), advances the hue by SPEED, and every 50 frames prints the show() time.

With default settings, the serial monitor printed: "DotStar rainbow: 30 LEDs on pins 4 (data) and 5 (clock)" then "show() took 18488 us" and "show() took 18364 us". The first line confirms the pin wiring at startup, and the numbers are how many microseconds each show() needed to clock a full frame out to all 30 LEDs.

Things to try: change SPEED, which is how far the hue moves each frame, or change the brightness. You can also make the strip with no pins, Adafruit_DotStar strip(LEDS, DOTSTAR_BGR), and wire DI to pin 11 (MOSI) and CI to pin 13 (SCK): hardware SPI sends the same frames much faster, and the show() time drops.

Part pin

Goes to

VCC

Arduino Uno R3 pin 5V (through the breadboard power rail)

GND

Arduino Uno R3 pin GND (through the breadboard power rail)

DI

Arduino Uno R3 pin 4

CI

Arduino Uno R3 pin 5

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

sketch.ino · Arduino Uno R3 · the first 45 lines

Common errors

## Common APA102 (DotStar) LED strip errors and fixes

What goes wrong

The fix

Using DOTSTAR_BRG because Adafruit's examples say so.

Use DOTSTAR_BGR. On this part the BRG order swaps red and green.

Clocking a 5 V strip from a 3.3 V board such as an ESP32 or a Pico.

The inputs read high above 3.5 V on a 5 V strip. Put a 74AHCT125 level shifter on CI and DI, or run the strip from 3.3 V.

Sending no end frame of ones.

Send at least one clock of ones for every two LEDs. Each LED passes data on half a clock late, so without the end frame the far end updates one show() late.

Supplying the strip below 3 V.

Below 3 V the strip is off. Run it at the datasheet's typical 5 V, 5.5 V max.

Questions

## Questions and answers

### what is the apa102 led strip

An addressable RGB LED strip with a clock wire and a data wire, also sold as DotStar, SK9822 or APA102C. Each LED reads the data line on the rising edge of the clock, so any speed works.

### how many leds can the apa102 strip have

The count setting sets the number of LEDs, from 1 to 1024.

### what order are the apa102 colors

Blue, green, red, most significant bit first, per the datasheet. Use DOTSTAR_BGR with the Adafruit_DotStar library.

### how do i chain apa102 strips

Wire the first strip's CO to the next strip's CI, and DO to the next strip's DI.

How it is modeled

## What is true about the APA102 (DotStar) LED strip, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Not modeled

The LEDs show their average color, not the PWM flicker underneath. A frame whose first
three bits are not 111 is ignored (the datasheet's self-detection mode). No maximum
clock rate is enforced, because the datasheet gives none; real strips run at 1 to 10
MHz and long ones want slower. The strip draws no current from the supply, where a real
one pulls up to about 60 mA an LED at full white.

From APA102 (DotStar) LED strip, in full.

Projects

## See the APA102 (DotStar) LED strip in a project

One built-in project uses it. It opens in the editor, already wired.

Boards

## The boards it is shown on

This board has a built-in project with the APA102 (DotStar) LED strip in it.

- Arduino Uno R3

Libraries

## Arduino libraries for the APA102 (DotStar) LED strip

Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.

- FastLED
- NeoPixelBus by Makuna
- Adafruit DotStar

Keep going

## Keep going

- SPI Explained: Clock, Data and Chip Select
- Addressable RGB LEDs

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the APA102 (DotStar) LED strip

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
