Driving Thousands of LEDs with an 8MB ESP32
Driving LEDs these days is actually pretty simple thanks to easy-to-use libraries for popular microcontrollers and…
Driving LEDs these days is actually pretty simple thanks to easy-to-use libraries for popular microcontrollers and individually-addressable LED strips that can be controlled over just three wires. But driving a lot of LEDs can still be a challenge. Many low-cost microcontrollers lack the power to keep up with thousands of LEDs at a frame rate that is acceptable for animations. The usual solution is to try to coordinate multiple microcontrollers, but Redditor Davepl has proven that an 8MB ESP32 can easily handle thousands of LEDs.
Most development boards based on the Espressif ESP32 microcontroller have 520KB of SRAM available. That’s sufficient for most projects, but not enough to simultaneously drive thousands of LEDs at a high frame rate. Luckily, there is a version of the ESP32, the ESP32-WROVER, with up to 8MB of SRAM. As Davepl shows, that provides enough memory space to handle thousands of LEDs. Specifically, he was able to control 8 channels of 1024 LEDs each running at 30 frames per second with a 5 second buffer in memory — and more may be possible.
To do that, the LED effects themselves are generated on a separate PC’s GPU in Unity. The data is then sent over WiFi to the ESP32, which stores the data in the memory buffer and ultimately drives the LEDs. Because the task of actually generating the effects is offloaded to the PC, the ESP32 is able to keep up by using the relatively large amount of memory as a buffer. Davepl demonstrates that with a nice fire effect, but the same basic process could be used to create any kind of effects.
Writer for Hackster News. Proud husband and dog dad. Maker and serial hobbyist. Check out my YouTube channel: Serial Hobbyism