The 4x4x4 LED Cube Arduino
The 4x4x4 LED Cube Arduino
Table of Contents
Step 5: PROGRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Step 6: ADD on . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
http://www.instructables.com/id/The-4x4x4-LED-cube-Arduino/
Intro: The 4x4x4 LED cube (Arduino)
In this instructable I will show you how to make a 4x4x4 LED cube that will be controlled by an Arduino Demulionove. now yes you might say" that Arduino has only 14
I/O pins well also the 6 analog pins can be used as pins 15,16,17,18,19,20. that way giving us enough pins (16 columns + 4layers = 20 I/O pins)
This instructable is made for those who know how to solder (well) and how to program the Arduino. Also I will be providing detours to skip sum steps so if you see
(Detour available skip to __ Step) you can follow if you are to lazy to do that.
Mandatory
-- 64 LED (color optional) **
-- Arduino Demulionove
-- Wire
Optional
--32 male pin strip
--PCB prototype board
--Fine Grit (400 +) sand paper
Your choice
-- 64 resistors or 16
you can get 64 resistors which will help by keeping all the lights at the same light out put regardless of how many are on but it will be considerably more work.
Tools:
--Computer
--Soldering Iron
--Solder
--thin nose pliers
**Color is optional but use this website to find the right resistor for your leds http://led.linear1.org/led.wiz (I got Green so I used 100 ohm resistors)
http://www.instructables.com/id/The-4x4x4-LED-cube-Arduino/
Image Notes Image Notes
1. 64 LED your choice in this case its green 1. supper Bright
2. PCB but I didn't end up using this one because it was too small so I used a 2. clear
bigger one
3. broken off peace off the 32 male pin header
4. Arduino
5. 64-100 ohm resistors
6. 400 G sand paper
7. My keyboard
Image Notes
1. now Defused LED
In this step you will need the board and the wiring. First you will want to map out were all the wires will go and then feed the wires through the board. Don't mind the LED
and resistor note on the picture for now.
NOTE: I recommend you use Different color wire just because you won't get confused which wire is which.
http://www.instructables.com/id/The-4x4x4-LED-cube-Arduino/
Image Notes
1. 100 ohm resistor
2. coloms(+) 1 - 8
3. coloms(+) 9 - 14
4. coloms(+) 15 ,16
5. levels(-) 1 - 4
6. defused LED using sand paper
So to defuse the LED I took normal 400 grit sand paper and sanded all the LEDs which made them look pretty good.
http://www.instructables.com/id/The-4x4x4-LED-cube-Arduino/
Image Notes Image Notes
1. normal 1. with flash you can still see the defused one but not the normal
2. after sanding
Image Notes
1. this = lighting up the LED above it
2. this = dispersing light
My solution to this was to solder a 100 ohm resistor to each LED. (Follow picture instruction on how to do it.) Everything is done in the same way only now you solder all
the resistors to the column which is a piece of Ethernet wire. (See picture)
Image Notes
1. the resistor
2. LED
3. resistor plased in between the (-) bent down and the (+) bent up.
http://www.instructables.com/id/The-4x4x4-LED-cube-Arduino/
4. start wraping the resistor around the (+) leed.
5. when done solder and snip off the end of the LED that is after the solder.
Image Notes
1. LAYER(--)
2. COLOMN (+)
3. LED
4. 100 ohm resistor
5. connections to arduino pins (+)
6. conections to arduino (--)
http://www.instructables.com/id/The-4x4x4-LED-cube-Arduino/
http://www.instructables.com/id/The-4x4x4-LED-cube-Arduino/
Image Notes
1. resistor rining from the (+) on the LED to the (+) colom
2. (+) colom runing to the arduino
3. the (--) layer conected to the (--) of the LED
Step 5: PROGRAM
Good job on making it too this step now all you need to do is upload this code and you are done.
http://www.instructables.com/id/The-4x4x4-LED-cube-Arduino/
Image Notes
1. All finished YAY took me about 4 days 2-5 hours a day to finish and program.
File Downloads
LED_cube_4x4x4.zip (2 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'LED_cube_4x4x4.zip']
Step 6: ADD on
so to program the cube all you need to do is change the
B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, 80,
code
each B1111 corresponds to a line of LEDs in your cube 0 being off and 1 being on. The last number is the time it will display that part in milliseconds.
Related Instructables
4x4x4 LED cube Led Cube 4x4x4 LED Cube 4x4x4 Make a 24X6
by Electronics (video) by bajgik by chr LED matrix by
Man LED Cube and How to build an Syst3mX
Arduino Lib by 8x8x8 LED cube
gzip and control it
with an Arduino
by R-
http://www.instructables.com/id/The-4x4x4-LED-cube-Arduino/
Comments
50 comments Add Comment view all 51 comments
2) its a website i found on google also i just generaly use 100 ohm even when the calculator says 73 or somthin just to be safe.
http://www.engplanet.com/content/resistorinfo.html
3) if i put resistors on the ground pins then the led wont light up because of the double resistance (2 x 100 ohm)
/**
* Displays the anode column with the given number value; [0, 24].
*/
void displayNum(int num){
//constrain the argument to be between 0 and 24 inclusive.
num = constrain(num, 0, 24);
/*
* AND: selects the bit, the bit at weight will be 1 if the pin is to be high
* >>: shifts the selected bit to the end of the word, making the value a 0 or 1
* first result is lsb
* digitalWrite: write the approptiate result (HIGH or LOW)
* to the appropriate decoder pin
*/
for(int weight=1, pin=0; pin < DECODER_BITS; weight*=2, pin++)
digitalWrite(decoderPins[pin] ,(num & weight) >> pin);
http://www.instructables.com/id/The-4x4x4-LED-cube-Arduino/
//delay, this is the absoloute minimum time the light will be displayed.
//ensures adequate delay for decoders as well.
delayMicroseconds(MICRO);
}
thanks
Mike
The i/o pins are very universal in use i begin to love my arduino more and more every day!!
Mike
http://www.instructables.com/id/The-4x4x4-LED-cube-Arduino/
mackjr says: Dec 31, 2010. 9:29 AM REPLY
matrix specifically identity matrix like 1 0 0
010
001
-then if you need to, bend the legs that are stiking up so that they easely
connect to the next leyer
-(ths way you do layer 1-2 then 1,2-3 then 1,2,3-4 4 being top)
good luck
I've built a few led cubes, and want to share some insights and design considerations.
1) There should be no need to have a resistor for each LED. If you use multiplexing, and it is working correctly, no more than one LED per column will be on
at any given time.
Create an buffer array of 4x4 bytes. (that way X and Y is the byte, and Z is the bits within the byte. It will save you 48 bytes of ram)
Set up a timer that runs every 10 milliseconds or something, and set up an interrupt routine that is called on every timer reset.
http://www.instructables.com/id/The-4x4x4-LED-cube-Arduino/
Every time the interrupt routine is called, it turns all layers off, loads the next layer from the buffer array onto the IO pins, and turns the next layer on. Rinse
and repeat.
The cube now draws the buffer contents onto the LED cube in the background, and your main() loop can be preserved for code that generates animations.
I haven't tried using timers or interrupts on an Arduino before, but it shouldn't be very different from using them on a plain AVR.
You will also free up a lot of programming space by not having to store the patterns in program memory. I have ledcubes that run several minutes of
animations on a 16KB avr.
You can also populate the cube buffer array via the serial line and control it from a computer.
http://www.instructables.com/id/LED-Cube-4x4x4/
-chr
thanks for the advise next I want to do a 8x8x8 and then 16x16x16 untill I can get to 64x64x64 :)
Thanks in advance.
If you're asking how many stars yours has, its 4.33 out of 5.
PS: its spelled diffused, not defused, sorry if this came across as negative
http://www.instructables.com/id/The-4x4x4-LED-cube-Arduino/
herpelcano says: Sep 9, 2010. 11:25 PM REPLY
Since only one layer is on at a time you could have saved yourself a lot of trouble by only putting your resistors on the wires leading to the sixteen columns.
http://www.instructables.com/id/The-4x4x4-LED-cube-Arduino/