Introduction: 6x6x6 Arduino LED Cube
In this instructable I would like to show You, how my mini project was made.
I got a homework at the University where i learn, from Programming and Digital Technics to make a project with Arduino.
I choosed a 6x6x6 LED cube, controlled by Arduino UNO & shift registers.
Step 1: Material and Tools
- 256x 5 [mm] blue LED (optional);
- 6x 180 [Ω] resistor;
- 7x SN74HC595N shift register;
- 1x Arduino UNO;
- 1x potentiometer (optional);
- soldering wire and iron;
solderable perf- board;
male header connector (optional);
- a piece of wood;
- a drill machine;
Step 2: How It Works
This is a 6x6x6 LED cube, so it consists of 6 levels, 6 rows, every row has 6 columns.
In a level, all the cathodes are soldered with their neighbours, like a net.
In a column, all the anodes are soldered with the upper and lower neighbours. So if I switch VCC to a column, and GND to a level, the LED, witch is in the intersection of the level and the column will light.
The levels and every row are controlled by 1-1 shift register.
I use 7 shift registers, one for the levels to control its ground, and the other 6 for the rows, each one for one row.
A shift register controls a whole row, a shift register has 8 output port, but a row only has 6 column, so it is more than enough.
Step 3: Preparations
- I found a piece of wood at home and I drilled 36 holes in it. The diameter of the holes are 5 [mm], like the LED's diameter.
The distance between the center of 2 holes is 25[mm]. This stand is important for quality soldering, it makes it easier and more precise.
- Test all the LEDs with a simple circuit. All of them must be fit. I switched +5[V] to the LED's anode, and the GND to the LED's cathode through a 180 [Ω] resistor
- Then I curved the legs of the LEDs with a plier, bended the anodes to a right angle and placed them into the holes upside down, so the anodes are faced the outside part of the cube.
As shown in the picture, they are separated to 2 parts. The cathodes are bended like in the other picture with the arrows, but the direction is optional, this is just my opinion.
Step 4: Solder the Cube
It's time to start soldering.
I solderd the cathodes to each other and then i used some copper wire to connect the two sides and to make the structure stronger. If you are ready, carefully try to get out the level from the wood.
If you have all the 6 leves, then you have to solder the anodes of the second level to the anodes of the first level, and so on until you have all the levels soldered.
After this, solder the anodes of the first level to a solderable perf board.
To connect the levels to the resistors i used some copper wire.
Step 5: Solder the Circuit
As i mentioned, i used 7 shift registers, Arduino Uno, and a potentiometer to modify the delay time.
I soldered some male pins to the board for the Arduino, so I didn't have to use any jumper wire.
I attached a drawing of the circuit, i think it contains more information than a picture of it, it looks like a jungle.
Step 6: The Code
I made a program for it, in the code i left some comments to help understand it.
To control the shift registers you can use binary or hexadecimal numbers, i prefered the hexa one because it is shorter.
I created an array for the shift registers,
SR contorls the levels, and the others (SR[1-5]) control the rows.
For example SR = 0x7F that means only the first level gets gnd, the others don't
SR = 0xC0 means on the 5. row only the first 2 led will light on the 1. level.
We have a be nice policy.
Please be positive and constructive.
row 5 -> row 6 without overflow?