LED HyperCube

The Initial Project
This Arduino project originally started as the final group project of Tobias Hafner, Linus Petrucci and me for the Computer Architecture lecture.
Idea
In this project, we constructed a cube consisting of 5 x 5 x 5 individually addressable RGB-LEDs. An Arduino is used to display various 3D animations on this HyperCube. The addition of a custom-built controller makes these animations interactive and even allows to play games like Snake on the cube.
Cube Construction
To keep the number of wires (at least somewhat) manageable, we relied on multiplexing: Layers are enabled individually by MOSFETs in quick succession, giving the illusion of the whole cube shining at once.
Each “column” in the cube has its three color channels connected to a custom-made control board that consists of ten 74hc595 shift-registers. Since each color channel can be either on or off, we get a total of 23 = 8 different colors.
The Arduino, controller and all connections are neatly organized in the 3D-printed socket of the cube.
Driver Software
We employed an object-oriented approach for the driver code. This allowed us to hide the hardware-specific complexity behind abstractions.
The Cube
object provides functions for setting the color of individual LEDs, lines, planes, blocks, spheres or even text characters.
New animations can easily be added by extending the Animation
class and implementing the renderNextFrame()
function.
My Improvements
After the project finished, I decided to continue working on the cube.
Performance Optimizations
I was able to drastically improve the performance of the driver program, drastically increasing the maximum frames rate. This allowed me to apply the PWM technique for dimming LED color channels. As a result the number of colors that can be displayed increased from 8 to 43 = 64. Even with this additional complexity, animations can be displayed with up to 175 FPS.
Interactivity
I designed, 3D-printed and assembled a basic game controller consisting of an analog stick and two buttons. With its help it is now possible to cycle through different animations stored on the Arduino. Some animations react to user input. For example, the playback speed can be changed.
The coolest use case of the controller is to play Snake in 3D! The addition of a third dimension makes it a completely different playing experience that can only properly be enjoyed on the HyperCube.

