user-1: So I built my First LED Cube and the thing turns ON!!! Pretty happy about that but here is my problem.
When I try and get the Cube to display say a basic "outline" (a wire form of a cube only the outer most LEDs are on)
The shift registers, that I have daisy chained together, give the correct display 80% of the time, but the other 20% give completely wrong LEDs lighting up.
I have used 4 74HC595 shift registers linked together so I am only using 3 of my Arduino ports to control the 5*5*5 Cube.
The basic shape is there but the ones that are not meant to be lighting up cause a lot of flickering (or ghosting?) in the center of the cube.
I have thought about using pull up or pull down resistors but I find that, when I run my program at a slower rate, the LEDs that are lighting wrongly are lighting up controlled so I think it has to be something with my code or setup.
Has anyone got any experience with LED cubes doing this?
Also I am only using the output enable and disable to make use the wrong this is not displayed when I am shifting the data out, should I be using the clear?
One last thing, does anyone have recommendations for the delay time to let each layer shine for?
My code is below
int clockPin = 8;
int dataPin = 7;
int set = 6;

void setup() 
{
  //set pins to output so you can control the shift register
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(set,OUTPUT);     
}

void loop() 
{
      digitalWrite(set,HIGH); // DISABLES OUTPUT
  // level 1 ( top )
      shiftOut(dataPin, clockPin, MSBFIRST, B00000011);//from left 3rd to the 7th = levels 5-1,, The right first LED
      shiftOut(dataPin, clockPin, MSBFIRST, B11111000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B11000110);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00111111);// Makes the " wire cube "
      digitalWrite(set,LOW);  // enables output
      delay(2);

       digitalWrite(set,HIGH); // DISABLES OUTPUT
 // level 2
      shiftOut(dataPin, clockPin, MSBFIRST, B00000101);//from left 3rd to the 7th = levels 5-1,, The right first LED
      shiftOut(dataPin, clockPin, MSBFIRST, B00010000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00000000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00010001);// Makes the " wire cube "
      digitalWrite(set,LOW);  // enables output 
      delay(2);

      digitalWrite(set,HIGH); // DISABLES OUTPUT     
 // level 3
      shiftOut(dataPin, clockPin, MSBFIRST, B00001001);//from left 3rd to the 7th = levels 5-1,, The right first LED
      shiftOut(dataPin, clockPin, MSBFIRST, B00010000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00000000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00010001);// Makes the " wire cube "
      digitalWrite(set,LOW);   // enables output
      delay(2);

      digitalWrite(set,HIGH); // DISABLES OUTPUT 
 // level 4
      shiftOut(dataPin, clockPin, MSBFIRST, B00010001);//from left 3rd to the 7th = levels 5-1,, The right first LED
      shiftOut(dataPin, clockPin, MSBFIRST, B00010000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00000000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00010001);// Makes the " wire cube "
      digitalWrite(set,LOW);   // enables output
      delay(2);

      digitalWrite(set,HIGH); // DISABLES OUTPUT 
 // level 5 ( bottom )
      shiftOut(dataPin, clockPin, MSBFIRST, B00100001);//from left 3rd to the 7th = levels 5-1,, The right first LED
      shiftOut(dataPin, clockPin, MSBFIRST, B11111000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B11000110);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00111111);// Makes the " wire cube "
      digitalWrite(set,LOW);   // enables output
      delay(2);        
}

Any help would be appreciated
Thanks 

user630: I have had a similar issues when building this instructable, a 8x8x8 LED cube. Lighting up some of the LEDs caused wrong LEDs to light up simultaneously, even though according to the circuit diagram they where not suppose to. The wrong LEDs that lighted up seemed to be random, though it was reproducible.
The root cause was, after some debugging using a Multimeter's continuity test, that some of the LEDs legs where touching in places they shouldn't, and so the current was flowing where it was not supposed to flow. I strongly recommend to investigate that direction, verifying that Ground paths and Vcc paths are properly isolated from each other. This should be easier to do with a 5x5x5 cube.
About the delay - I suggest you'll take a look at the Arduino code in that instructable - it seems that between the different layers, the code does not use any delay, only between effects. The final result seems to works great.

user313: A simple way to test for short between LEDs is to write a loop that lights one of them at a time, one right after the other, for 50ms or so. It's relatively easy to notice two LEDs lighting together (a short) or a missing blink in the sequence (an open), assuming you can see all the LEDs at once.
Update (6 years later, but hey - I since people still read this question):
I use a sketch that does exactly this to help find shorts and opens when I'm building up a new board. I'd previously implied that you need all of the LEDs attached, but you need at most 2.
On a newly soldered cpu with power & ground (and reset jumpered to ground), holding an LED on each of two adjacent pins will show a shorted pair, while a single LED on one pin will display an open or a short to ground (or to +5, if you orient your LED+resistor that way). I keep a few LEDs with a resistor soldered to the cathode, or ground, leg to use as digital probes.

-1: <p>So I built my First LED Cube and the thing turns ON!!! Pretty happy about that but here is my problem.</p>

<p>When I try and get the Cube to display say a basic "outline" (a wire form of a cube only the outer most LEDs are on)</p>

<p>The shift registers, that I have daisy chained together, give the correct display 80% of the time, but the other 20% give completely wrong LEDs lighting up.</p>

<p>I have used 4 74HC595 shift registers linked together so I am only using 3 of my Arduino ports to control the 5*5*5 Cube.
The basic shape is there but the ones that are not meant to be lighting up cause a lot of flickering (or <em>ghosting</em>?) in the center of the cube.</p>

<p>I have thought about using pull up or pull down resistors but I find that, when I run my program at a slower rate, the LEDs that are lighting wrongly are lighting up controlled so I think it has to be something with my code or setup.</p>

<p>Has anyone got any experience with LED cubes doing this?</p>

<p>Also I am only using the output enable and disable to make use the wrong this is not displayed when I am shifting the data out, should I be using the clear?</p>

<p>One last thing, does anyone have recommendations for the delay time to let each layer shine for?</p>

<p>My code is below</p>

<pre><code>int clockPin = 8;
int dataPin = 7;
int set = 6;

void setup() 
{
  //set pins to output so you can control the shift register
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(set,OUTPUT);     
}

void loop() 
{
      digitalWrite(set,HIGH); // DISABLES OUTPUT
  // level 1 ( top )
      shiftOut(dataPin, clockPin, MSBFIRST, B00000011);//from left 3rd to the 7th = levels 5-1,, The right first LED
      shiftOut(dataPin, clockPin, MSBFIRST, B11111000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B11000110);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00111111);// Makes the " wire cube "
      digitalWrite(set,LOW);  // enables output
      delay(2);

       digitalWrite(set,HIGH); // DISABLES OUTPUT
 // level 2
      shiftOut(dataPin, clockPin, MSBFIRST, B00000101);//from left 3rd to the 7th = levels 5-1,, The right first LED
      shiftOut(dataPin, clockPin, MSBFIRST, B00010000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00000000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00010001);// Makes the " wire cube "
      digitalWrite(set,LOW);  // enables output 
      delay(2);

      digitalWrite(set,HIGH); // DISABLES OUTPUT     
 // level 3
      shiftOut(dataPin, clockPin, MSBFIRST, B00001001);//from left 3rd to the 7th = levels 5-1,, The right first LED
      shiftOut(dataPin, clockPin, MSBFIRST, B00010000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00000000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00010001);// Makes the " wire cube "
      digitalWrite(set,LOW);   // enables output
      delay(2);

      digitalWrite(set,HIGH); // DISABLES OUTPUT 
 // level 4
      shiftOut(dataPin, clockPin, MSBFIRST, B00010001);//from left 3rd to the 7th = levels 5-1,, The right first LED
      shiftOut(dataPin, clockPin, MSBFIRST, B00010000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00000000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00010001);// Makes the " wire cube "
      digitalWrite(set,LOW);   // enables output
      delay(2);

      digitalWrite(set,HIGH); // DISABLES OUTPUT 
 // level 5 ( bottom )
      shiftOut(dataPin, clockPin, MSBFIRST, B00100001);//from left 3rd to the 7th = levels 5-1,, The right first LED
      shiftOut(dataPin, clockPin, MSBFIRST, B11111000);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B11000110);// Makes the " wire cube "
      shiftOut(dataPin, clockPin, MSBFIRST, B00111111);// Makes the " wire cube "
      digitalWrite(set,LOW);   // enables output
      delay(2);        
}
</code></pre>

<p>Any help would be appreciated</p>

<p>Thanks </p>
 630: <p>I have had a similar issues when building <a href="http://www.instructables.com/id/Led-Cube-8x8x8/?ALLSTEPS" rel="nofollow">this instructable</a>, a 8x8x8 LED cube. Lighting up some of the LEDs caused wrong LEDs to light up simultaneously, even though according to the circuit diagram they where not suppose to. The wrong LEDs that lighted up seemed to be random, though it was reproducible.</p>

<p>The root cause was, after some debugging using a Multimeter's continuity test, that some of the LEDs legs where touching in places they shouldn't, and so the current was flowing where it was not supposed to flow. I strongly recommend to investigate that direction, verifying that Ground paths and Vcc paths are properly isolated from each other. This should be easier to do with a 5x5x5 cube.</p>

<p>About the delay - I suggest you'll take a look at the Arduino code in that instructable - it seems that between the different layers, the code does not use any delay, only between effects. The final result seems to works great.</p>
 313: <p>A simple way to test for short between LEDs is to write a loop that lights one of them at a time, one right after the other, for 50ms or so. It's relatively easy to notice two LEDs lighting together (a short) or a missing blink in the sequence (an open)<del>, assuming you can see all the LEDs at once</del>.</p>
<p>Update (6 years later, but hey - I since people still read this question):<br>
I use a sketch that does exactly this to help find shorts and opens when I'm building up a new board. I'd previously implied that you need all of the LEDs attached, but you need at most 2.</p>
<p>On a newly soldered cpu with power &amp; ground (and reset jumpered to ground), holding an LED on each of two adjacent pins will show a shorted pair, while a single LED on one pin will display an open or a short to ground (or to +5, if you orient your LED+resistor that way). I keep a few LEDs with a resistor soldered to the cathode, or ground, leg to use as digital probes.</p>
