RGB LED cube 5x5x5

What's this?

   Most useless decoration in your flat! LED cube is basicly real 3D display. Resolution is defined by number of LEDs. Higher resolution allow more "realistic" effects, but LED request increase by thirth power. So it is good idea to choose "right" number of LED (resolution vs difficult). This version have square size 5, but used LEDs are RGB which allow make effect more effective.

RGB LED cube 5x5x5 foto

How it works?

   As controll unit was selected ATmega64 because of flash memory size (64kB). This AVR have enough I/O pins, harware PWM, UART, SPI and I2C interface. Because RGB LEDs are used we get 3 independent color channels. PWM is used for for LED intensity controll (channels R, G and B). If all color channels will be active, it is possible set any color we want. Limitation is mostly by software, because for one 3D frame is possible set exactly one combination PWM values.
Whole device was designed for supply from USB without need of external power supply. So for LED supply was used DC/DC converter (higher power effecitvity). This brings some advantages:
  • Lower power consumption
  • Higher safety
  • Wide external power supply range
  • Because voltage for AVR and LEDs is lower (DC/DC used) it is possible use lower serial resistors for LEDs. So there will be lower losses on these resistors and loss power will decrease. Voltage on DC/DC was set to 3.9V. This voltage is high enough for light on blue LED and there is some reserve for power losses on transistors and wires. Due to lower voltage there will not be risc of damage LED by inverting polarity. Another advatage of DC/DC converter is that maximum current from DC/DC can be higher than current on input power supply connector. This is main advantage when connected to USB power supply (limit 500mA). Thanks to protective diodes it is possible power LED cube also from external power supply in range +5~36V DC.
    So device can be powered by one of the following power supply:
  • USB connector - +5V DC
  • External PWR supply - on Schematics EXT_PWR. +4V~36V DC
  • ISP programmer - to connector AVR_ISP pin 2 put +5V DC

  • When device was designed there was also calculated with connection with matrix keyboard, I2C or SPI device.
    Device also contain USB to UART interface. This feature allow connect LED cube with computer and for example play animations directly from computer, where is not such memory limit.
    Reprogramming is possible through standard 10 pin ISP connector for AVR (allowed is 3.3 to 5V range thanks to protective resisitors).
    Because controll every single LED directly by MCU would be nearly impossible (needed 375 pins), LED controll is done by multiplexing. Projection scheme and description is on following images.
    Projection scheme - pinciple Projection shceme  - detail
    First is "activated" wall - WALL0 (T2 swich on). Then is selected column - COLUMN0 (T18). Transistors T3~T17 switch cathodes elementary LEDs. Process wait some time (in this moment is appropriate do data processing). Then is "deactivated" COLUMN0 and "activated" COLUMN1 and so on. Schematics is on following image.


    Main program is simple: MCU initialization and then jump to infinite loop where is called function that display 3D image.

    Flowchart - main function

    Biggest problem is data processing because of need refresh 3D frame. Data processing is split to two threads. First thread load 3D images to framebuffer.

    Flowchart - data processing for animations
    Flowchart - processing animation data

    Second thread contains many others functions which are called according to "schedule". This scheduling is need because of lack computing time (just few hundreds microseconds).

    Flowchart - processing others

    Assistans SW for generating animations

    Because creating animations in raw code is very complex there is simple console application which allow simplify this operation. On the following image is application demo.

    Anime maker demo

    Application show actual frame number, selected wall and column. Also show calculated time. On following picture is shown 2D image on selected wall. Colors are symbolized "R", "G" and "B". When user type "exit" animation is generated and saved to .c and .h files. These files user copy to project and set pointer to animation. Example:
    /* Set pointer to animation in flash memory. It is basicly pointer to
     * array where are binary data stored
    p_anime = array_with_binary_data;
    Anime maker automaticly detect if some frames are repeated, void or full. In these cases just write one command which MCU must know. This way is done data compression. Of course that compression ratio depends on animation itself, but size of animation "snake" was reduced to 1/2. Compress algorythms can be expanded, so binary code can be even smaller.

    SW for control cube

    After longer break I came back to this application. First version allow contorl cube through UART. Respectively clone actual image from PC to real cube. This is only first step and it menas that new options available (animation, random colors, maybe simple game?). Of course you can play with virtual cube without need real one.

    Application screenshot

    Application is written for Python3 (you can not stop progression) and require pygame (3D cube) and optionally pyserial (communication through UART).
    Application is still in development version, but comments are welcommed!

    Demo videos

      Video has crappy color resolutions, so in real are colors more colorful. Also human eye do not see LED blinking which cause PWM and on video is very annoying. Also I do not know why are there "ghosts" from LEDs. Anyway, You can make a picture.

    Few demo animations


    All in one and up to date:

    git clone --recursive git@gitlab.com:RGB_LED_cube_5x5x5/RGB_LED_cube_5x5x5.git

    Old and not updated:
    HW design Firmware Another software Documents
    HW RGB led cube 5x5x5 00  (649x)

    Fisrt and functional version

    AVR RGB led cube 5x5x5 0.1 alfa  (302x)

    Alpha version (not completly finished)

    Contains few demo animations

    Animations can be skipped, repeated

    Compatible with anime maker 0.1

    Anime maker 0.1  (282x)

    Software for creating animations

    Automaticly make compressing of animations

    Basic documentation  (1177x)

    Update 2015/09/04

    User manual

    Documentation geenrated by Doxygen

    Scheme of projection


    AVR RGB led cube 5x5x5 0.2  (228x)

    Not completed yet, but somehow works

    Contains few demo animations

    Animations can be skipped, repeated

    Compatible with anime maker 0.1

    Support matrix keyboard

    AVR RGB led cube 5x5x5 0.3  (263x)

    Support modes for playing animations and "drawing".
    For controll keyboard is needed.

    Contains few demo animations

    Animations can be skipped, repeated

    Compatible with anime maker 0.1

    Support matrix keyboard

    AVR RGB led cube 5x5x5 0.5  (193x)

    It is possible control from PC. Support PC application v0.1a.

    Added one animation ;)

    Compatible with anime maker 0.1

    RGB led cube app 0.1a  (183x)

    Generic application for LED cube control

    Require Python3, pygame (3D model) and optionally
    pysrial (control through UART)

    Alpha version, but working on new version


       Project come into existence as part of subject MPOA .
    Project is not dead yet! Right now I'm working on PC application. (update 2018.10.22)

    Update: 2018.10.22