New here - Planning a 5x5x5

There you go - fixing the code to leave the LEDs on as long as possible before turning off & turning the next one on.
Simple concept, yet many do not grasp the consequences or how to implement it.

Fixed that glitch now. It was to do with setting LOW to the previous row at the restart of the for-loop. I just made a new loop to clear them all each row-cycle immediately prior the update.

The pattern is working nicely on the 5x5 square. Now I'm thinking of connecting the IR 2D120X to adjust some parameters - just to learn how that works.

The eventual cube will be bright enough to see because presently the brightness is sufficient with PWM(50/255). Not 'bright' but plenty to see the pattern moving around.

Hi Forum,
Just an update ..

Got some thin MDF (wood) to mount the project. Got that all drilled ready to put the 25 leads through and have the controller and arduino on the back. I'll have little rubber feet to create some space under it. The controller-board and wiring and electronics will still visible when it is turned over. I got some ribbon cable and mini connector plugs.

I got a bread-board with holes and coppered rows on the back and made up a transistor controller-board grid. I had all the transistors soldered in with some resistors ready to connect up.

Then I realised I needed to break some of the copper rows to get the correct circuit.

So after doing about 100 perfect NASA-quality solders, I had to drill the copper - so I used my power drill as carefully as I could. But unfortunately, the components on the other side didn't think it was careful enough because several transistor-legs got a bit mangled.

Note to self: drill first, solder second.

Anyway, I got a new board and some more 2N2222A's and will have another go. But first I will plan the thing fully and get the board fully ready before soldering. I will be using ribbon cables and some mini-plugs to connect the cube because I will be making a better cube with bright blue LEDs later. My yellow-LED cube looks pretty cool all soldered up, ready for mounting... after realigning the LEDs a little.

I will need to connect 30 outputs from the controller-board to the 25 grid-points and the 5 planes on the LED-cube. Then connect the 15 outputs from the arduino to the controller board (5 planes, 5 x-points, 5 y-points). Hmm 45 connections.. this is going to be interesting.

I only had a little bit of time this weekend, apparently Mothers Day takes priority.

More later.

All building is done now.

I have made up a controller board to manage the multiplexing. The circuit is as per CrossRoad's design of 25 transistors with 5 more running the power to ground. This has connector-plugs to the LED cube and to the Arduino using ribbon cable.

But now I need help with addressing the output pins A1 to A5.

What I have so far: (Nothing lights up)

int xPin[] = {
  3,5,6,10,11  };

int zPin[] = {
  2,4,7,8,12  };   

int x;
int z;

void setup()
{
pinMode(A1, OUTPUT);
pinMode(A2, OUTPUT);
pinMode(A3, OUTPUT);
pinMode(A4, OUTPUT);
pinMode(A5, OUTPUT);
}

void loop()
{
  
digitalWrite(A1, HIGH);

analogWrite(xPin[1], 255);

digitalWrite(zPin[1], HIGH);  // Turn LED ON

delay(500);

digitalWrite(A1, LOW);

analogWrite(xPin[1], 0);

digitalWrite(zPin[1], LOW);  // Turn LED OFF

delay(500);

}

I have got some lights working now, but not as expected.

I'll go over the wiring with a multimeter tomorrow and do some troubleshooting.

But I'm still not sure if I'm addressing the A1 to A5 pin outputs correctly.

A0-A5 are digital pins D14 thru D19.
Use them that way, makes the coding easier.

Thanks, that D14-19 will help a lot.

Trouble is, with the code below, I get incomplete vertical planes of LEDs coming on sequentially instead of individual lights, and the last plane never lights up. In the first cycle, horisontal-plane 1 is OFF, in the next cycle horisontal-plane two is OFF etc. So I'm wondering if the code is wrong - or maybe I have a fundamental wiring error.

There are so many sources of error it's hard to figure. I'll have to look at my soldering for bridging. Also check the board drill holes for any errant residual copper. The solders appear to have good flow and minimal excess, but this is making me think I need better glasses. I had to mount the transistors on adjacent rails to fit it all on the ~30x34 hole board.

Also, the LED grid itself might have some bad solders.. there were some dry joints that failed while I was setting the LED framework into the support-base which I re-soldered, but there could even be some LED leg shorts too.

int xPin[] = {
  3,5,6,10,11  };  //PWM Pins to bases (multiplex grid)
                  //(Should have PWM running to anode planes - will change later)

int yPin[] = {
  2,4,7,8,12  };   // Bases of grounding transistors (multiplex grid)

int zPin[] = {
  15,16,17,18,19  };  //+5V to LED anode planes via R150

int x;
int y;
int z;

void setup()
{
  for (y=0; y<5; y++){
    pinMode(yPin[y], OUTPUT);
  }
  for (z=0; z<5; z++){
    pinMode(zPin[z], OUTPUT);
  }
}

void loop()
{
  for ( int z = 0; z < 5; z++){ 
   for ( int y = 0; y < 5; y++){ 
    for ( int x = 0; x < 5; x++){ 
      analogWrite(xPin[x], 0);   //Initialisation Loop everything is OFF
      digitalWrite(yPin[y], LOW); 
      digitalWrite(zPin[z], LOW); 
    }
   }
  }
  
  for ( int z = 0; z < 5; z++){ 
   for ( int y = 0; y < 5; y++){ 
    for ( int x = 0; x < 5; x++){ //Loop through each LED in sequence

      analogWrite(xPin[x], 255);
      digitalWrite(yPin[y], HIGH);
      digitalWrite(zPin[z], HIGH);  // Turn LED ON
      delay(200);

      analogWrite(xPin[x], 0);
      digitalWrite(yPin[y], LOW);
      digitalWrite(zPin[z], LOW);  // Turn LED OFF
      delay(500);

    }
  }
}
}

I had a good look at the board under a microscope at work, and the solders are great. I removed some residual copper from the drill-holes that may have been shorting. Also two of the HM3410 header plugs had a loose wire. But the embarrassing bit is, I left out the wiring to bridge the emitters in the transistor grid :blush:
I might have to solder that on the back of the board - 20 jumpers.

So I have no idea how the LEDs were getting any power at all.

More later...

Added the jumpers to join the emitters in the multiplex grid, fixed the plug leads, swapped the PWM pins onto the anode planes. Now nothing works.

Could I have cooked the transistors by over-soldering? They look OK and have about 5mm of leg-length.

This is becoming quite a mystery.