Common Anode 8x8 LED Array

Hello,

I have bought a few of these 8x8 common anode LED arrays a few years ago. I want to show alphabets etc. on one of them. I will only use green color LEDs. I want to use 8 output ports to specify which LEDs (rows) in each column will turn on (ports 2-9). At the same time I want to use 8 other ports to activate the cathodes for each column (ports 22-29).

  • What should I do for the cathodes? Use NOT gates (since they are cathode)? I guess that is not possible because of the required fan out for 8 LEDs.

  • I have some of these 2803 darlington drivers. How can I use them to provide cathode for the LED columns? Just give a high output to the input of darlington and connect the output to the cathode of the columns?

  • I will later use 4017 or 74595s to scan through the columns (I will have 10 of these arrays).

I appreciate your kind help.

Use a MAX7219 - that does everything you need.

No resistors, transistors or anything else needed.

fungus:
No resistors, transistors or anything else needed.

One resistor.

But you got in first with the same advice as I would.

Thank you very much. I ordered some MAX7219s from ebay.

However until they arrive I thought I give the ULN2803 a try. The circuit works but there is a problem. It appears that cathodes other than the active one (the active ULN2803 output) have some type of leakage?!

Could someone guess what is the problem?

This is the program I use:

int cathode[8] = {22,23,24,25,26,27,28,29};
int anode[8]   = {2,3,4,5,6,7,8,9};

void setup() {                
  // initialize the digital pin as an output.
  int i=0;
  
  for(i=0; i<8; i++)
   pinMode(cathode[i], OUTPUT);    

  for(i=0; i<8; i++)
   pinMode(anode[i], OUTPUT);    
}

void loop() {
  int i=0,j=0,k=0;

  for(i=0;i<8;i++)
  {
    digitalWrite(cathode[i], HIGH);

    for(j=0;j<8;j++)
    {
      digitalWrite(anode[j], HIGH);
      delay(500);
      digitalWrite(anode[j], LOW);
    }

    digitalWrite(cathode[i], LOW);
  }
}

I cant quite follow the wires in the video ... maybe a circuit schematic would help? (hint, big nudge :wink: ) It is enough if you just show the firrst few lines/columns, I presume it repeats for the rest. If you dont want to do a fancy drawing just send a picture of a handdrawn (but we prefer a proper diagram)

I didn't change the schematic from the one I posted in the beginning of the thread. I have only one more pin (i.e. the ground of the darlington IC) connected to ground.

I posted the long video because in the middle it seems the leak goes away or is reduced. I thought that might give a clue of what is wrong.

Here's how to "walk the dot":

byte cathode[8] = {22,23,24,25,26,27,28,29};  // "COL"
byte anode[8]   = {2,3,4,5,6,7,8,9};          // "ROW" resistors
byte i;
byte j;

void setup() 
{                
  for(i=0; i<8; i++)
  {
    pinMode(cathode[i], OUTPUT);
    digitalWrite(cathode[i],HIGH); // cathode off
  }   
  for(i=0; i<8; i++)
  {
    pinMode(anode[i], OUTPUT);    
    digitalWrite(anode[i],LOW);
  }
}

void loop() 
{
  for(j=0; j<8; j++)
  {
    digitalWrite(cathode[j],LOW);
    for(i=0; i<8; i++)
    {
      digitalWrite(anode[i],HIGH);
      delay(500);
      digitalWrite(anode[i],LOW);
    }
    digitalWrite(cathode[j],HIGH);
  }
}

And here's "the other way":

byte cathode[8] = {22,23,24,25,26,27,28,29};  // "COL"
byte anode[8]   = {2,3,4,5,6,7,8,9};          // "ROW" resistors
byte i;
byte j;

void setup() 
{                
  for(i=0; i<8; i++)
  {
    pinMode(cathode[i], OUTPUT);
    digitalWrite(cathode[i],HIGH); // cathode off
  }   
  for(i=0; i<8; i++)
  {
    pinMode(anode[i], OUTPUT);    
    digitalWrite(anode[i],LOW);
  }
}

void loop() 
{
  for(j=0; j<8; j++)
  {
    digitalWrite(anode[j],HIGH);
    for(i=0; i<8; i++)
    {
      digitalWrite(cathode[i],LOW);
      delay(500);
      digitalWrite(cathode[i],HIGH);
    }
    digitalWrite(anode[j],LOW);
  }
}

Added variation on theme

The original post's "schematic" doesn't show a ULN-etc. So, my sketches (above) were written not utilising such - just a matrix and the resistors as shown.

@Runaway Pancake

Thanks. However:

  • the darlington itself reverses the logic (there is no need to do it in the software).
  • Initializing ports to low does not seem to have any effect (it appears that they are low by default).
  • If we update the first issue it will work same as my design (with the same leak effect).

A leak seems unlikely.

Based on your code, it looks to me like the other anodes might be floating instead of being pulled to ground. Just an idea.

wmac1:

  • If we update the first issue it will work same as my design (with the same leak effect).

Which is to say, you did try his code, with only the polarity altered?

wmac1:
@Runaway Pancake

Thanks. However: ...

My thought was that you could ditch the 2803, for the present, and try my suggestion - just to make some initial progress.

If you know what to do then do it.

LEDs don't "leak", but wires and components get plugged in wrong places.