1. It's built with a low number of off-the-shelf components and hooks up directly to the Arduino.
2. A clear, easy to reproduce circuit diagram is provided with plenty of photos.
3. A unique approach is used for the software which makes programming the cube easier and more expressive.
Parts needed:
- 1 Perfboard
- 3 NPN Transistors (2N2222, 2N3904, BC547, etc.)
- 12 Resistors (~220 ohms and ~10k ohms)
- 13 Headers (male or female)
- 27 LEDs
- Wire
Remove these ads by
Signing UpStep 1: Prepare the LEDs
Each set of nine LEDs will share a common connection amongst their cathodes (negative leads). I'll refer to each of these sets as a "level". Each of the nine LEDs on a level is connected to the corresponding LED on the other two levels through their anodes (positive leads). These will be referred to as "columns". If that didn't make sense it will become self explanatory as we build the cube.
To start we'll use a drill to create a jig out of a small piece of scrap wood. The jig will hold the LEDs in place while we solder them. I decided to space the holes around 5/8 of an inch apart (~15 mm) but the exact distance isn't critical. The hole should have a tight fit around the LED since we don't want them to move around while soldering.
Once the jig is done we're going to bend the cathode of each LED in a 90 degree angle. The cathode is identifiable in three ways: 1) It's the shorter leg, 2) It's on the flat side of a round LED, 3) it's connected to the larger piece inside the LED. Make sure you bend the cathode in the same direction for all of the LEDs.
Now we're ready to begin soldering.









































Visit Our Store »
Go Pro Today »




is it possible to transform your 3x3x3 led cube to 7x7x7 one. I try this and the result is not like I would! My output are not in order, how can I write them : first line (left to right) second line (left to right or right to left) etc...
and when a led sould be on it's be of and inversely, is it normal?
thanks
can you please help me in connecting the wires from the led to the the ports on an adruino?
i have very little knowledge on which port to connect thee pins from the led to the adruino
First I wanted to write my own library, but am not so fit yet... So I try to understand Yours and am playing around with Your code.
In the function LedCube::lightDrop I found an error since the column on Pin 10 never lights up. The parameter where You call lightPulse has to be (r-1, col, wait)
and not lightPulse(r-1, col-1, wait);
and I also wrote a function called lightRise so You can do a random column rise:
void LedCube::lightRise(byte col, unsigned int wait)
{
for(byte r=0; r<=levels; r++)
{
lightPulse(r-1, col, wait);
}
}
Please try the latest on Github:
https://github.com/gzip/arduino-ledcube
And feel free to submit a pull request for the new method (or the bug if it's still present).
code is inefficient as the arrays are defined each time the loop runs, this is just to move them through the "planes" with a bit of work, this can be rectified.
some coding knowledge may be required.
Arduino LED Cube code
hi,, thank u for your efforts,, i did every thing right but when i download the library an error occurred :
1-
at LedCube cube(SIZE, levelPins, colPins); i get this error :
'LedCube' doesn't name a type
Thank you in advance :)
and then get these jump wires
http://unmannedtechshop.co.uk/Cables-Connectors/Jumpers?product_id=115
Cant wait to get going on this!!
Cheers
When I try to upload the library directly, I get the following message:
avrdude: stk500_getsync(): not in sync: resp=0x00
Thanks!
Thanks!
In the video (which is the LED cube example) you can put only one LED on the third level, without the need to turn off the rest of the column, the second 4 of the video you can see. Is it possible with Arduino?
How I can do?
My question is because when I try to do, for example, just turn on the LED Level 2 column 4 and the LED Level 1 column 5, the LED on the level 1 column of 4 lights also because the level and column are on
byte levelPins[SIZE] = {11,12,13}; byte colPins[COLS] = {2,3,4,5,6,7,8,9,10};ledcube.cpp:1:21: error: LedCube.h: No such file or directory
ledcube.pde:-1: error: 'LedCube' does not name a type
ledcube.cpp: In function 'void loop()':
ledcube.pde:-1: error: 'cube' was not declared in this scope
Plz help me
Another option is to add the library to the main libraries folder (which is in the same folder as the arduino executable). It's just a less flexible location since you'll have to move any libraries that you've added there the next time you upgrade the arduino software.
Either way you should find the example under File > Examples > LedCube > ledcube if you've set everything up correctly.
The performance of the pattern select button interrupt is still a bit flaky and annoying but overall there's improvement.
http://205.196.120.174/bz76g4wwdkpg/rqi7xkzmjc0yzlg/AlsLEDCube4x4x4Bv2.zip
The other link below has been removed, and the Version 2 really is better, so if anybody actually downloaded the first version, please dump it and use V2 instead.
Thanks for a great time waster !!
--Al
Secondly, how can I expand this to be 4x4, 8x8, etc. Is your library scalable - what modifications would need to be made? I hope you answer, I loved this project...
I tried to keep a scalable library in mind while coding but its still mainly geared towards a 3x3x3. If you're comfortable making modifications I can take a closer look to give you an idea of what it might take. You'll still need either more pins or some type of shift register or driver to power more LEDs.
My power source is the arduino at 5v - I'm using the Modern Device board. Should I be contemplating an external power supply?
I am changing gears and will use shift registers... I want to build an 8x8x8 cube... I now have 3x3x3 and 4x4x4 cubes working fine using your library... Which is great.
I think it would be great to have your library handle the 8x8x8.
I just finished making an acrylic template that will allow me to build a more precise cube. The wood base lent itself to errors... I used a laser cutter for the acrylic...
Also, I was not sure if I needed to change the library or not. There were some items in the example code I though to change but I am not sure. I have java experience but I am new to arduino, so understanding code is easy but understanding the arduino is harder.
Would you be willing to send me the source for your 4x4x4 so I have something to work off of? Thanks.
Cool that you're able to use the lib with a 4x. How many mods did you have to make? Send me the code when you have a chance.
http://www.youtube.com/watch?v=VH2tW6YQ-5U
I thought this instructable was the best of many concerning the building and operation of an Arduino-powered LED cube, even though it was just for 3x3x3. The 4x4x4 version is still pretty cheap and simple to build, but the other builders didn't have the great program code that gzip and bogyman57 have here. The existing code is "almost" fully ready for 4x4x4, and it's obvious that gzip and bogy wrote it with as much generality in mind as possible. I tried to make my modifications and additions with the same idea, but there are a couple places where I got lazy and hard-coded the 4 and 16 parameters or a brute-force routine. This can be easily fixed, I think, to generalize the sketch and the other files to arbitrary X x Y x Z arrays.
My cube works great with the OSEPP arduino MEGA clone. Others might have to adjust the pinout arrays in the .pde file to correspond to your cube wiring, but if you follow the instructions in this instructable and just extend in the logical manner your pinout will be the same as mine, probably.
Thanks for this great instructable and the originals of the library files!! I can really appreciate how much work went into writing those files.
Others may also need to adjust the timing variables to get the patterns to display pleasantly on your board.
The zip file of the .pde, the .cpp, and the .h files is here:
[url]http://205.196.121.50/3jbuw3i36mvg/laj2cixxb9z99hh/AlsLEDCube4x4x4Button.zip[/url]
Fun Stuff !!
--Alsetalokin
u can get them on ebay or in many other shops.
for example this arduino:
http://www.ebay.com/itm/DUEMILANOVE-Arduino-Compatible-/290672951360?pt=LH_DefaultDomain_0&hash=item43ad754040#ht_2120wt_901
u get a cable with it. with the USB cable u can connect the arduino to the PC and install the program into it or program it by your self.
go to arduino.cc and download the software. that here on the last step u can download and example and send it to the arduino.
hope it helps. thats all i know :)
My solution was to replace the
" if (r && r < levels) "
with the code
" if ((r+1) && r < levels) "
in the "lightLevels" function in the LEDCube.cpp file, save the file, exit the Arduino IDE and restart, recompile your .pde file. Now all three levels work in the "OneLevelAtATime1" function call.
Please -- can you help to extend your code to a 4x4x4 cube !!??
I'm not sure I have the column pins correct for the other software; that instructable wasn't too clear on columns, rows, and planes, but I think I'm correct because it makes what seems to be the proper patterns.
I'd like to be able to use your software in a 4x4x4 version.... is it possible to modify the program easily?
Thanks--- great fun project.
yes the value would be higher then what you are using i.e 1 watt but i think that may work but i could be wrong anyway i have nearly finished my own so i will try this with a 50 Ohm POT, anyway thanks for your help.
i understand the part how to make the cube without arduino "part".
is this arduino ok?
http://www.ebay.com/itm/DUEMILANOVE-Arduino-Compatible-/290670310049?pt=LH_DefaultDomain_0&hash=item43ad4cf2a1
if yes. How do i know where to connect individual wires from the cube to the arduino itself? TBH i really dont know anything about microcontrollers/microchips nor know anything how to program them. but i know basic electronics such as:
welding/soldering , know how to use a multimeter, knowing many formulas about electricity, etc.
one more question: do i get the programing software with the arduino? and how to transwer pre-made code to the arduino without programing "part"?
I'm very interested to make my self a 3x3x3 cube. because it looks so good.
thx in advance.
have a nice day.
I unzip-ed the "LedCube.zip" into the sketchbook/libraries folder and into the examples folder, than i ran arduino.exe and opened the example and clicked compile. it gave me no error, so i think i did it right.
So now after the example is compiled, its ready to be uploaded to arduino,
and the led cube should start working?
and i still dont know how to connect the wires from the headers on the cube to the arduino board.
should i try to connect them as u did in the first picture of this instrustable?
sorry if i sound a little stupid because i dont know much about arduino.
I read that from the schematic for the arduino.
I'm gonna try to mess with the code and try to program a bit :)
most of the codes makes sense and are easy to understand,
thx for help. will build the cube as soon asi get the materials.
have a nice day!
http://www.citistore.gr/arduino-uno.html
http://www.citistore.gr/arduino-uno-rev3.html
Please help me....(sry for my english)
I am also new to this and do not speak English XD
As for "LedCube does not name a type" and "LedCube.h: No such file or directory", It sounds like you still need to unzip the LedCube folder to sketchbook/libraries. Once you have that set up correctly you'll get an entry under File > Examples > LedCube > ledcube which you can open and compile without problems.
1) As suggested by the instructor, if I were to do another one of these, I would wire up the LEDs so that the cathodes are on the outside (i.e., the gnd connections that all LEDs on a single level share) and the anodes were on the inside (i.e., the + connection shared by all LEDs on a single column). I did it the opposite way, and i had to bend a lot of the leads on the columns over the LEDs below. Also, I had two rows of blue and one row of red because that's what I had on hand.
2) Definitely be careful about all of the overlapping wires connecting the resistors to the cube's columns. I didn't have electrical tape and used duct tape, which I wouldn't recommend. I'm having some problems with one particular column (#3) not lighting up, which I suspect has something to do with having several different wires overlapping it.
3) I did not have the fancy pin connectors shown in the picture, so what I did was take a bunch of rubber coated leads I had from a starter pack and pulled off one of the metal tips from the rubber gaskets on the end. I then plugged those (now female) sides of the leads onto the pins sticking up from the perf board.
4) This took me several hours to build and solder, but I was extremely happy with the sucker powering up and dancing on the first try. The sample library compiled and uploaded without error on an Arduino Uno r3 and Arduino 1.0.
Booya
i use the latest arduino software. its the same as andray.
What version do you use Jwgillon?
See this http://arduino.cc/forum/index.php?topic=81078.0 for more information.
I've build this cube Will this code work on ARduino Uno. Getting a Bunch of Compile errors
Thanks for sharing
Danie
sorry i dont want to wast your time, just trying to figure things out.
I used female headers so I could use the jumper wire I had.
Heres a pic
I would kill to get some more code, effects for my cube but I just can't get my head to figure out how to do this...
anyway, thanks
Eric
Thanks
http://img.instructables.com/files/deriv/F01/I0OW/GUOAEGJA/F01I0OWGUOAEGJA.SQUARE.jpg
that was a try...
Thanks again for the great instructions.
I built one last Friday night, and spent the weekend playing around with the demo code. I've added a bunch of new patterns, and "subroutineized" everything.
Here's the aformentioned arduino ".pde" file if anyone is interested.
To save the attachment:
Right click on it and select "save link as" and rename it to something more meaningful like "ledcubedemo.pde" (or something like that)
Happy Hacking!
Seeing different code do similar things has helped me see a different way of handling the drawings/designs. I had a few programming classes in college for C and C++, but it's been a good 15 years since I've done any kind of coding besides simple scripting on rare occasions. Anyways, if I make any significant changes to your code I'll be sure to post it up here off your comment. I built a 4 cube and was hoping I could understand this code well enough to adapt it to my 4 cube I've been playing with some with my Arduino Uno. I'll probably have to make a few changes to the LEDcube.h library, but I've been reading through some guides for building your own libraries. It's a lot to learn, but I've enjoyed the challenges so far.
how would i fix this?
Have you installed the ledcube library as per the original author's instructions?
I hope this helps
64 LEDs are a lot more than 27.
Perhaps the original author can point the way?
1. What is byte me?
2. What is byte meMax?
3. Are the horizontal and vertical int arrays patters that the leds go through, since they are the level and col you want to light up?
Thanks Again.
2. meMax is the top limit for iterations (loops) so if meMax = 5, then all the routines will repeat 5 times (except the buffered ones because they take longer)
3. Yes
I'm playing around with the code now and I see the basic theory of how it works and now that's it all together and I'm able to tweak the code. Gonna try a 4x4x4 using 16 gauge wire to build a grid then bend the LED legs so the slide on for easier soldering and hopefully to make the thing a little more structurally solid. I saw some pictures in another LED cube guide in the comments that explained it and had pictures. My 3x3x3 cube I used a jig, but soldering the levels together I bent a few out of square so they don't all line up perfectly. Still this was totally awesome and thanks!
I used 5k and also hooked up one to a 22k and there seems to be no difference!
Why resistor in the base of transistors so huge? This is reduce brightness.
According to my calculations suffice 1,200 ohms.
Found this formula somewhere and got weird values for hfe ~ 60
Rb = (Vc* hfe)/(5*Ic)
If you still want to go that route the Arduino Playground has some good info on the chip: http://www.arduino.cc/playground/Main/MAX72XXHardware
And this seems like a library worth looking at:
http://www.wayoda.org/arduino/ledcontrol/index.html
I can certainly chain a lot of max chips... But I need to power the final solution by some external source...
CanI separate the power supply to the maxchip and the leds from the arduino?
Hi... I presently use that library and it works great for driving 7-segment displays...
I'm stuck on understanding how I would wire / configure / identify / call the individual levels... I'm wiring up an 8x8 matrix to work with the LEDControl library... I get the rows and columns thing - I just don't know how to add the additional dimension of "levels" and how I would trigger them using the library... Any thoughts?
Now... how do I use it? I cannot figure out where to put the files included - LedCube.cpp, ledcube.pde, and the directory LedCube. For the life of me I can't get anything to compile due to missing/poorly configured files. Could you tell me what goes where and into which of the following directories?
F:\My Documents\Arduino\
C:\Users\<username>\AppData\Roaming\Arduino\
Am I missing any directories?
Your help would be greatly appreciated.
Thanks!
http://www.gzipped.com/electronics/arduino/code/ledcube/ledcube.pde
Brilliant design, So simple! how ever i was having a problem with your libary/example code, Most likely user error. The error i got was:
In function 'void loop()':
error: no matching function for call to 'LedCube::lightPerimeter(int)'C:\arduino-0017\arduino-0017\hardware\libraries\LedCube/LedCube.h:27: note: candidates are: void LedCube::lightPerimeter(byte, byte, unsigned int)