Go Down

Topic: Help needed with a common anode 8x8 rgb led matrix (Read 6017 times) previous topic - next topic

Ruffman

Hello,
I'm a programmer and want to step into the world of electronics and microcontrolers. So I bought myself an arduino mega and two led matrices: first 8x8 single color, second 8x8 RGB. Both are common anode matrices.
I have driven the first one by multiplexing: took the anodes as rows and the cathodes as columns. I set one row to high and the cols that I want to light to low. then switched to another row... so far so good.
After I played around with it, I wanted to drive the rgb matrix. I left the code and first drove the blue color. it worked as before. Then i wired the other colors up, where I start facing problems. I first realized that in this way I could only possibly get 7 colors by mixing (r, g, b, rg, rb, gb, rgb). The second issue I face iwas: if I power the red led, the others don't light up, as if the red is stealing current. I googled a bit and found out, that i could get different colors by using pwm, using  this tutorial, but I don't quite get it. The code in page 5 of the how to it uses pwm for the cathode part. Mustn't it be negative pwm values as it is the cathode part? How am I supposed to apply this to my matrix? Using this method I must use 24 pwm pins which I don't have. Or can I use only the anodes as pwm pins? But then again I cannot use different color values for each of my leds in a row. Or am I supposed to multiplex every single led using 64 cycles for one image, instead of only 8? Do I get the concept of multiplexing wrong somehow? what am I supposed to do? Any hint is appreciated  :smiley-sweat:

fungus


The second issue I face iwas: if I power the red led, the others don't light up, as if the red is stealing current.


Sounds to me like somebody didn't put any current-limiting resistors in their circuit...
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Ruffman

You are right, I don't put in resistors to limit the current, but if that helps I have a lot of them lying around... I thought my matrix has its own resistors for each row, because the datasheet says something about "5V ReverseVoltage"...  but If you say that I should insert them I'll do it.
I guess 8 330 OHM Resistors on the anode part will do it?
My main problem is now how to get different colors for each row. How to get around the need of using 24 PWM pins?

stanleyhuang

I've built up a I2C driven 8x8 RGB matrix. Maybe you'd like to take a look.
http://www.arduinodev.com/rgb-led-matrix-kit/

My Arduino blog: http://arduinodev.com/blog

Ruffman

Thanks, but it already got 4 8x8 RGB matrices bought on ebay for 6$ each... so its about 6,5 times cheaper than yours  :P
Also the learning experience is one of the main goals I play around with the arduino, so maybe you like  to give us the circuit design of your I2C driver, so I can built one myself.

stanleyhuang

$6 for a 8x8 RGB matrix is incredibly cheap. Can you share me the link for that?
Actually my module is an Arduino (atmega168) itself.
My Arduino blog: http://arduinodev.com/blog

fungus

#6
Apr 29, 2013, 11:40 am Last Edit: Apr 29, 2013, 11:44 am by fungus Reason: 1

You are right, I don't put in resistors to limit the current, but if that helps I have a lot of them lying around... I thought my matrix has its own resistors for each row, because the datasheet says something about "5V ReverseVoltage"...  but If you say that I should insert them I'll do it.
I guess 8 330 OHM Resistors on the anode part will do it?


Do it (before you hurt the LEDs!)

The red LEDs might need a bigger resistor because they need less volts. If you use the same on all three colors the red will be brighter than the other two.


My main problem is now how to get different colors for each row. How to get around the need of using 24 PWM pins?


There's no way around that with one of those matrices. You'll need 2x TLC5940 or something like that. The TLC5940 has built-in current regulation, too, so you won't need resistors.


No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

fungus


$6 for a 8x8 RGB matrix is incredibly cheap. Can you share me the link for that?


You can get them even cheaper. Just search for "rgb led matrix" on eBay.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Ruffman


$6 for a 8x8 RGB matrix is incredibly cheap. Can you share me the link for that?

of course i can:
here, but as fungus stated: just search yourself on ebay. There are sometimes even cheaper. The downsite is, that you have to wait for about 2 weeks for the delivery


The red LEDs might need a bigger resistor because they need less volts. If you use the same on all three colors the red will be brighter than the other two.


so you mean putting resistors at the 8 anodes is wrong, and I should use a proper resistor for each color? The datasheet gives me no information about the different led colors, and how much they source. I guess I'll have to find that out myself.


There's no way around that with one of those matrices. You'll need 2x TLC5940 or something like that. The TLC5940 has built-in current regulation, too, so you won't need resistors.


They only way I can think of saving pwm pins, is multiplexing each pixel inside the matrix. Is the Arduino MEGA capable of doing so in terms of speed?


fungus


so you mean putting resistors at the 8 anodes is wrong, and I should use a proper resistor for each color?


Yes.


The datasheet gives me no information about the different led colors, and how much they source. I guess I'll have to find that out myself.


The datasheet assumes people are going to use proper constant-current drivers, not resistors.


They only way I can think of saving pwm pins, is multiplexing each pixel inside the matrix. Is the Arduino MEGA capable of doing so in terms of speed?


Maybe, but why bother?

You'll have to add external shift registers to be able to connect 24 LEDs to an Arduino so why not use shift registers with built-in PWM and constant-current control? (ie. TLC5940 or similar)

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Ruffman


maybe, but why bother?

You'll have to add external shift registers to be able to connect 24 LEDs to an Arduino so why not use shift registers with built-in PWM and constant-current control? (ie. TLC5940 or similar)


Hmm the TLC5940 is hard to get in germany. It is also very expensive, because 1 has the price of one of my matrices, and I'll need two of them for each. Isn't there a cheap chinese replacement :smiley-roll: $)

fungus

#11
Apr 29, 2013, 03:39 pm Last Edit: Apr 29, 2013, 03:42 pm by fungus Reason: 1

Hmm the TLC5940 is hard to get in germany. It is also very expensive, because 1 has the price of one of my matrices, and I'll need two of them for each. Isn't there a cheap chinese replacement :smiley-roll: $)


Search for "TLC5940" on eBay...you can get them for about $1 each from China.


http://www.ebay.com/sch/i.html?_nkw=TLC5940

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Go Up