Pages: [1] 2   Go Down
Author Topic: 5x5x5 LED cube - video  (Read 5765 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 (http://www.instructables.com/id/LED-Cube-4x4x4/) 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 (http://fritzing.org/) 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.

Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 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.

Lefty
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26535
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice! Build looks good, patterns are interesting!
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Lefty


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.  
http://bit.ly/r75Xg4
« Last Edit: October 07, 2011, 12:00:43 am by Cranium » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd be interested in the fritzing layout or circuit schematics (including resistor values as I have nearly fried one IC by pulling too much current in a similar project).
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?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
nice project you have.

Can you share your PCB schematics and components lists? I would like to try to build one too.

Thanks!
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is the Fritzing file I created for the project: http://www.mediafire.com/?n4wcun4zxn40oxz

Note that I added a 100nf capacitor across the incoming power since my original design and have reflected that in the file.  I also reduced the current limiting resistors from 82Ω to 68Ω to increase brightness a little.  There was also an issue with one of my traces being routed on the wrong layer requiring me to cut it and use a jumper on the underside.  That was also corrected in the file.

If you build this using my PCB design, you might want to increase the hole size for where the anodes attach to the PCB.  This will make it easier to put attach the cube to the PCB.  I've built 4 of these so far and have managed with needle nose pliers and patience though.

If you want one of my circuit boards, I still have a few and can sell you one for $12 shipped in the US.  Or if you want a parts kit with it , I can do that for $30 shipped in the US.  This would include:
  • 130 blue 3mm leds
  • 30 transistors (2N3904 or 2N4401 depending on what I have on hand)
  • 31-1kΩ 1% resistors
  • 5-68Ω 1% resistors
  • preprogrammed and tested ATMega328
  • 16MHz crystal
  • 2-22pF capacitors
  • 1-100nF capacitor
  • power connector
  • two sided solder masked PCB
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That is so fascinating!!! This is exactly what I wanted to do. I'm currently a freshman in college learning all this as a computer engineering major. So, I don't really have the knowledge of the circuitry and programming, but I am getting there. I really want to make several 5x5x5 LED cubes for my friends as a christmas present! I'm just searching for the best instructions to work off of. I think this is perfect. I don't really have a XML reader for the link that you shared with the components list and PCB. Any suggestions? Also, would you mind if I asked a bunch of questions in the next few weeks about the construction of the cube? I sort of want to know what I will be doing before I do it.
Thank you!  smiley
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That is so fascinating!!! This is exactly what I wanted to do. I'm currently a freshman in college learning all this as a computer engineering major. So, I don't really have the knowledge of the circuitry and programming, but I am getting there. I really want to make several 5x5x5 LED cubes for my friends as a christmas present! I'm just searching for the best instructions to work off of. I think this is perfect. I don't really have a XML reader for the link that you shared with the components list and PCB. Any suggestions? Also, would you mind if I asked a bunch of questions in the next few weeks about the construction of the cube? I sort of want to know what I will be doing before I do it.
Thank you!  smiley

I suggest you start here: Instructables 4x4x4 cube (http://www.instructables.com/id/LED-Cube-4x4x4/) as I did.  If you want to open the file I included for my plan, click the Fritzing link and download it (free).   That is the format for the file. 

Funny, last weekend my son came over for the weekend from college to build one of these cubes.  He liked it and wanted one as well. 
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm having trouble opening the XML file on the Fritz application on my Mac. Is there something I'm missing? The application doesn't seem to be able to open a XML file, I can't click on it because its shaded out when I press "open" under File.

Thank You.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay never mind I got it. The board is just amazing!
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If anyone downloaded my fritzing file for the 5x5x5 cube and still has it, can you send it to me please?

Norton backup sucks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  Even though I was backing up the my documents folder, it skipped file types it didn't recognize.  Way to go Norton!!!!!!!!!!!!!  f'ing pissed.  Lost a lot of my projects.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26535
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Oooh, major bummer!
Any chance you  can recover some from e-mails sent to board houses or other users?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have the gerber files and can rebuild some of the circuit board designs I lost but this will take many hours of recovery.

btw....did I mention Norton backup sucks? smiley-wink
Logged

Pages: [1] 2   Go Up
Jump to: