Interactive Color-wheel RGB Cube 8x8x8
Intro: Interactive Color-wheel RGB Cube 8x8x8
This is special version of RGB Led Cube 8x8x8, so called "Interactive Color-wheel RGB Cube 8x8x8". Let's see all attached videos to know how it works.
- Interactive effect: whenever you move led cube in any axis, cube's color will be changed according to color-wheel rule. See DEMO version below.
- Color-wheel effect: It looks more amazing if we do effects with color-wheel function. For my project, you can see on videos, there are a lot of effects that were collected from many sources, some of them were done by myself.
- VU meter effect: Read music signal by MSGEQ7 through 3.5mm audio jack.
On the forum, I saw a lot of posts talking about led cube so I just briefly discussed how to do a RGB led cube in the simplest way.
STEP 1: Bill of Material
With RGB CUBE 8x8x8, we have 512 LED RED, 512 LED GREEN and 512 LED BLUE, so totally we have to control: 512x3 = 1,536 LEDs.
By 4-bit BAM method, we can create 4,096 separated colors (16 ^ 3) for each RGB LED.
For this project, we'll do a lot of soldering works. Let prepare masks, gloves and exhaust fan for health protection.
STEP 2: Cube Template & Led Tester
Print this template drawing out paper, stick by glue to wood, and then drill with diameter 5mm (if using 5mm RGB LED) at the center of each circle. We will have a led cube wood template with 64 holes.
Note: The holes spacing of wood template and LED spacing of cube base printed circuit board is the same. Thus, we can put 3 pins of led into cube base PCB easily.
Make a Led tester with 9V battery, take note that resistor R470 ohm are connected in series between battery and Led.
STEP 3: Cube Base PCB
Distance between 2 LEDs in PCB is 20mm, same as wood template holes spacing.
With this distance, I didn't use any cooper wires or extra zinc wires to connect LED together. I just bend the Led pins and then soldered them easily.
STEP 4: Shift Register Board
- Schematic:
Schematic above is only for one color so we will have totally 3 sets of shift register board like that.
- PCB:
As shown on shift register board PCBs, we have 3 blocks, each controlling 64 LEDs (R, G, B) -> 8 x 74HC595. These blocks are connected in series so that each time 24 bytes data is shifted out in the following order: BLUE --> GREEN --> RED.
STEP 5: Layer Board
This layer circuit can be used in two options:
- Select layers through 74HC595.
- Select layers directly from 8 pins of Arduino Mega 2560.
I used the second option for faster response.
STEP 6: Overall Schematic
RGB Led is common anode type, connected in series R100 for every single R, G, B led. Resistor R100 are included on shift register board PCB, located after ULN2803.
Arduino Mega 2560 control 24 x 74HC595 through SPI interface. And cube layer is collected directly from pin 26 ~ 33 of Arduino.
STEP 7: Cube Box
I made a box containing 5V power supply, PCB boards, Arduino Mega 2560. Some switches, push buttons, jack 3.5mm, fan ... were mounted at cube's backside. You can refer to the internet how to make an beautiful acrylic cube.
In my design, I added one small fan & audio jack 3.5mm on the back of box to ventilate power PCB board and make it become VU meter as optional.
For VU meter, we can use MSGEQ7 with PCB design as picture, or, we can use FFT transformation to read audio analog data from 3.5mm jack.
STEP 8: Main Program
STEP 9: Bit Angle Modulation
About B.A.M, you can check my topic: https://www.instructables.com/id/BI-COLORS-MATRIX-...
Or refer to two amazing websites:
http://www.kevindarrah.com/?cat=99.
http://www.batsocks.co.uk/readme/art_bcm_3.htm.
Example with command LED(4, 5, 6, 3, 6, 13), we can see conversion from actual 3D dimension to program coordinates "Byte" & "Bit ", as well as, the mix colors on pictures.
STEP 10: Color-wheel and Interactive Program
Refer from Nick Schulze: http://www.hownottoengineer.com/projects/rgb-led-c..., I did some modifications on his color-wheel program to match with my color template as follows:
- From:
array[phase] = {red, green, blue};
- To:
RED[phase] = red; GREEN[phase] = green; BLUE[phase] = blue;
- Get color from color-wheel function
void get_colour(int16_t p, uint8_t *R_colorwheel, uint8_t *G_colorwheel, uint8_t *B_colorwheel){ if (p >= COLOUR_WHEEL_LENGTH) p -= COLOUR_WHEEL_LENGTH; *R_colorwheel = RED[p]; *G_colorwheel = GREEN[p]; *B_colorwheel = BLUE[p]; }
For MPU-6050, you can refer to my previous project: https://www.instructables.com/id/2-Wheel-Self-Bala...
In my demo video, I took three values yaw, pitch, roll from MPU-6050 and input them to color-wheel function to get red, green & blue color for Led. K1, K2, K3 is converted coefficients from yaw, pitch, roll to color-wheel position. Parameter "COLOUR_WHEEL_LENGTH", in my case, is 256.
get_colour(K1*pitch + K2*roll + K3*yaw, &RED, &GREEN, &BLUE); fillCube(RED, GREEN, BLUE);
void fillCube(byte R, byte G, byte B){ for (byte z=0; z<8; z++){ for (byte x=0; x<8; x++){ for (byte y=0; y<8; y++){ LED(z, y, x, R, G, B);}}}}
STEP 11: RGB Led Cube Pictures
Some pictures for my cube project.
STEP 12: More RGB Led Cube Videos
More videos for my led cube project:
Finally, I would like to say a big thanks to Kevin Darrah, Nick Schulze, SuperTech-IT with the best references about RGB led cube.
22 Comments
Is69 4 years ago
I want to repeat your 3d cube.
If you can send the effect sources.
Ravenrwe 5 years ago
Ravenrwe 5 years ago
tuenhidiy 5 years ago
Hope this helps.
Ravenrwe 5 years ago
Morene338 6 years ago
How do i convert this pcb templates to a printable version for transperencys so i can use them on fotocovert copper boards.
lakshan86 7 years ago
Hi Tuenhidiy, First of all, Great work. Nicely Done. Im also interested in RGB cubes and im half way with my project. What really got me interested in your project is you used ULN2803 IC for this witch makes this very easy. Since i only completed the LED cube part, i can use this to mine also. I have one problem from the beginning since i started this project and that is , in the RGB led all the 3 colors uses different voltages to fully illuminated. Green is much brighter than other two.can you tell me how did you balance that ?? i was struggling with this for a while. im afraid once i finish the cube i would't be able to get the colors i want because of this issue. hope you can help me with this..
tuenhidiy 7 years ago
Due to my oversea trip, I can't reply you soon. I'm so sorry for that. When I built my first cube, I also scared like you. In my case, I used R100 (100 ohm) for Red, Green, Blue Led.
nhutnhutnhut 7 years ago
Nice!
JuddW1 7 years ago
tuenhidiy 7 years ago
I don't have time to do it right now. Whenever possible, I will contact you. Thanks for being interested in my project.
NielsR2 7 years ago
Happy that you got Kevin Darrah with in your THANKS
tuenhidiy 7 years ago
I just did what I had to :-)
4DIYers 7 years ago
That is really cool!
tuenhidiy 7 years ago
I’m glad you liked it!
AZBDaniel365 7 years ago
Do you have any more Details on how you etch the PCB board design?
tuenhidiy 7 years ago
During etching these PCBs, I didn't take any photos. Generally, I used Toner Transfer Method with clothes iron & Ferrous Chloride. It is more difficult when we etch double sided - cooper clad boards. So after ironing one side of double-sided copper board (TOP), I drilled some holes then put some pins, like led pins or small wires... through PCB, to get the alignment of opposite side (BOTTOM).
inconceivable1 7 years ago
man led cubs are cool!
tuenhidiy 7 years ago
Thanks. Your projects are also awesome, too!
inconceivable1 7 years ago
Not as cool as yours!