Plasma 2040 strip flicker

My long APA102 strip (connected to Plasma 2040 and running the demo rainbow Python script) flickers towards the end.

This post suggests that capacitance between the clock and data lines of the long stop may be the culprit, and suggests lowering the SPI clock frequency.

I’d like to try that, but can’t figure out how. I’ve tried searching for Plasma 2040 Python API docs but all I can find is this:

Any tips? I don’t know C and am a Python noob.


Perhaps I need to switch to circuitpython? I think it looks like the dotstar API might allow me to set the clock rate, plus I found a rainbow example for circuitpython.

Will try to figure out how to use circuitpython later and report back.

led_strip.start(FPS) maybe?
pimoroni-pico/micropython/modules/plasma at main · pimoroni/pimoroni-pico (

@alphanumeric thanks for suggestion. I tried led_strip.start(FPS) and it looks like it only changes the frequency of flushing the buffer, but no the SPI clock speed.

Looking at plasma.cpp it seems like there are more undocumented arguments which can passed to the constructor. So I added 10 MHz on the end and now it works perfectly.

led_strip = plasma.APA102(NUM_LEDS, 0, 0, plasma2040.DAT, plasma2040.CLK, 10000000)

Digging further, it looks like the default frequency is 20MHz. I guess that explains it.

static const uint DEFAULT_SERIAL_FREQ = 20 * 1000 * 1000; // 20MHz

Nice sleuthing, and thanks for posting the solution. =)

Thanks for posting this @eletvon

Has anyone found out how to do the same for WS2812 strips? I’ve got three of the LED wire ones (making 150 LEDs, drawing just under 0.9A) and the last ten flicker on the rainbow script. My current solution is to hide them behind the bookcase, but I’m searching for a neater approach. :o)

Looking at the equivalent WS2818 page, the default is 800kHz, and I’ve tried a range of frequencies starting from that and especially the other one listed of 400kHz:

led_strip = plasma.WS2812(NUM_LEDS, 0, 0, plasma2040.DAT, 400000)

That doesn’t flicker, but the rainbow is static instead of travelling along the LEDs. Using 800000 restores things to normal (including flickering), as does using anything between the two.

Any thoughts from anyone?


I’m having the same problem here, weirdly, with one Plasma2040 but not the other. My advice would be that you try with another plasma2040 as they are pretty cheap. I would love to not what has happened in order to avoid doing the same in the future.

Thanks - I’ve just tried that with a spare Plasma2040 (I have a worrying large stock of Pimoroni hardware!) but it still flickers.

Can you touch the data in line with your bare hand and see if it makes any difference? I am trying to see if we have the same problem (my flickering affects all the LEDs, but it stops when I touch the data in line).

No change - the last ten of the 150 LEDs flicker regardless of whether I touch any of the lines.

Thanks - remember that electricity can be dangerous by the way.

next question: have you tried putting the power supply at the other end of the run of cables? Resistance in the copper wire between LED 1 and LED 150 can mean the LEDs at the end don’t get as many volts as those at the beginning. In theory this shouldn’t cause flickering - it should cause lowered brightness- but it’s worth trying.