Introduction: Led Cube 5x5x5 (Arduino Project)
In this project I will show you how to build a simpler version of a 5x5x5 LED Cube.
I’m providing a full step-by-step guidance to show you how to make your own LED Cube, and I explaining in details both hardware and software parts in order to turn this guidance the simplest way that leads you to try your own skills in electronic making.
This project is so handy to make specially after getting the customized PCB that we’ve ordered from EasyEDA to improve the appearance of our Cube and also there is enough documents and codes in this guide to allow you create customized animations and some bounce display movements.
If you dislike to read so much! You can watch this video for more clear guidance.
We made this project in just 5 days only, just three days to finish the hardware making and the assemble, then two days to prepare the code.
Step 1: What Is LED Cube!
First of all what’s a LED or Light-Emitting Diode. It’s a type of diode that emits light when it has a current flowing through itself. It is commonly used for showing a state of the electronics
A Light emitting diode (LED) is essentially a p-n junction diode. When carriers are injected across a forward-biased junction, it emits incoherent light. Most of the commercial LEDs are realized using a highly doped n and a p Junction.
LED Cube in general
LED cubes rely on an optical phenomenon called persistence of vision or POV. If you flash an LED really fast, the image stays on your retina for a little while after the LED turns off. By flashing each layer of the cube one after another really fast, it gives the illusion of a 3D image, this is also called multiplexing.
Moving back to our Cube
The LED matrix we decided to use is a 5 x 5 x 5 monochromatic LED Matrix. This is a total of 125 LEDs. The reason we chose this size, is that it provides the best of overall cube size, construction time & easier programming.
So the question is how to control all these LEDs when we don’t have enough digital pins in our Arduino because, well in Arduino Mega for example we have only 54 digital pins!!
Actually this is what we gonna see in the programming part because it will be a little bit deceptive there.
How it works
Step 2: How It Works!
The LED cube is made up from 125 LEDs arranged into 5 layers of 25 LEDs each. The display itself is multiplexed so instead of requiring 125 connections it requires one to each of the five layers and 25 to each LED in a layer making a total of 30. The cube is refreshed by a software interrupt routine with each layer active for 2ms, so the entire cube is refreshed every 10mS (100Hz). This results in a display with no visible flicker.
Each of the LED layers is arranged in a 5 x 5 matrix and controlled by a transistor in an emitter follower configuration connected to the LED anodes. When the respective layer control output from the PIC goes high the base of the transistor is held at +5V and the emitter sits approximately 0.7 volts below this.
It will not be that much complicated because we provided the source code of this project so you can download it and modify it to suite your needs, also an Arduino library is available to make things easier for you.
Step 3: The PCB Design Using EasyEDA Platform
EasyEDA is a free online Electronic design automation community that allows the creation, testing and editing of schematics and PCBs. Find the link to the easyEDA platform here.
This online program is supported in all platforms even android, with easyEDA you can make a Schematic Capture for your documents, Circuit Simulation, Online PCB Designing with the ability of importing PCB and Schematic files, so from this point we can understand that we can create the PCB in this online designer or just make it with another software and upload a gerber file to easyEDA to place an order.
How to design the PCB and order it!
As usual we need to run the easyEDA platform from here, then start a new project and import the necessary components like Arduino Mega2560, 2N2222 NPN transistors the LEDs etc.. and connect them together to make the circuit showed in the picture, Also this platform allows you to transform your schematic into PCB and this is exactly what we need just click on convert project to PCB then you will get your PCB design area. I advise you to click directly the following link the PCB automatically: Direct link for LED Cube 5x5x5 project
You can also check the PCB before ordering it using the PCB viewer, and I provided a picture that shows the PCB that we designed. After finishing the design, go to fabrication output and set some parameters, for me I prefer the black color for my PCB. Do the payment and wait for the delivery. Just 5 days only to receive the packet and it was an amazing service, the PCBs are very well manufactured as usual and all the labels are there with the description etc, so the making of this project will be so handy now.
Step 4: Ingredients
In order to make this project you will need the following components:
Step 5: Preparing the Cube Shape
Before starting the soldering of our components we need to prepare the CUBE shape first, and to do this I advise you to follow this technique!
Take a peace of Polystyrene and draw a five fives matrix then drill a small hole in each lines intersection now take 25 LEDs and bend all them Cathodes and put one LED in each hole to solder all the Cathodes together in order to make one layer, then repeat the same thing to make 5 layers and solder them together to create this CUBE shape where you have all the Anodes of the same line connected together.
Don't forget that we are making 5 lavels so we should have 5 pins (for cathodes) in the whole cube
Step 6: The Assemble (Soldering the Components)
We are ready now so let’s start soldering the components and don’t forget to follow the labels to avoid soldering mistakes. And about the CUBE, we will solder only the Anodes that we have in the lowest layer and we will use five jumper wires to connect the Cathodes of each layer to the appropriate placement in the PCB.
Note: You need to keep your soldering iron nice and clean. That means wiping it on the sponge every time you use it. The tip of your soldering iron should be clean and shiny. Whenever the you see the tip becoming dirty with flux or oxidizing, that means loosing it's shinyness, you should clean it. Even if you are in the middle of soldering. Having a clean soldering tip makes it A LOT easier to transfer heat to the soldering target.
The PCB that we ordered from EasyEDA will guide you keep everything in the right placement so do not hesitate to visit this link if you want to view the PCB that we've made and make an online ordering.
Step 7: The Code and Validation Test
After assembling the robot, the last part is the source code to control the whole Cube shape, and don't forget that this kind of project depends on how creative you are, so try to think about more creative forms and animations to display and this is the best way to make the impress.
I used an Arduino Library that you can download from the following link:
Arduino library download link: LED Cube library
This libarary allows us to indicate the pins connected to each column and row, then make a sequence of bytes to tell our Arduino the LEDs that we want to turn ON by providing the layer number and the LED number, after that we transfer the sequence through the desired port.
I prepared an animation code that you can download it from this link to verify our project and the results were very amazing as you see in the pictures so do not hesitate to watch this video if you want to see the resultats in dynamic version.
Thank you :)
I believe this Instructable is the most comprehensive step-by-step guide to build an 8x8x8 LED Cube ever published.
That is it for this instructable, feel free to thumb it and to ask us anything you want to know about this project through a comment.