Question concerning LED matrix using TLC5490 and arduino

I'm trying to build a 6x10 RGB led Matrix using TlC5940s and an arduino
There are 6 Leds in a row and there will be 10 rows.
The LED themselves are 10mm leds and need about 20mA minimum percolor
The RGB LEDs are common anode and the +ve side conneted to arduino via a Tip30 transistor which is also attached to a external power supply.
The -ve of the LED are connected to the TLC5940. All the red pins from the LEDs in a single row are paralleled together and ckonnected to a single pin on the Tlc5940, the same goes for the green pins and the blue pins from the LEDs. Therefore, there should be a total of 30 pins used on the TLC5940s (3x10). So far, I've build one row and did some testing. However, when I try to lit up all the 6 LEDs at the same time and make them change color, there seems to be a lot of flickering. I know that the chip can only sink about 120mA but is that per pin or for the whole chip? My plan is to be able to light up the whole matrix at the same time(and change color), but still be able to provide enough current to each led. Any suggestion/help is appreciated :slight_smile:

It's 120 mA per pin, but that's the absolute max. As far as how much total current the chip can handle, see the data sheet under "dissipation ratings" for the type of chip you're using. Divide the milliwatt rating by the voltage you're using for your max.

Good luck!

Put some power supply decoupling on each TLC5940 chip. A 0.1uF between the power and ground as close to the chip as you can get.

does it have to be 0.1uF? Is there some general guideline when choosing decoupling capacitors?
Thanks

does it have to be 0.1uF?

No.

Is there some general guideline when choosing decoupling capacitors?

Yes use 0.1uF.

See:-
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Thanks, i was wondering if i could use npn transistors similar to this schematic

http://www.bek.no/~hc/downloads/powerled_schematic.png

While it would work it will not be able to completely turn off the LED due to the fact that the signal is inverted and the TLC5940 never fully turns on the LEDs. The difference between the maximum on and full on is not viable but that between full off and minimum off is.

Is there any other alternative to this then?

Just don't invert the drive. That means using a p-channel FET or PNP transistor to current source rather than an NPN transistor to current sink.

So if i use a PNP transistor i'd connect the E side to the -ve of the led, the B side to the TlC5940 and the C side to GND? Is the pull-up resistor between B and the OUTn?

No, given that circuit you posted before you had the NPN transistor sinking current from your LM317. You now need to switch this with current sourcing.

To switch it with current sourcing connect the cathode of the LED to ground. Connect the collector of the PNP to the +ve input of the LM317 (currently this is connected to 9V), connect the emitter up to +9V. Connect a resistor (10K) from the base of the transistor to the emitter. Connect another resistor (value depends on the actual PNP transistor you use) to the TLC5940 output.

But in this case, how to i make it into a matrix, since the led I have are common anodes. That means i still need something to control the GND of the leds

since the led I have are common anodes

You didn't show that on the schematic you posted with the LM317, that schematic will not work with common anode LEDs.

So back to the drawing board, you want a constant current driver that will work with a common anode RGB LED. That is going to be a lot more complex and involve op-amps I think.

Hang on I think we are going round in circles,
you said at first:-

he LED themselves are 10mm leds and need about 20mA minimum percolor

Why post schematics about a 3W LED?

Can you post a schematic of what you actually have.

oh I was just wondering if i could use the npn transistors like that
Here's the schematic of what i got right now
Like you said i can't turn led off completely

You can't put LEDs in parallel like that, they do not shair the current. There is no current limiting resistor or anything. It is not clear what controls the PNP transistor and what controls the NPN, they are just marked Pinx and Outx.
I think you will have to totally rethink what you want to do and how you want to do it.

Hi!

Grumpy_mike is right: you need current resisting resistor on each on your LEDs cathode (since they are common anodes).

Also I am not sure I understand what you want to do and why you want to use transistor (since the LED driver you are using seems to have enough current out to light up each LEDs).

But it seems that I am trying to do something similar:
I am currently building a RGB LEDs matrix as well, using RGB LEDs and a 16-LED driver from NXP (don't remember the reference but if I am correct it is 120 mA out for each channel) that can be controlled by I2C.
I started to code a library to control independently each RGB LED (I have 5 RGB LEDs per driver + 1 pin not used).
It is not finished yet but I am already able to do the following operation:

  • get selected RGB led color,
  • set selected RGB led color,
  • fade selected RGB led color....

If it is something like that you want to do, tell me and I could post my schematic and/or code.

The pnp is controlled by the arduino and the npn is controlled by the TlC5490, why can't you put the led like this?

I used npn transistors because if each led(1 color) takes 20ma then in this case there is already 120ma going into each pin of the TLC5490. The schematicI posted is for one row in the matrix .If I have something like 10 rows, I'm not sure the TLC5490 can sink enough current.

why can't you put the led like this

Well for a start the control is upside down, and the LEDs must have a current limiting resistor each.

Attached is what I would do to control common anode RGB LEDs from the TLC5940. Note how the anodes connect to the positive line allowing them to be grouped in terms of colours.

External LED Drive.pdf (22.9 KB)

How do you make that into a matrix though? From what i have now, the arduino controls the anode and the the TLC5940 controls the cathodes. Yeah the controls are inverted, but that's ok i just write the code in a different way.