Show Posts
Pages: 1 ... 4 5 [6]
76  Using Arduino / LEDs and Multiplexing / Re: 5x5x5 LED cube - video on: October 07, 2011, 01:13:20 pm
I guess that your cube is (as the one at instructables) can only light one LED per column/layer combination, resulting in a maximum number of 25 simultaneously lit LEDs, is that correct?

Technically speaking, all 125 LEDs could be lit simultaneously.  Any combination of transistors could be turned on or off at will.  However, in doing so, I would burn up the AVR as well as overload the 1/4w resistors being used to limit current.  But that is why multiplexing and persistence of vision is great. smiley 

The code sets up an interrupt to control the turning on and off for me.  I can make it appear that all 125 leds are on at the same time but the code limits it to being just 5 at a time (one row).  This is, in effect, one led per column can be lit on the cube at the same time to ensure that the current limiting resistors are working correctly.

77  Using Arduino / LEDs and Multiplexing / Re: 5x5x5 LED cube - video on: October 06, 2011, 11:49:29 pm
As I too built a 5x5x5 cube, I would be interested in seeing your code to see how you approached the tasks. Also how did you come up with the pattern data, manual coded or some PC based pattern editor?

Nice video and nice project.


Thanks.  The animations are manually coded.  The sine wave and a spinning line is set in a 2d array and put into memory.  Each value represents the LEDs of a row and the dimensions of the array are for the columns and levels.

There is another function that I'm still working on adapting from the 4x4x4 cube to wrap patterns around the outside of the cube called 'wrap it' that uses an array to store the values going around the cube.  Previously I was wrapping a sine wave around the outside but it will allow wrapping any pattern around the cube including text.  For text, it would only wrap around 2 of the sides to allow for better reading.  I don't know how good the reading of the text will be yet though.  

To create the array values for some of the animations, I just used MS Excel to visualize each frame then manually converted the visualization to binary and used the bin2hex function to convert it to hex to load into an array.  The 'wrap_it' function then loads the frames up one bit at a time and shifts them out to the display buffer.

Here is a link to my code as it is today (as you saw it in the video).  I really need to separate it into some other files and do includes but have so far not done so.
78  Using Arduino / LEDs and Multiplexing / 5x5x5 LED cube - video on: October 06, 2011, 11:08:33 pm
This is the first project that I have completed with the ATMEGA328 mounted on the PCB. 

I got the inspiration from an Instructables 4x4x4 cube ( and built one first.  I created the PCB myself and it had some pin headers on it that required my Arduino Uno to control it.  I adapted the code from the instructables guide to use with the Arduino and added a couple of custom animations myself.  I really wanted to be able to display text and a 3d sine wave so this led me to this project to make a 5x5x5 cube.

I created my design using Fritzing ( and then sent of my gerber files for some custom PCBs.  This cube consists of 125 3mm blue LEDs.  Each layer of the cube has the cathodes of the LEDs is connected together and controlled using a NPN transistor for a total of 5.  The 25 anodes from each layer are connected to the other layers and controlled using 25 transistors.  These transistors are then controlled using rows and columns to address each LED.  The gates of the transistors are connected together to form each column and the base of each transistor is connected together to form rows. 

Each transistor has a 1k ohm resistor and each row had a 82 ohm resistor to limit the current going to the LEDs.  I wanted it to be a bit brighter so I changed out the 82 ohm resistors to 68 ohm resistors.  This is overdriving the LEDs rated current of 20ma a little but since it is multiplexed, I am not too concerned.  This took 2 days of troubleshooting to get it to work.  I found a couple of minor issues with my initial PCB design that I corrected using a couple of jumpers and then I still couldn't get it to run.  I finally added a .1nf capacitor across the power terminals and it finally worked.  I'm quite happy with the results.  I don't have the 22pf capacitors typically used with the crystal installed in the video.  It runs fine without them.

I am powering the cube using a USB to 2.5mm jack.  This allows me to use a USB adaptor to plug into the wall or just plug it directly into a computer to power it.  In the next design, I'll add a header for programming the ATMega without having to pull it from the socket. smiley

I welcome your feedback and if there is interest, can post my Frizing file as well as share the code used.

79  Using Arduino / Microcontrollers / Re: bootloading the atmega328-pu on: October 06, 2011, 09:43:17 pm
Thank you!  I just received an order of 10 of these and started to panic when I got the error about it stating the signature was wrong.

This worked perfectly!
Pages: 1 ... 4 5 [6]