**Building a 4x4x4 RGB LED Cube: Part 2**
As we conclude part one of this project, it's time to build the electronic circuit and upload our first test code. By the end of this part, you will have the capability to construct your own functional 4x4x4 RGB LED cube.
My case is still missing a DC jack, so I utilized my Dremel with a cutting tool to create a square for my Jack. If you're familiar with some of my other videos, then you know I'm not particularly skilled in this category; therefore, I hope this makeshift solution will suffice. To secure it properly, I applied hot glue.
For the case, we only need a switch and jack – maybe I'll add more components later on. Now we require adding male header pins to the ribbon cables for future connection to the PCB. We need three 16-pin headers for the cathodes of all colors and one 4-pin header for the anode layers. Additionally, some shrinking tube is required.
To prepare the ribbon cable, I used a cutter to separate it into individual sections and stripped their insulation. Then, using solder, I tinned the tips and the male headers as well. Next, I cut my shrinking tube and slid them over the ribbon cables to isolate each other. Finally, I soldered the ribbon cables to the headers and utilized the shrinking tube for isolation.
Now it's time to build the main circuit. Let's review our parts first: a PCB with kopper dots, four P Channel MOS fets (because this time we cannot multiplex the rows of the cube like in my Multiplex video), wire for each anode layer, three tlz 5940, and other necessary components.
We need to connect the tlz 5940s, which can control 16 LEDs each. Since there are three different colors, we will require three of those four 1K resistors as pull-up resistors for the MOS fets, and three 2K resistors to set the constant current of the tlzs to 20 milliamps per LED.
For the operator's brain, an Arduino Nano is needed. Additionally, silver coopa wire, female header pins, and a 28-pin socket are necessary. I created a schematic for you guys to recreate the project; however, I didn't make a layout diagram for the PCB – but it shouldn't be too hard.
To build the socket for the Arduino, I used female headers. This allows me to easily replace the Arduino if needed. I also utilized these headers for the 16 outputs of each tlz 5940 and the drain of the P Channel MOS fet.
The rest of the wiring is explained in the schematic. Always double-check all your connections and use a Multimeter with its continuity function to check for shorts, especially if you're not familiar with this process (take a look at my multimeter video).
Now that our PCB is complete, we need to connect the male headers of the ribbon cables to the female headers on the PCB. I connected the upper layer to the m head with gate and then fitted the other three layers into their respective headers.
Remembering the wiring schematic from part one, I connected the ribbon cables for LED 1 to the output zero of each tlz. If you take a look at my code, you'll realize that LED 1 is labeled A, LED 2 is labeled B, and so on. Again, there's only one way for the headers to fit – the first tlz is for red LEDs, the second tlz is for green, and the third tlz is for blue.
Finally, we need power – I plugged in my 5V power supply, which can give me at least 2 amps. Using a multimeter, I verified that the middle pin of the switch is ground and the other pins are connected to the Arduino.
Now you should have downloaded the tlz 5940 library from the Arduino playground and modified it to reflect our setup – we need to change the value for used TLC's from 1 to three. This modification is crucial for the project's success.
With that done, download my code, upload it to your cube, and enjoy a simple animation of flashing colors. If everything works correctly, then you've completed this part of the project successfully!
In the next part, I'll dive into explaining the code and how to create your own animations. We will also optimize the cube and bring this whole project to an end.
If you liked this video, be sure to check out some of my other projects – don't forget to like, share, subscribe, and I'll see you in the next part!