On Instructables, there is so much to learn also a great platform for people like us to publish their work. This Instructable is all about how you can make your own 3 dimensional 5x5x5 LED Cube easily.
This following Instructable will cover all the fundamental things need you to know along with theory and is in step-wise procedure in detail which will make you understand every thing from how to arrange LED's in proper order, how to connect all LED's together, how to create awesome animations using Arduino Mega 2560, also how to code in short so that you can create your own animations.
Many images are also uploaded, few with some edit as to understand the 3 dimensional structure of cube properly.
Follow this steps and your own LED Cube will slowly start existing.
The purpose and efforts behind these project was educational, to represent 3 dimensional crystal structure and understanding them will become a lot easier by looking at some almost similar model. It helps to understand other by these LED cube than by reading theory and just telling them to imagine 3D and feeding them 2D.
There are many things you will be requiring.
List is as follows :-
LED
A light-emitting diode (LED) is a two-lead semiconductor light source. It is a p–n junction diode that emits light when activated. Diodes only allow current to flow in one direction, and they're always polarized. A diode has two terminals. The positive side is called the anode, and the negative one is called the cathode.
A LED emits light only when it is in forward bias i.e. anode connected to high and cathode to low.
HOW TO IDENTIFY LED TERMINALS - Terminal longer in length is anode and other terminals i.e. the shorter one is cathode
TESTING -
Using bread board we can test many LED's at one time only as to save time. Make sure every LED which will be required lately is working.
A]How to bend LED leads -
1) Hold LED in such a way that cathode is in your right and anode in left.
2) Bend cathode towards you and trim the lead a bit.
3) Bend anode in left ( see that anode and cathode are perpendicular to each other). Then bend the anode upwards.
REFER image.
B] Arrangement of LED's in a layer -
There will be 5 layers ( from top to bottom ) and each layer will be of 25 LED's of dimension 5 x 5 ; All LED's in one horizontal layer are connected via their cathode. And all five horizontal layers are connected via by connecting LED's aligned vertically. THIS PART WILL BE EXPLAINED IN BRIEF IN 'MAKING OF THE LED CUBE' STEP
Take a cardboard box or polystyrene sheet, draw a square of dimension 12 cm x 12 cm , and then draw 5 x 5 grid lines having spacing of 3 cm.
REFER IMAGE - As shown in image GREEN arrows indicates the direction of cathode and RED arrows indicates the direction anode. (refer image for better understanding)
Soldering of Horizontal layer :-
Before going to further steps, check all the grids whether all the LEDs are working properly or not, if there is any fault in any one of them; replace them with other LED after desoldering the faulty one. Mainly search for a short-circuit if any.
Now, take conducting rods enough strong to hold the whole structure neatly. Total 25 conducting rods will be require of length 16cm-18cm.
Take polystyrene sheet or cardboard box like that and draw 5x5 grid with all the corners and intersection. Place a grid such that the LEDs are facing downward and are fixed into the object sufficiently tight enough.
Hold a conducting rod at any corner LEDs and insert it in the object by 1-2 cm just for keeping the structure stable at first later it can be cutted out. Now, roll the anode lead of the corresponding lead around the conducting rod and solder it neatly.
Refer Image,
Like that, do it for all 25 LEDs. Once one grid is done with soldering vertical conducting rods. Take another second grid and hold it in same way the bottom/first grid is and insert it the vertical conducting rods.
Leaving 3 cm distance from first grid, hold the second grid and roll its anode leads around the conducting rods so that it remain in its place. Then it becomes easy to solder.
Its little bit hard to solder middle girds/layers but only first 2 or 3, later being used to its just 5-10 minutes work.
After soldering all the five grids of LEDs to vertical conducting rods, remove it carefully and place it on a insulating surface and LEDs facing up. Now again check all the LEDs with multimeter; connect common probe to horizontal layer and just touch the vertical conducting rods one by one, do it for all the grids.
Congrats, our LED 3 dimensional structure is READY!!! a little way to go.
From this step is all get easier and we are almost reaching to our final point.
Take a good card-board box or even a polystyrene sheets will work, and insert your LED cube in it as to get support and making it compact and portable.
Since every horizontal layer of the LED cube has common cathode so we take out cathode from every layer
Take solid core wire and solder it to bottom layer ( Layer no. 0). We can call it Common Cathode 0 i.e. CC0
Similarly, with other horizontal layers and thus we get CC1 , CC2 , CC3 , CC4
Wire length should be enough to reach to Arduino. Easy right!!
REFER image :-
After inserting the cube into the card board box or polystyrene sheet box, turn the whole cube by 180 degree.
Cut out 25 pieces of solid core wires of sufficient length
Solder the wire with every anode which common to all Vertical LEDs. Thus we have now total 25 Common Anode (CA_), i.e. CA0, CA1, CA2, CA3, CA4..............., CA25
REFER image :
OPTIONAL : You can labelled every wire by its numerical name so that there is no confusion.
Now we can test and prove that each combination of {CC0, CC1,........CC5} and {CA0, CA1, CA2, CA3, CA4..............., CA25} lights up one at a time i.e. EACH LED DIODE CAN BE CONTROLLED INDIVIDUALLY.
Now, since Common Anodes and Common Cathode are taken out of the LED Cube, only remaining steps are:
1) To connect CC0,...CC4 and CA0, ....CA24 to Arduino Mega 2560.
2) Coding the Arduino.
Remove the insulation of solid wires a little and insert them into Arduino pins as follows
REFER IMAGES for better, clear understanding.
NOTE - One can use Jumper wires Male Female or anything else which will work.
Also check the continuity of wires first. If wire is broken in between it will Create problems and importantly, analysing the problem and where it is or which wire is faulty is the MOST challenging and hectic part which one should totally try to avoid at first only.
Note :- Maximum I/O current for Arduino is about 45mA and for LED diode of 5mm 2V forward rated current is 20mA. Since these are maximum values, it's nothing much to worry about getting LEDs blowing up but for being on safer side resistor are used to limit current. Resistor are connected in series between Arduino and wire connections of LED cube to it.
Example :- CC0 -- resistor --- Arduino pin 53
byte colPins[COLS] = {22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46}; byte levelPins[SIZE] = {49,50,51,52,53};
What is Array- 'In computer science, array programming languages (also known as vector or multidimensional languages) generalize operations on scalars to apply transparently to vectors, matrices, and higher-dimensional arrays.'
In simple language, array is an arrangement of list (anything) in a particular way.
Here in code at first we have have declared arrays for Column Pins i.e. for Common Anode and for Level Pins for Common Cathode.
Example - colPins[0] = 22; colPins[1] = 23; colPins[24] = 46
PIN NUMBERS IN ARDUINO, YOU HAVE INSERTED COMMON ANODES; COPY PASTE THE PIN NUMBERS IN "colPins" array's block i.e. in between "{....}" maintaining the sequence.
SIMILARLY, with Common Cathodes.
int frame_nacl[] = {0,0, 0,2, 0,4, 0,10, 0,12, 0,14, 0,20, 0,22, 0,24, 2,0, 2,2, 2,4, 2,10, 2,12, 2,14, 2,20, 2,22, 2,24, 4,0, 4,2, 4,4, 4,10, 4,12, 4,14, 4,20, 4,22, 4,24};
Whichever LED you want to illuminate, that particular LED co-ordinates (defined by layer number and LED number) type it in the above block without brackets in sequential and particular way
Example:- for LED (0,6) , (2,19) and (4,24)
{0,6,2,19,4,24}
NOTE - Following code is for NaCl Crystal Lattice structure and Diamond Crystal Lattice Structure.
Further editing can be done for different designs or shapes or structure.