0

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

1
  • add circuit scheme , for the times it depends on many things (mainly fps) but the usual is 1-10ms look here for similar problem stackoverflow.com/a/20468992/2521214
    – Spektre
    May 15, 2014 at 6:55

3 Answers 3

2

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

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.

0

I have a similar circuit (running a 7-segment display); I don't use reset, and for something like this (since the only state it keeps is reset on sending of new data, which is every frame).

For debugging, I would suggest seeing if there are any patterns. For example, if it doesn't happen on LEDs controlled by the first shift register, then it's likely to be due to the connection between them.

You might try seeing if a pulldown resister (try >10kOhm) between the data pin and ground has an effect, too.

If you get really desperate, it might be worth getting an oscilloscope - see what is actually happening on the wire.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.