LED Cube multiplexing = low brightness ?

hi,
I recently built a 6x6x6 LED cube. I used,

74HC595 - 8 (for 36 LEDs);
TIP122 - 6 (for controlling layers)
Power suppl - 5v-3.8A bought from ebay

I can turn on all 6 layers and light them at once with full brightness.

used shiftOutX library. attached it

ofc I also have 220 Ohm resistors for each led. 36 in total

everything works so far, but when I do multiplexing leds brightness decreased by a considerable amount. which makes the cube less brightness. Is there anyway to fix this? using some capacitors?
I used the delayMicroseconds(4000), which is less flicker also less brightness.

I attached my code file.
method is up();

shiftOutX_4_reg1------mu.ino (22.9 KB)

ShiftOutX_10.zip (14.9 KB)

I suggest you create the simplest sketch to light all the leds so you see what brightness you can expect.

I don't believe this sample construct is correct:

          if(i == 5){
          digitalWrite(2, HIGH);//row1
      digitalWrite(3, HIGH);//row2
      digitalWrite(4, HIGH);//row3
      digitalWrite(5, HIGH);//row4
          regOne.allOn();
          delayMicroseconds(4000);
          regOne.allOff();
          }

because you are have multiple layers active simultaneously which your 595s and possibly power supply may have difficulties with. I'm guessing that the layer transistors are connected to pins 2 to 7 and a HIGH switches the layer on.

You should probably do something like this:

if(i == 5){
    digitalWrite(2, LOW); //row1 - ensure it is off
    digitalWrite(3, LOW); //row2  - ensure it is off
    digitalWrite(4, LOW); //row3  - ensure it is off
    digitalWrite(5, LOW); //row4  - ensure it is off
    digitalWrite(6, HIGH);//row5 - Switch on
    digitalWrite(7, LOW); //row6  - ensure it is off
    regOne.allOn();
    delayMicroseconds(4000);
    regOne.allOff();
}

You can refer to the layers much more elegantly if you define the pins in an array:

byte layerPin[6] = {2,3,4,5,6,7} ; 
. . . 
. . .
for( byte i = 0; i < 6 ; i++ ) {
   digitalWrite( layerPin[ i ], LOW); 
   . . .
}

6v6gt:
I suggest you create the simplest sketch to light all the leds so you see what brightness you can expect.

I don't believe this sample construct is correct:

          if(i == 5){

digitalWrite(2, HIGH);//row1
      digitalWrite(3, HIGH);//row2
      digitalWrite(4, HIGH);//row3
      digitalWrite(5, HIGH);//row4
          regOne.allOn();
          delayMicroseconds(4000);
          regOne.allOff();
          }





because you are have multiple layers active simultaneously which your 595s and possibly power supply may have difficulties with. I'm guessing that the layer transistors are connected to pins 2 to 7 and a HIGH switches the layer on.


You should probably do something like this:



if(i == 5){
    digitalWrite(2, LOW); //row1 - ensure it is off
    digitalWrite(3, LOW); //row2  - ensure it is off
    digitalWrite(4, LOW); //row3  - ensure it is off
    digitalWrite(5, LOW); //row4  - ensure it is off
    digitalWrite(6, HIGH);//row5 - Switch on
    digitalWrite(7, LOW); //row6  - ensure it is off
    regOne.allOn();
    delayMicroseconds(4000);
    regOne.allOff();
}





You can refer to the layers much more elegantly if you define the pins in an array:



byte layerPin[6] = {2,3,4,5,6,7} ;
. . .
. . .
for( byte i = 0; i < 6 ; i++ ) {
  digitalWrite( layerPin[ i ], LOW);
  . . .
}

Well I did try this,

digitalWrite(2, HIGH); //row1 -
    digitalWrite(3, HIGH); //row2  - 
    digitalWrite(4, HIGH); //row3  - 
    digitalWrite(5, HIGH); //row4  - 
    digitalWrite(6, HIGH);//row5 - 
    digitalWrite(7, HIGH); //row6
 
regOne.allOn();

it does give me the highest brightness it can.
I already tried it. see lel()
in that code, 32leds are on except the four leds in the center. but the brightness is low

Please post your code inside your post, not as an attachment. Give a link to the download page of the library. Read the forum rules to find out how to post code and links properly. Also post a schematic. Hand drawn is OK. You don't need to show all 8 shift registers just a couple to show how you wired them.

From the tiny clues you have given so far, it could be your choice of components that is the problem. 74hc595 is not a great choice for lighting leds, especially when multiplexing, because of is current limits. Tip122 is also a poor choice because of its high voltage drop.

Basically you multiplex and the display dims. You can compensate a bit by increasing the current, but if your multiplexing stalls your LEDs go up in smoke.

PaulRB:
Please post your code inside your post, not as an attachment.

22kB code can not be posted inside a post :wink:

sterretje:
22kB code can not be posted inside a post :wink:

Oh, I thought that was a library, not the OP's sketch...

Hi everyone

Just an idea. Maybe your multiplexing is to slow.

You can try to increse the speed by one of this methode.

Julian Investigates: How Slow is Arduino?

Arduino Basics 103: Library, Port Manipulation, Bit Math, Faster PWM/ADC

Sorry that I just posted youtube links but my english is to bad to explane this myself in detail here.

Bye and good luck