Flip Schaumal
Posts: 5
Joined: Wed Aug 16, 2017 7:30 pm

LED Cube RGB 12x12x12

Wed Aug 16, 2017 8:11 pm

Hi all,

finally, after years of prototyping, design, programming, screwing and soldering here it is:

My 12x12x12 RGB LED Cube powered by Raspberry Pi
Website: --> https://sites.google.com/view/flips-cubicle/home <--
The website offers a download area. If you have Matlab, you can run the code and simulate the animations on your PC.

Facts & figures:
58711 lines C-Code (2.12 Mb in 75 files)
4717 lines of proprietary animation control scripts (140 kb in 32 files)
4507 lines VHDL (695 kb in 24 files)
1728 RGB LEDs + 1160 other electronic components
More than 13.000 solder points
910 drills and threads for 195 screws

Some details:
1) Hardware
- The display works layer by layer. Each layer is illuminated for roughly 0.3ms, resulting in a display rate of 280 Hz.
- The 144 RGB LEDs of a layer are controlled by 27 x TLC5940, connected via SPI to the Raspberry Pi (using DMA data transfer)
- The active layer is sourced through 36 FETs (IRF4905)
- The cube has two power supplies: a small one with 25W (for low power consumption / low heat dissipation at low ambient light) and a big one with 20A (for higher power at noon, fan cooling required)
- The two fans are PWM controlled and are activated if the CPU or the electronics (additional temperature sensor on interface PCB) need to be cooled. Voltage control keeps the noise of the fans at the level of a wristwatch.
- Two AD converters for audio inputs, temperature measurement, voltage & current monitoring, fan speed control, ...
- The AD converters, the fans, the power supplies are controlled by an FPGA (the FPGA also switches off the power supplies when the Raspi has shut down). The FPGA is also connected to the Raspi via SPI.

2) Software
- Each 10ms the RGB data is updated for 6 layers according to the current animations --> the recalulation rate for the complete cube is up to 50 Hz.
- If CPU is running short in complex calculations (eg. complex rubiks cube), then less layers are recalculated.
- The displayed "picture" results from software objects for various animation types (eg. rubiks, rain, 3d objects, ...).
- Color, position, scaling, rotation ... are transformed by a transformation object.
- These objects are created, parametrized, selected, combined (and removed) by a proprietary animation control script interpreter which is running online in multiple instances (one script per graphical object and one for the top level animation control).
- Example: The transitions (shift, tilt, ...) from animation to animation and even the fade up and down of the clock are parmeter variations of transformation objects controlled by the animation control scripts.
- For text display (eg. time) the software imports some true type fonts (*.ttf). The text is online interpreted as bezier curves and projected on the 3d surface of a cube, a sphere or a cylinder.
- Besides the graphic functions there are software modules for DMA control, fan control, power monitoring, failure report, failsafe operation and a website.
- After initialization all functions are scheduled in 10ms timer tasks.

3) Interfaces
- The cube itself has only a power switch on the front side (and an ambient light sensor).
- The cube provides a website for all other sorts of operation control: brightness, vividness, mode select, clock display rate, auto shut down by ambient light, ...
- For development purpose the website also provides access to parameters (eg temperature look up table for fan control, display gamma, monitoring thresholds, ...) and variables (eg voltages, current, CPU load, memory, temperatures, ...). It also provides a threefold graph for the course of variables over time. ("calibration tool").
- Eventual faults and events are reported in a report section of the website, failures are also sent to me by email.
- The cube can be linked to Matlab via TCP (display of Matlab animations on the Cube or vice versa) for animation development (MiL).
- Also the software modules can be compiled to a small console application which again can be linked either to the Cube or to Matlab (for software development, SiL).

Last but not least an advice:
Please do not reproduce this cube unless you have a socially acceptable place in your house for such a monster device and unless you have some years of spare time and approx 3000 bugs left to build it :-)

Have fun with the videos on the website!

IMG_3364_klein-2.jpg (93.47 KiB) Viewed 7418 times
Last edited by Flip Schaumal on Sat Aug 26, 2017 8:57 am, edited 8 times in total.

User avatar
Posts: 5116
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, USA

Re: LED Cube RGB 12x12x12

Wed Aug 16, 2017 8:43 pm

One of the best things I've ever seen.

Flip Schaumal
Posts: 5
Joined: Wed Aug 16, 2017 7:30 pm

Re: LED Cube RGB 12x12x12

Wed Aug 16, 2017 8:47 pm

Thanks :-)

User avatar
Posts: 126
Joined: Mon Oct 29, 2012 2:56 pm

Re: LED Cube RGB 12x12x12

Thu Aug 17, 2017 4:21 am

What is the actual frames per second if you had to update every LED?

I did something similar but had a problem with update speeds when I went above 1,024 LEDs. Below is 2,048 LEDs on one Pi

Mark -- OzzMaker.com -- Creator of;
+ BerryIMU
+ Berry GPS-IMU
+ PiScreen - A 3.5" TFT for the Rasspberry Pi

Flip Schaumal
Posts: 5
Joined: Wed Aug 16, 2017 7:30 pm

Re: LED Cube RGB 12x12x12

Thu Aug 17, 2017 4:40 pm

Hope to get your question right:

Let's assume we have an SPI clock of 5 MHz wich equals 5 Mbit/s.
If we had 1024 RGB LEDs (= 3072 single LEDs) and had only 1 bit per single LED (on/off), then we came to a maximum FPS of 5 Mbit/s / 3072 bit = 1,63 kHz.
If using a TLC5940 as a SPI controlled PWM driver, you may choose between CS mode (= 6 bit / output) and GS mode (= 12 bit / output).
In CS mode, you have 6 times as many bits to transfer, resulting in 1/6 of the frame rate, which is 271 Hz.
In GS mode, you have 12 times as many bits to transfer, resulting in 1/12 of the frame rate, which is 136 Hz.

These calculations reflect the amount of data that is required to update the display, it is independent from the HW architecture (all LEDs controlled simultaneously or multiplexed). However, there's always some overhead (and in my case the communication with the FPGA), so the SPI clock rate should be a bit higher than the actual data amount per frame period.

In my cube, the SPI clock frequency is 12.5 MHz (=400MHz Core Timer / 32). I use the CS mode of the TLC 5940 to control 1728 RGB LEDs. This results in 31.1 kbit/frame, and with 280 frames/s the mean SPI traffic to the TLC5940 is 8.71 Mbit/s. So I do update all LEDs with a fps of 280 Hz.

The challenges of doing so were especially:
- using the DMA controller to feed the SPI peripheral with data in time
- HW design to support 12.5 MHz SPI clock rate
- As soon as it eventually works, don't ask why and don't touch it


Flip Schaumal
Posts: 5
Joined: Wed Aug 16, 2017 7:30 pm

Re: LED Cube RGB 12x12x12

Thu Aug 17, 2017 5:36 pm

mwilliams03 wrote:
Thu Aug 17, 2017 4:21 am
Below is 2,048 LEDs on one Pi
Amazing and spectacular project! Width and height yield more opportunities than depth!

User avatar
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: LED Cube RGB 12x12x12

Tue Aug 22, 2017 8:57 am

I found this by chance and I'm pleased I did. Amazing project.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

Flip Schaumal
Posts: 5
Joined: Wed Aug 16, 2017 7:30 pm

Re: LED Cube RGB 12x12x12

Tue Aug 22, 2017 4:23 pm

Thanks :)

Return to “Other projects”