8 x 8 LED Matrix Help Needed
NWCCTV
Posts: 3,629
I just received my Sunfounder Raspberry Pi accessory kit and it has an 8 x 8 LED Matrix that I have no clue how to wire up. So, I bring my question before the experts!!!! I think I want to try and get it going with my Prop BOE first. Once I get that figured out I can move on to figuring it out for the Raspberry Pi. Has anyone connected one of these to either a Stamp or a Prop, or a Pi for that matter?
Comments
There's some discussion about these type of LEDs in this thread.
I posted some code to control MAX7219 chips in this thread.
Using a 100 ohm resistor to limit the current connect 3.3V (through the resistor) to pin 5. Connect pin 1 to ground. If the corner LED lights up it's common cathode. If not, switch the power and ground connections and test. If it lights up this way it's common anode.
Use the 3.3V Prop power supply.
Use a small resistor of about 500Ω connected to +3.3V. 330Ω to 1KΩ would work OK.
And a wire to 0V.
Apply this to the pins and see if each LED lights up.
The resistor will ensure no damage to the part will occur.
The current will be around 4mA but the actual value will be dependent on the color.
Have Fun.
Duane J
EDIT: Would any f these work? They came in the kit: 1
1x Optocoupler 4N35
2x Shift Register 74HC595N
1x H-Bridge L293D
Jeez, had to google equipendency for this one. Good point though, particularly for an 8x8 array. Either one could be wired as common cathode or anode by treating rows as columns and columns as rows.
Is it equipendency? Doesn't a common anode array needs a controller able to source 8 times the current it is required to sink? While a common cathode needs to sink a lot of current with a single pin.
I know the MAX7219 can drive either type of array but I still have my doubts about using it with CA arrays (though it works).
I know programming wise, I just need to swap the columns and the rows which is much the same as using a CC array rotated by 90 degrees.
The two shift registers should be able to control the array.
I don't know of any software to do this but shift registers are about the easiest IC there is to write a driver for.
There are a lot of cheap MAX7219 chips on ebay. Don't pay more than $2 for a chip.
"Doesn't a common anode array needs a controller able to source 8 times the current it is required to sink? While a common cathode needs to sink a lot of current with a single pin." - That all has to do with the driver. For the actual display you still have the same number of LED's on a common leg (Cathode or Anode) no matter how you slice it. That number will still require the same source (anode) or sink (cathode) current.
It's the way a single pin my need to source or sink 8 times the current if the polarity of the display is switch that concerns me.
As I said in the cheap array thread:
I still don't have it straight in my head why I can use common anode displays with a MAX7219 chip.
Haha, are you sure it's not a 4x4 matrix?
Duane, it's more to do with how the array is scanned than anything else. After all there are common connections to both anodes and cathodes in any array of leds. The common anode/cathode terminology is more of a holdover from 7 segment displays.
If you scan by enabling each column in turn and lighting multiple leds in that column with the row drivers then the BL-M07C881 is common anode and the BL-M07D881 is common cathode.
If you scan by enabling each row in turn and lighting multiple leds in that row with the column drivers then the BL-M07C881 is common cathode and the BL-M07D881 is common anode.
The common connection driver will always need to be able to handle 8 times the current of the other (individual? non common?) connection.
Thank you kwinn!
You explained it just right to get it to click in my brain. Now that I understand this, I realize I had figured this out early on while playing with the LEDs but some how my brain let it slip.
So even though the arrays I'm using are called common anode, I'm using them as common cathode since only one cathode at a time is being driven low and up to 8 anode are being powered.
Again, thank you. This has been bugging me for a while. Now I know I'm not abusing the MAX7219 chips. They're being used as intended.
Add one to the list of favors I owe you.
I'm not sure who isn't understanding whom, but I said the arrays are "called common anode" but I'm using them in common cathode mode. As you explained in post #16, these type of arrays can be used as either common cathode or common anode depending on how they are connected.
Apparently MAX7219 chips don't require additional current limiting resistors. There's just one resistor used to set the overall current level and the chip takes care of the rest.
Lately, I've been working on getting my monster 64 x 64 LED array up and running. Who would have thought 4,096 LEDs could put a strain on a power supply?
So very true.