Step 4: Connecting the Cube to Arduino

The cube is connected as follows:

column # 1    2    3   4   5 6 7 8 9 10 11 12 13 14 15 16   L1 L2 L3 L4
Pin#          13 12 11 10 9 8 7 6 5 4   3    2    1    0  14 15  16 17 18 19

Pictures explain better than words.....

Hey Tyler, Can you help me out? I built the cube and tried to run the codeyou have for it, butI keep getting these errors&lt;&gt; How do I fix this? I cannot waitto see it run. Have lots of ideas for patterns, but need the code to work.<br><br>LED_1cube_4x4x4_Show_2:15: error: 'prog_uchar' does not name a type<br><br>LED_1cube_4x4x4_Show_2:447: error: 'PatternTable' was not declared in this scope<br><br>'prog_uchar' does not name a type
<p>Hey Tyler, Can you help me out? I built the cube and tried to run the codeyou have for it, butI keep getting these errors&lt;&gt; How do I fix this? I cannot waitto see it run. Have lots of ideas for patterns, but need the code to work.</p><p>LED_1cube_4x4x4_Show_2:15: error: 'prog_uchar' does not name a type</p><p>LED_1cube_4x4x4_Show_2.ino: In function 'void loop()':</p><p>LED_1cube_4x4x4_Show_2:447: error: 'PatternTable' was not declared in this scope</p><p>'prog_uchar' does not name a type</p><p>Thanks a million!</p>
<p>in line10 put<br>&quot;char PROGMEM const PatternTable[] = {&quot; instead of &quot;prog_uchar PROGMEM PatternTable[] = {&quot;</p>
<p>Im not sure if its my wiring, but one side of the cube is not lighting up. Any suggestions on what to do?</p>
<p>hello my bucket arm led but have problems with most programming makes Arduino Uno R3 but I only own Arduino Leonardo bale I'm starting in this algujin can help</p>
<p>Ungrounded/Not activated layers in an LED cube light dimly</p><p>I built a prototype of a 4x4x4 LED cube circuit on a breadboard before committing it to a protoboard following the anode column/cathode layer approach with a set of current limiting resistors between the columns and an arduino controller and close the plane circuits with a set of 4 transistors in the software with an intent to only have a single plane on at a time. Many folks have built these. This is most closely modelled after <a href="https://www.instructables.com/id/LED-Cube-4x4x4/" rel="nofollow">this</a> project and <a href="https://www.instructables.com/id/4x4x4-LED-Cube-Arduino/?ALLSTEPS" rel="nofollow">this</a> one. As I&rsquo;ve been testing my cube, I found that the fewer the leds that I have lit, the more pronounced an unpleasant effect is where other leds in an activated column (but unactivated plane) light dimly. I&rsquo;m really unsure why these leds would light up. The effect seems more pronounced with fewer leds being lit at a single time and totally disappears when all 16 leds in a plane are lit. Surprisingly, if I remove all grounding that closes a circuit, the activated column still lights with a diffuse lighting across the leds in the column. I&rsquo;ve <a href="https://www.youtube.com/watch?v=8O-Z7RAQRX8" rel="nofollow">linked</a> a video that shows the effect in the hopes that someone can help me understand what&rsquo;s wrong. The circuit is basically <a href="https://www.flickr.com/photos/knaka/4072693764" rel="nofollow">this</a> minus the shift registers.</p>
<p>Hello, I'm not really understand about transistors. Where and whom to solder ?</p><p>p.s. may be write stxp201261@gmail.com</p>
Hi, I build the cube according to your design. Only thing i did different is that i used a Darlington transitor array uln2803A instead of the transistors you use. <br>When i run the testprograms all leds induvidually light up. But when I run the full show when one led should be lit up, the whole column lights up. <br> <br>Help please
<p>Hi, long time ago. But I have the same problem. Do you know something new?</p>
<p>Here is the fix. It worked for me, to switch some HIGH to LOW and LOW to HIGH</p>
I don't really know how transistor arrays work. But if the whole columns are lighting up then that means your opening up all four grounds (layers)
<p>Hi guys, i have already finished my led Cube.</p><p>I have tested the LEDs, I can fully control the entire LED cube by using basic commands.</p><p>Now I used the multiplexing code, that is downloadable here. </p><p>One thing is weird. I use the line</p><p>B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,</p><p>to let light up one led at the bottom left.</p><p>But the whole column lights up.</p><p>I thought, that it have something to do, with the transistors and the multiplexing functionality. I have now connected all layers with the collector, the grounds go to the emitter and the base is connectet to the arduino.</p><p>Can you tell me why the behavior is like that?</p><p>Sorry for not perfect english.</p>
<p>hey,can i light all of the LEDs at once without damaging my Arduino??</p>
Yes, because of multiplexing, in theory only one light is on at time.
<p>How big is the perfboard?</p>
<p>Also is Craft Wire just solder? or is it different?</p>
<p>The schematics is easy. Even hand drawing. I use E-plan 8 its nicer.</p><p>But jtmanders. You say you can do this using the standard Arduino. But its not true. The standard has only 14 I/O and thats including the Analog I/O. To do this project you need at least a Arduino mega. Like you use in the example.</p><p>Did make the project, it works great. I only make the mistake to use 2 kinds of LED Bleu light. The one low power of 1.4 V and the high power of 2.7V. I did notice it when i started the project for the first time. I let it run a test program to lit up every tier. Then i saw some lit good and some lit pretty dark. </p><p>Now i understand why there was use 2K ohm R insted of 20K Ohm</p><p>A lesson for people who want to do this project to. When you use the LED look for the low power use.</p><p>E.G. I try to build a 6 X 6 LED Cube. See if it work to.</p>
<p>The Arduino Uno has 14 Digital I/O Pins and 6 Analog Input Pins that can be used as Digital Output. If I'm not mistaken that is 20, the exact number you need. Its right on the Specifications. Check it out yourself.</p><p>Thanks</p><p><a href="http://arduino.cc/en/Main/arduinoBoardUno" rel="nofollow">http://arduino.cc/en/Main/arduinoBoardUno</a></p>
<p>Your are right my mistake. I did read the technical specs and it says 14 i/o with 6 Analog i/o. I translated that as 14 including the 6 analog. But it is what you say and that means that you are right to make it with the Arduino Uno.</p><p>That make it a nice project and the result is very pleasing.</p>
<p>i want know how to sketch a schematic</p><p>plz upload a schematic or send me</p>
Hello, <br> <br>This looks awesome! I see the potential of 3-D signs, clocks, and the list of possibilities is endless! <br> <br>If one makes an 8 x 8 x 8 matrix, would multiple Arduinos need to be cascaded? <br> <br>Thanks, <br> <br>Gamma <br>
It would be a lot simpler to just use multiplex circuits to get the needed amount of I/O ports. Go look up chrs instructable.
would you need different resistors if you have to use some analog pins?
I don't believe so...since you are using them as digital pins
Thank you very much <br>My son and I rode this hub and was very good.
FYI my son built the cube and the LEDs lit very dimly. I checked the voltages and determined there was a 2.4V drop across the LEDs and a 2.4V drop across the switching transistors, so there was almost no voltage across the 220ohm resistors == very little current driving the LEDs. The transistors weren't getting enough base current to switch fully. I swapped out the 22kohm resistors on the transistors for 2200ohm and then the LEDs lit up nicely. Not sure why you didn't encounter this -- maybe different transistor characteristics. We used 2N4401. <br> <br>Also, be aware that just soldering the LED leads to the LEDs below them makes for very fragile joints. We keep having connections break. You should really make a mechanical connection (e.g. twist the wires together) and then just use the solder for an electrical connection.
hello,Each layer independent of the line?(l1,l2,l3,l4?)
I don't really understand the question... If you mean each layer has it's own pin, then yes
Nice cube and a good instructable! <br>I'm wondering, if i build an 8x8x8 led cube.. do i have to reprogram the whole thing or can i use your program with a few modifications? <br> <br>greetz mark :)
Thanks! <br>I'm not really sure to be honest, but just tinker with it and see if you can get it to work. The first two codes (Cube sequence 1 and 2) are just for 4x4x4 i know because i wrote them. But the other ones can probably be edited up. like the 3x3x3 code i included i have been trying for a while to get to 4x4x4 and it somewhat works, with the exception of a few animations. if nothing else search around the internet there's countless codes out there to play with. I know chr (see link) has a really cool code on his instructable. however i don't know if it would work with my setup or not. <br>If you figure anything out please share it with me. <br>Good luck, <br>https://www.instructables.com/id/Led-Cube-8x8x8/
Thanks for your help! and i will let you know if it works for me :)
Hi, don't think I worded my question right, I use the analog pins for # 14-19 ,my question is ,due have to program the analog pins to output as digital.. ?or can I load your libary in without programing the Analog pins ? Thanks for your time..
Ok, as long as you specify in the code which pin is which layer/column then it should work. its all according to which code you try to put on there. <br> <br>When you download the code from here there are Five different one there. The first two (_4x4_LED_Cube_Sequence_1 and _4x4_LED_Cube_Sequence_2) i wrote myself and use basic commands to make it run. The part that needs to be changed according to how you set up your cube is the first things on top. <br>The C stands for column and L for layer. Refer to step 4 for column and layer numbers. This is what it looks like when you first open it. <br>int C1 = 13; <br>int C2 = 12; <br>int C3 = 11; <br>int C4 = 10; <br>int C5 = 9; <br>int C6 = 8; <br>int C7 = 7; <br>int C8 = 6; <br>int C9 = 5; <br>int C10 = 4; <br>int C11 = 3; <br>int C12 = 2; <br>int C13 = 1; <br>int C14 = 0; <br>int C15 = 14; <br>int C16 = 15; <br>int L1 = 16; <br>int L2 = 17; <br>int L3 = 18; <br>int L4 = 19; <br> <br>so all you must do is change these. For example, change C15 to A0 rather than 14. as far as what part of the cube to put on the analog pins it does not really matter. For simplicity, i would just put C15 = A0, C16= A1, L1= A2, L2= A3, L3= A4, L4= A5. <br> <br>In the other three codes just look for where the code specifies rows and layers and change them. Not all of them are in the same place or format. All are located before the Void setup. <br> <br>Hope this helps. If you have anymore questions feel free to ask. <br>Good Luck!
Great instr ,have it almost finished ,great directions.Using an Uno &amp; have just enough pins with the analog .Digital from 1 - 13 then have to use analog ,AO-A5 my question is which of the cube would you use the analog . Thanks very much for sharing your project..
Awesome ible man!! One of my first arduino projects was a 3x3x3 led cube. Led cubes have amazed me so often and in so many different ways. I had to unsolder my led cube after it barely survived two trips via public transport to the local museum for a tinkering festival. I was asked to place it at the Arduino section and it got more attention than the talking head and the roving robot made from an rc toy. <br>Again, I love your amazing instructable!!

About This Instructable




Bio: “To invent, you need a good imagination and a pile of junk.” ― Thomas A. Edison
More by jtmanders:LEGO Desktop Power Supply How To Write Your Own 4x4x4 LED Cube Show For Arduino 4x4x4 LED Cube Arduino 
Add instructable to: