Hello friends, I hope you all are doing great. Today, I am going to share the new APA102 LED Strip Library for Proteus Simulation. The APA102 is the addressable RGB LED for people who found the WS2812B too fussy: it has a clock line, so there are no microsecond timing windows to hit, the data can come at any speed and even pause, and its colours flicker at about 19 kHz instead of 400 Hz - invisible even to a camera. With this library you can run a full Proteus simulation of APA102 sticks, chain them, watch every frame on the bus and see why the end frame and the clone chips trip people up.
APA102 LED Strip Library for Proteus
Latest version: V1.0 (December 2026, this tutorial)
Related parts: WS2812B LEDs · RGB LED · MAX7219 LED Matrix
Helping Tools
- Serial Monitor Advance: a serial terminal window for the UART of your board
- Serial Monitor Expert: the serial monitor with extra debugging tools
- LCD Library for Proteus V3.0: 16x2, 20x4 and I2C LCDs to show your readings
The demo drives two 8-LED sticks in a chain from an Arduino UNO V4.0: a colour wipe, a rainbow, a fade with the APA102's own 5-bit brightness and a chase on the second stick.
NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the RGB LED board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the APA102 LED Strip Library for Proteus Simulation:
What Is the APA102?
The APA102 is a 5050 RGB LED - 5 x 5 mm - with a small controller inside. It has six pins: 5 V, GND, a data input DI and a clock input CI, and on the other side a data output DO and a clock output CO for the next LED. Strips and sticks are simply LEDs chained output to input. Each colour has a built-in constant-current sink of about 20 mA, so a LED at full white takes about 60 mA.
- The stick in this library: 56.6 x 15 mm, eight LEDs about 7.1 mm apart, the input pads GND, 5V, CI, DI at one end and CO, DO (with 5V and GND) at the other.
- Supply 5 V; the logic HIGH must be at least 0.7 x VDD, i.e. 3.5 V - fine from a 5 V UNO, a 3.3 V board needs a level shifter.
- Colour PWM about 19.2 kHz; a WS2812B runs at about 400 Hz.
- No fixed clock rate; libraries use 4 - 12 MHz.
The Frames
The data is read on each rising edge of CI, most significant bit first, and every update has three parts:
- A start frame: 32 zero bits.
- One frame per LED: 32 bits - the bits 111, a 5-bit global brightness (0 - 31), then BLUE, GREEN and RED, 8 bits each. On the wire that is the byte 0xE0 | brightness, then B, G, R.
- An end frame: at least n / 2 extra clock edges for n LEDs.
Each LED keeps the first LED frame it receives and passes everything after it to the next LED, regenerating the clock. That is how one bus feeds hundreds of LEDs - and it is also why the end frame exists: every LED delays the data by half a clock, so after the last frame the data still has to be pushed through. The datasheet suggests 32 ones; in practice zeros are safer, because ones reaching a LED you did not mean to light turn it full white.
Brightness the APA102 Way
The 5-bit global brightness scales the current for the whole LED, on top of the 8-bit colour values: the light is roughly colour / 256 x brightness / 31. Fading a picture is therefore one number per LED, without touching the colours - the demo does exactly that. On the original APA102, values below 31 add a slower PWM of a few hundred hertz; the SK9822 clone does the brightness as true current control.
The SK9822 Clone
Many strips sold as APA102 carry the SK9822. It speaks the same frames, with one difference that matters: it shows a new picture only when the NEXT start frame arrives. Send one update and an SK9822 strip shows the previous one. The cure is cheap - 32 more zero bits after the data, a "reset frame" - and the demo sketch sends it, so it works with both chips.
Features of the APA102 Library
- A real-looking stick: eight 5050 LEDs at their true pitch on a 56.6 x 15 mm board, the pads at both ends; the LEDs glow in their colour and brightness on the sheet.
- The bus of the datasheet: rising-edge sampling, MSB first, any clock rate, pauses allowed.
- The frames: start, LED and end frames; each LED keeps its frame and passes the rest on with half a clock of delay.
- Chains: CO / DO of one stick drive CI / DI of the next.
- CHIP = APA102 or SK9822: with the SK9822's one-update lag.
- Power: the current per LED and in total, the 5 V supply and the logic-level check.
- Simple and Advance: an on-sheet status panel, or a pop-up with the LEDs, LED 9's frame drawn bit by bit, an event log and Tests for the protocol, the chain and the power.
- A complete package: about 1.3 MB with the library, our Arduino UNO V4.0 and the demo, without the source code of the model.
The APA102 in Proteus
The library has two devices in TEPAPA102.LIB with the model TEPAPA102.DLL: LEDAPA102STICK8TEP (Simple, with the on-sheet status panel) and LEDAPA102STICK8ADVTEP (Advance, with the pop-up). Search APA102 in Pick Devices. The pins are GND, 5V, CI, DI on the left and GNDO, 5VO, CO, DO on the right; the properties are CHIP (APA102 / SK9822) and LOGIC (the controller's HIGH level in volts).
Download APA102 LED Strip Library for Proteus Simulation
Click the button below to download APA102-LED-Strip-Library-for-Proteus-v1.0.zip (about 1.3 MB, without the source code of the models):
APA102 LED Strip Library for Proteus V1.0- README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
- Proteus Library Files:
TEPAPA102.LIBandArduinoV4TEP.LIB. - Proteus Model Files:
TEPAPA102.DLLandTEPARDUINO.DLL. - Arduino Code: the demo sketch (SPI).
- Proteus Simulation: the demo project, its HEX file and copies of the DLLs.
No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.
How to Install APA102 LED Strip Library for Proteus Simulation
- Close Proteus and extract the whole zip file, for example to your Desktop.
- Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
- Copy the files from Proteus Model Files into the MODELS folder.
- Delete
TEPAPA102.IDXfrom the LIBRARY folder if it is there. - Start Proteus, press P and search for APA102.
Proteus Simulation of Two Cascaded APA102 Sticks
The demo uses an A4 sheet with our Arduino UNO Library for Proteus V4.0 and two sticks, LS1 and LS2. The UNO's hardware SPI drives the first stick: SCK (D13) to CI, MOSI (D11) to DI. The second stick hangs on the first one's outputs - CO to CI, DO to DI - so everything it shows has passed through the eight LEDs of the first. The Arduino's monitor is built in, the same window as our TEP Serial Monitor Advance for Proteus. Open APA102-LED-Stick-ArduinoUnoV4.pdsprj.
The Sketch
The sketch writes the frames itself with SPI.transfer, so the protocol is visible. One update of all sixteen LEDs:
for (uint8_t k = 0; k < 4; k++) SPI.transfer(0x00); // start frame
for (uint8_t i = 0; i < NUM_LEDS; i++) {
SPI.transfer(0xE0 | level[i]); // 111 + brightness
SPI.transfer(blue[i]);
SPI.transfer(green[i]);
SPI.transfer(red[i]);
}
and after the sixteen LED frames, the two tails:
for (uint8_t k = 0; k < 4; k++) SPI.transfer(0x00); // reset frame (SK9822-safe)
for (uint8_t k = 0; k < (NUM_LEDS / 2 + 7) / 8; k++) SPI.transfer(0x00); // end frame: n/2 clocks
Note the order - blue, green, red - and the brightness in the low five bits of the first byte. The reset frame makes SK9822 strips show the update at once; the end frame pushes the last LED's data through the chain.
APA102 Simulation Results
Open the project and press Run. The demo runs 9.5 simulated seconds and took about 2 minutes 57 seconds on our PC with the pop-up open and the pictures being taken. Click OPEN PANEL on the second stick for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.
The Colour Wipe
The sketch starts with a red wipe: one more LED every 50 ms, at brightness 16 of 31. The pop-up belongs to the second stick, LED 9 - 16: at 0.8 s the wipe has crossed over from the first stick and LEDs 9 - 13 are red, 14 - 16 still dark, 57 mA on this stick. Every frame for these LEDs has passed through the eight LEDs of the first stick.
Green follows, then blue. At 2.05 s the blue wipe has filled the first stick while the second still shows green - each LED shows its colour as soon as its own frame is complete, so the wipe runs along the chain. The second stick draws 87.9 mA.
The Rainbow
From 2.5 s a rainbow turns along all sixteen LEDs, 25 updates a second. The pop-up at 3.5 s lists every LED's brightness, blue, green and red, its duty and current, and draws LED 9's last frame bit by bit: 111 and brightness 16 (0xF0), BLUE 0, GREEN 168, RED 87 - 32 bits read on the rising edges of the 4 MHz clock, 12.5 us with the gaps between the bytes.
The Brightness Fade
From 4.9 s the rainbow stops and only the 5-bit global brightness moves - 31, down to 1, back to 31. At 6.0 s it is at 6: the colours in the pop-up are exactly the same values, the light and the current (36.4 mA for this stick) are a fifth of what they were. This is the APA102's own dimming, without touching the colour bytes.
The Chase
From 7.4 s the first stick dims to a blue glow and a white dot runs along the second, with an orange LED on each side. At 8.0 s the white dot is on LED 15 at full brightness 31 - 255, 255, 255 - with LEDs 14 and 16 orange at brightness 6; 76.7 mA.
At 9.5 s the dot is on its way back, on LED 14 - and the next loop of the demo starts about half a second later.
The Event Log and the Tests Page
The Event log records the start of every effect the sticks can see: the first frames, the frames kept and passed on, the end frames and any warnings - here none.
The Tests page checks the last update against the APA102 frame format, and every row is green: the start frame (292 zero bits reached LED 9 - the first stick's frames arrive here as zeros), 8 LED frames entered and 8 kept, the end frame (36 clocks after the last frame, where n / 2 = 4 are needed on this stick), the clock 4.00 MHz, the pulse widths 125 ns (30 ns needed), the longest pause 1.63 us - "fine at any length" - and the latch rule of the APA102.
The Arduino's built-in serial monitor prints the set-up in three lines - the sticks, the SPI wiring and the frame layout - then one line as each effect starts. Its times come from millis(), which starts when the sketch starts.
APA102 or WS2812B?
The WS2812B in our WS2812B LED Library for Proteus needs only one data wire, but its timing is fixed to a fraction of a microsecond - interrupts and slow boards get in the way - and its PWM is slow enough to show on camera. The APA102 needs two wires and costs a little more, and in return any speed works, the brightness has its own five bits and the PWM is fast. For single colour LEDs see our RGB LED Library for Proteus, and for an 8 x 8 grid of single-colour dots our MAX7219 LED Matrix Library for Proteus.
Try It Yourself
- Set CHIP to SK9822 and remove the reset frame: every picture appears one update late.
- Remove the end frame: the last LEDs of the chain show the previous update.
- Send the datasheet's 32 ones as the end frame with fewer LEDs than you wire: an extra LED lights white.
- Swap CI and DI: nothing lights.
- Slow the SPI clock down to 125 kHz: the picture is the same, just slower to update - no timing window.
Ideas to Extend the Demo
- A persistence-of-vision wand: the fast PWM keeps the picture sharp while it moves.
- A sound-level meter on the stick.
- A long strip: chain more sticks and watch the current in the Tests page.
Your Own Sketches
The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.
Things to Know Before Using Real APA102 LEDs
- Power: 60 mA per LED at full white; feed long strips at both ends and add a capacitor of a few hundred microfarads.
- End frame: n / 2 clock edges, zeros.
- SK9822: add the 32-zero reset frame.
- Pad order: not standard - check CI and DI before connecting.
- Logic level: 3.5 V at least for a HIGH at 5 V supply.
Troubleshooting
- Nothing lights: no start frame, CI and DI swapped, or no 5 V.
- The last LEDs lag: the end frame is too short.
- The second stick stays dark: CO / DO not wired to its CI / DI.
- Everything one step late: an SK9822 - send the reset frame.
- The part is not simulated:
TEPAPA102.DLLis missing from MODELS and from the project folder.
Limitations of the Simulation
- The frames, the cascade, the brightness, the current, the SK9822 behaviour and the stick's size follow the APA102 and SK9822 datasheets and product data; the stick is our own drawing.
- Our own figures: the 7.1 mm pitch (from the stick's length), the output delays, the quiescent current.
- Not modelled: the PWM flicker itself (only noted), colour accuracy, heat.
- Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or the makers of the LEDs.
- Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.
So, that was all about the APA102 LED Strip Library for Proteus Simulation. I hope it helps you light up your next project. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!