Magical LED cube

From Texas Instruments Wiki
Jump to: navigation, search

Have you ever wanted to impress your friends/family with something that combines coolness and your electronic engineering skills? Wait no more, the time has come! I present to you the magical 5x5x5 LED cube! After seeing your cube every one of your friends will want one of these in their living room.

Magical LED cube


  • Thanks go to Farid Kilani and Tobias Waschek for their ideas and support!


  • Blue colored 5x5x5 LED cube
  • Cool animations
  • Implementation of the Capacitive Touch BoosterPack for the MSP430 Launchpad
  • Space Invaders (using the accelerometer on the FRAM board)
The #evp parser function was deprecated in EmbedVideo 2.0. Please convert your parser function tag to #ev.

Functional Description

The MSP430FR5739 Experimenters Board is used to control an 5x5x5 LED cube. The LED cube is made up from 125 LEDs arranged into 5 layers of 25 LEDs each. All LED anodes of a layer are connected and all cathode of a row are connected. This allows multiplexing with LED driver ICs, so instead of requiring 125 connections it requires one to each of the five layers and 25 to each LED in a layer making a total of 30. 

The cathodes of the LEDs are connected to TI TLC5916 8-bit constant-current LED sink drivers. The LED current is set by a single resistor connected to the R-EXT input of the IC. The 1.8k resistor sets the LED current to ~10 mA; this resistor can be altered to vary the current supplied to the LEDs. The advantage of using a constant current sink driver IC is that almost any LED can be used and the supply current remains constant regardless of the LED forward voltage. If the output current does need to be altered, it only requires the current setting resistor to be changed.

Each of the LED layers is arranged in a 5 x 5 matrix and controlled by a PNP transistor connected to the LED anodes. The remaining free pins of the forth LED driver are used to switch the PNP transistors ON and OFF, so that when the respective layer control output from the LED driver goes low the transistor connects VDD = 5 V to the anodes of the LED layer.

When a layer is connected to VDD and the output of the LED driver goes low it connects the cathode of the respective LED to GND, lighting it up.

The outputs of the current sink drivers are controlled by the MSP430FR5739. Each driver IC contains an 8 bit shift register and an output latch. Via SPI the desired state of the outputs is clocked into the latches. The drivers are cascaded; a full cycle to refresh the whole cube needs to send 30 bits (5 bits for the layer selection and 25 for the LEDs in the selected layer). After all bits are sent the data is latched to the outputs and the outputs are enabled. By using SPI and the LED drivers only 4 I/O pins are needed to control the whole cube.

The layers are turned on one after another. When doing this very quickly the eye can't see the switching anymore, giving us a static image. The refreshing is done by a timer interrupt every 2.5 ms. With this rate you won't be able to see any flickering.

Via UART the current touch position of the Capacitive Touch BoosterPack is sent to the FRAM board. With the support of the Touchpad it is possible to spin an image around the cube. 

Furthermore the accelerometer of the FRAM board is used to play the game "Space Invaders".

When writing the program code, I didn't care about entering any kind of low power mode. Because the cube itself draws ca. 200 mA it wouldn't make a significant difference going from active into low power mode.

The #evp parser function was deprecated in EmbedVideo 2.0. Please convert your parser function tag to #ev.

Pictures & Videos

The first video shows the current set of animations for the cube.

In the second video you can see the game Space Invaders. With the help of the accelerometer of the FRAM board you control one LED on the bottom layer. From the top "rockets" are falling down and you have to avoid getting hit by moving the board. Unfortunately, due to the video resolution, it's a bit hard to see the bottom LED moving in the video.

The third video shows the implementation of the Capacitive Touch BoosterPack for the LaunchPad. By moving your finger over the touch pad you can spin an image, in this case a "1", around the cube.

The #evp parser function was deprecated in EmbedVideo 2.0. Please convert your parser function tag to #ev.

Usage Instructions

The easiest way to assemble the cube is to first solder all the layers individually. To make sure that all LEDs have the same spacing and are aligned in a square you need something to hold them while you are soldering. In my case I drilled 25 holes in the box the LaunchPad comes in and mounted the LEDs on it. You actually don't need any wire to build the cube. Bending the legs of the LEDs so that the legs become the scaffolding that holds the LEDs in place works fine.

Source Code