David Johnson-Davies' Light Lab Does for RGB LEDs What Sound Lab Did for Audio
This compact controller can drive strips of up to 160 NeoPixel or DotStar LEDs with live adjustment of "space-time expression" animations.
Maker David Johnson-Davies has designed a flexible controller for NeoPixel or DotStar addressable LED strips, acting like a synthesizer for light with knobs to adjust variables in programmable patterns: the Light Lab.
"I've recently been experimenting with driving NeoPixel displays using the peripherals in [Microchip] DA, DB, and DD series AVR microprocessors, and this set me to thinking about what would an ideal platform for designing and experimenting with NeoPixel displays," Johnson-Davies explains. "The idea was to create something like my sound synthesizer, Sound Lab — a Simple Analogue Synthesizer, but for colored RGB LEDs."
The result was, naturally enough, the Light Lab, a compact system for driving either WS2812 or WS2812B NeoPixel or APA102 or SK9822 DotStar RGB LED strips. At its heart is Microchip's AVR128DB28, plus a CP2102N USB-to-serial bridge for firmware updating over a USB Type-C port, connected to a 2.42" 128×64 OLED display plus up-down buttons and three potentiometers to act as a user interface.
The board includes three power input options — USB Type-C, a 5V DC jack, or an optional protected 18650 lithium cell — and is capable, its creator says, of driving strips of up to 160GB LEDs. It includes 22 built-in animations, designed with linear strip, ring, and matrix layouts in mind, and exposes three variables to the potentiometers to allow for each animation to be customized using controls like speed, peak width, color saturation, and hue.
"The usual approach to displaying patterns on LED strips is to write the colors you want to display into a buffer, and then write the buffer to the strip. If you want to create a dynamic, changing light display you write a program to handle the changes and timing that you want to use," Johnson-Davies explains. "Light Lab uses a different approach called a space-time expression."
"This is a single expression that tells you what the value of each RGB channel g is at a particular position x along the strip, at time t. The variable x is a fixed-point value between zero and one, and t is a fixed-point value that increases in seconds from zero. In addition, the three variables a, b, and c give the settings of the three Logic Lab controls, and return a fixed-point value between zero and one, where one corresponds to 100%. Space-time expressions allows patterns to be defined very elegantly; in fact most of the patterns in Light Lab are defined in one or two statements."
The full project write-up is available on Johnson-Davies' website, including source code; hardware design and production files are available on GitHub under an unspecified license.