DeVayu's Raspberry Pi Pico LED Matrix Controller Drives 2,048 LEDs at 28 Frames Per Second via Wi-Fi

Designed as a network-addressable display, this 2,048-pixel LED matrix runs at nearly 30 FPS thanks to some clever compression.

Pseudonymous maker "DeVayu" has turned a Raspberry Pi Pico into a high-performance driver for a 64x32 RGB LED matrix — and added Wi-Fi support through a companion Espressif ESP8266, offering updates at up to 28 frames per second wirelessly.

"My original plan was to use a Raspberry Pi 3 [Model] A+ to drive this matrix using the Adafruit HAT. While it worked okay-ish it was quite glitchy, especially when streaming the image over MQTT because the kernel interrupts destroyed the precise timings the matrix requires," DeVayu explains. "Then a few days ago, I had the idea to use a Pico which should be better because it has no kernel to wreck the timings and because of PIO [Programmable Input/Output] it should be fast enough."

This overclocked Raspberry Pi Pico can animate 2,048 LEDs at 28 frames per second — over Wi-Fi. (📹: DeVayu)

Using an example LED matrix driver script provided with the Raspberry Pi Pico Software Development Kit (SDK) as a base, DeVayu worked to get the performance up over a wireless connection — handled by an Espressif ESP-01 module connected to the Raspberry Pi Pico via UART. "One core [of the RP2040 microcontroller] just refreshes the panel at about 500Hz, the other listens for TCP data. The Pico is overclocked to 250[M]Hz, BTW.

"Because I didn't want to implement the MQTT protocol (again), I'm using a simplified protocol for transmitting the data. To improve frame rates I'm compressing everything using ZSTD, which was quite a challenge to get working due to memory constraints. The Pico now connects to my own MQTT Broker which has a custom JS [JavaScript] scripting engine. This engine detects the Pico and just sends it the frame data from another topic with the simplified protocol."

The project makes use of the RP2040's dual-core processor and PIO block, but leans on an ESP-01 for connectivity. (📷: Gareth Halfacree)

The finished system is able to play back animations over the entire matrix — 2,048 individual RGB LEDs — at a rate of around 28 frames per second, with the clever compression approach near-doubling the peak frame rate. "10 FPS was easy," DeVayu explains, "but when I pushed the baud rate of the ESP, the corruption increased, so I only got to about 15 FPS. ZSTD reduces the size of each frame to about 5 percent, which is how I was able to get the 28 FPS."

More details are available on DeVayu's Reddit thread, while the source code — plus "some very bad documentation," the maker admits — has been published to GitHub under the permissive BSD three-clause license.

ghalfacree

Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.

Latest Articles