My 3x3x3 and 5x5x5 LED cube

this is the proper link in case its not working ;):
https://www.dropbox.com/sh/5jzjoelre7b6h4g/t-_ULpv3Oq/DesignV1.ino

Edit: Notice in this code all the animationDelay times are 100milliseconds. In the video I showed they aren't.

I have noticed that you use shiftOut() instead of the SPI library that I use. Theoretically the SPI library's methods are faster, but I'll try out shiftOut() too, who knows, maybe it makes a difference...

Yes SPI transfer is faster, however this code is version 1, so I will have a look at it to let it perform better in the near future :).

Maybe I'm going to create an array generator for the animations as well.

Well I couldnt wait and modified the code to SPI.transfer. Still no problems with ghosting...

link:

https://www.dropbox.com/sh/5jzjoelre7b6h4g/xAy4sVeAhI/LED_CUBE.ino

Edit: Still the code I'm using is not a good way to program the cube. After a while u will run out of memory and the cube is going to do strange things. Even now I'm using PROGMEM its not working. Is it possible that you can post your code as well??

I have built a few cubes, and I dont think that I have noticed any ghosting. Do you have any videos of the ghosting?
My first cube only lit on LED at a time, I modified it to use shift registers and it lights 16 LEDs at a time. I havnt noticed any ghosting, but maybe its happening, and I just didnt notice?

Hi Guys!

@Hippynerd: If your cube would have ghosting like mine, you would notice it, trust me :slight_smile: It is very visible and... annoying. Unfortunately I can't create a video as my camera is broken and even for my last video I had to borrow one (I really should get one...), but I can describe it the following way: when multiplexing is used, the ghosting is seen as the previously multiplexed (lit) layer turning off too slowly, so basically you see a ghost image (dim image) of the current layer in the previously lit layer. So, if you light up an LED in the bottom layer, you'll see the LED which is in the same column and in the top layer (bottom layer is lit after the top layer because the layers come after each other from bottom to top) dimly lit. If you light an LED in the second layer, you'll see the LED below it dimly lit. For the third layer the ghost will be in the second layer and so on.

@WonderTiger: Sure, you can check out my code here: http://iqjar.com/download/jar/LED_Cube/4x4x4/LEDQB_v0.4.ZIP
I've taken a slightly different approach. My animations are all generated on the fly, no patterns are stored anywhere. I also put great emphasis into keeping every part of the code in the place where it logically belongs, so I have lots of files and classes. So far it worked out well, we'll see how well it will work with the 8x8x8 cube... The part that writes the data out to the cube is in QBWriter.cpp, in the function QBWriter::sendOutputBuffer(). You'll see there that in the first step I shift all 0s into all the shift registers and then, if there's any non-zero data to be displayed, I first wait for 75 milliseconds (delayMicroseconds (TurnOffLatency); //Wait for everything to turn off). this is a software fix to get rid of the ghosting. I'd like a hardware fix though :frowning:

void QBWriter::sendOutputBuffer () const
{
    //To get around the ghosting introduced by the slow turning off of the cathode columns, we first turn everything off and wait a little
    digitalWrite (PIN_SS, LOW); //Start transferring data    
    for (byte i = 0; i  <= N; ++i)
    {
        SPI.transfer (B00000000);
    }
    digitalWrite (PIN_SS, HIGH); //Done transferring data
    
    if (isOutputDataNonZero ())
    {
        delayMicroseconds (TurnOffLatency); //Wait for everything to turn off
  
        //Then we push out the contents of the output buffer to the LED cube    
        digitalWrite (PIN_SS, LOW); //Start transferring data
        for (byte i = 0; i  <= N; ++i)
        {
            SPI.transfer (mOutputBuffer[i]);
        }
        digitalWrite (PIN_SS, HIGH); //Done transferring data
    }
}

Hi, Hey Wonder Tiger do you have a schematic or building instructions for you 5x5x5 LED Cube? If so could you post it?

Actually I don't have any schematics or instructions really :(. If you really need help I can make some instructions though, but a search on google maybe gives you more information?

Its long time ago I made a vid. This is due I was very busy with school ( i had to make a Graphical User Interface for a little project, which was a good learning experience!). Last week I finally had some time to rewrite a code for my LED cube, now I'm using a Interrupt service routine to multiplex my cube and I'm able to adjust the brightness of the LEDs which results in this :):