Go Down

### Topic: New to Arduino - TLC5940 questions (Read 4983 times)previous topic - next topic

#### zcwaa22

##### Jan 18, 2013, 11:30 pm
Hello,

I new to Arduino- started reading up yesterday and ordered an Arduino this evening. I'm wanting to be able to fade 16 LED'S up and down individually- I understand a TLC5490 will let me do this. I eventually want it to drive high power LED's and so have read about Multiplexing and MOFSET but I want to keep things simple as this is my first project.

I have quite a few questions.

1. I'm not up to speed on amps, watts and volts - but need to buy some LED's. What are the brightest white LED's that the TLC5940 can power when 1 LED is on each of it's channels- without going into Multiplexing or MOFSET or an additional power source. I've read that each channel can output 120mA- does this mean that it can output 16 x 120mA all at once?

2. Does this mean that any LED's which are advertised as being 120mA will work- how does the LED's watts and volts come into the equation.

3. I understand the Arduino outputs 5V does this mean that my circuit will run at 5V? Does this mean that any LED's rated up to 5V are ok?

4. I've read the TLC5940 doesn't need a resistor connected to each LED is this correct?

5. Ive ordered an Arduino, breadboard, wire and a TLC5940- Looking at the "Basic Use Example" of acleone's TLC5940 library it looks like I'll also need a 2k Resistor. Is this correct and are there any other bits I'll need apart from the LED's of course?

Hope someone can help!
Thanks

#### johnwasser

#1
##### Jan 19, 2013, 01:13 am
> 1. I've read that each channel can output 120mA- does this mean that it can output 16 x 120mA all at once?

That's what my reading of the datasheet would indicate. You have to feed the chip more then 3.6V to get 120 mA out.  At lower voltage it's 60 mA.

> 2. Does this mean that any LED's which are advertised as being 120mA will work-

120 mA or less.

> 3. I understand the Arduino outputs 5V does this mean that my circuit will run at 5V? Does this mean that any LED's rated up to 5V are ok?

Yes, but you shouldn't try to draw more than 400mA from the Arduino if you run it on USB or more than 900mA  if you run it on an external power supply.  Most LEDs have a voltage drop of 1 to 3 volts.  You can put LEDs in series if you want to run more than one LED per output.  You can then increase the drive voltage to as high as 17V to run the string of LEDs.  Add up the LED drop voltages to figure out the minimum drive voltage.

> 4. I've read the TLC5940 doesn't need a resistor connected to each LED is this correct?

That is correct.  The resistor with a fixed voltage supply is to adjust the current.  The TLC is a fixed CURRENT supply so it needs no resistor-per-LED.

> 5. Ive ordered an Arduino, breadboard, wire and a TLC5940- Looking at the "Basic Use Example" of acleone's TLC5940 library it looks like I'll also need a 2k Resistor. Is this correct and are there any other bits I'll need apart from the LED's of course?

The chip needs a resistor to set the output current.  2K will give you roughly 10 mA.  To get 120 mA use a 0.32K resistor.  There is a chart in the datasheet for what resistor value to use for various output currents.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

#### Chagrin

#2
##### Jan 19, 2013, 08:11 am

> 1. I've read that each channel can output 120mA- does this mean that it can output 16 x 120mA all at once?

That's what my reading of the datasheet would indicate. You have to feed the chip more then 3.6V to get 120 mA out.  At lower voltage it's 60 mA.

The bottom of page 3 of the datasheet lists the dissipation rating (2.5W) and page 15 tells you how to calculate the dissipation. It's primarily calculated by VOUT * IOUT * channels. VOUT is the LED supply voltage minus the LED forward voltage, so if you were powering the LEDs with 10V and using a 5mm red LED with 20ma and a forward voltage of 2V then your VOUT would be 8V and dissipation for that channel would be .16W.

The chip itself is powered with 5V but the LEDs can be powered with up to 17V. That means you could run 8 red LEDs at 120ma for almost 1W of light on each channel. Not that it's ever a good idea to drive chips to their peak of course.

Don't forget you can combine multiple channels to drive higher power LEDs. For example you could power a 350ma LED with three channels.

#### zcwaa22

#3
##### Jan 19, 2013, 03:00 pmLast Edit: Jan 19, 2013, 03:30 pm by zcwaa22 Reason: 1
Thanks for your help, still trying to get my head round this.

I've ordered 2 different sets of LED's-
First set has a DC Forward Current of 120mA and DC Forward Voltage Typical-2.4v Max 3.2v
Second set is described as If 20mA, Vf = 3.4v, Vr 5v Max

I take it the second set's Vr refers to the Forward Voltage Max in the first set.

Bearing in mind I'm still at the level of trying to understand circuits as pipes full of water can you let me know if the following is correct.

1.The Ardunio outputs 3.3v or 5v, if plugged in to the USB the max amps is 400mA if plugged in to the mains max amps is 900mA.

2.If I supply the TLC4940 with 5v, it magically converts this up to a maximum of 17v - this bit I can't really fit into my water/pipes/pump understanding of circuits! Do I set how many Volts it outputs through software or does it do this automatically?

3.So the TLC4940 will provide enough Volts for- 5 of my first LED's - 3.2v x 5 = 16v or 3 of my second set of LED's 5v x 3 = 15v.

Then we get to amps.

4.Driving the TLC4940 at 5v will put out up to 120mA per channel. To output at 120mA I use a 0.32K resistor, If I want to use 5 of my first set of LED's I'll have to use the Ardunio's external power as 5x 120mA = 600mA which is bigger than 400mA!

5.To output 20mA I'll use a 1K resistor, and I'll be able to use the Ardunio's USB power as 3 x 20mA = 60mA which is less than 400mA.

This seems bit of a shame as I was hoping to power 16 LED's without resorting to an external power source- I guess I'll have to go down that route?

Following this logic which I really hope is flawed- To drive 16 LED's at 20mA each = 320mA I can use the Ardunio's USB Power as 320mA is less than 400mA however I'd have to use some kind of external power for the LED's which would be 16 x 5v = 80Volts - that seems mad! Please tell me where I've gone wrong! Just to clarify I want each LED on its own channel so they can be faded individually.

#### johnwasser

#4
##### Jan 19, 2013, 03:55 pm
> First set has a DC Forward Current of 120mA and DC Forward Voltage Typical-2.4v Max 3.2v
> Second set is described as If 20mA, Vf = 3.4v, Vr 5v Max
> I take it the second set's Vr refers to the Forward Voltage Max in the first set.

The Forward Voltage is the voltage drop across the diode when lit.  It's not a very well controlled value so the first one lists a typical/nominal value (2.4V) and a Maximum value (3.2V) for worst-case calculations.  It means you have to supply at least 3.2V per LED (times the number of LEDs in series).

The Vf in the second one is probably the typical/nominal value.  The Vr is the maximum REVERSE voltage. In a matrix some of the diodes that are not lit will be reverse-biased.  I think that means you shouldn't run your matrix one more than 5V.

> 1.The Ardunio outputs 3.3v or 5v, if plugged in to the USB the max amps is 400mA if plugged in to the mains max amps is 900mA.

Yes.  The first id from the 500 mA limit of USB and the second is from the 1A limit of the Arduino voltage regulator.

If you provide externally regulated 5V to the 5V pin you can draw quite a bit of power from that pin since any you draw from there doesn't have to go through the traces on the Arduino.

> 2. If I supply the TLC4940 with 5v, it magically converts this up to a maximum of 17v.

No.  Your LEDs will run on 3.2/3.4V so 5V is fine.

IF you put, for example, three LEDs in series you would need  9.6/10.2V to drive them.  In that case you would need to provide a higher voltage (something like 12V)  to the TLC4940.  The upper limit to the voltage the TLC4940 can handle is 17V.

> 3. So the TLC4940 will provide enough Volts for- 5 of my first LED's - 3.2v x 5 = 16v

No.  If you want to use LEDs in series you have to provide the higher voltage.

> 4. Driving the TLC4940 at 5v will put out up to 120mA per channel. To output at 120mA I use a 0.32K resistor, If I want to use 5 of my first set of LED's I'll have to use the Ardunio's external power as 5x 120mA = 600mA which is bigger than 400mA!

Current is the count of how many electrons flow through the wire (like how much water is flowing through the pipe).  The same amount flows everywhere in the circuit.  If you put put LEDs in series you need more voltage but the same current.

You DON'T want to push 120 mA through a 20ma LED.

For your first set of LEDs if you drive 120 mA through 16 LEDs you will need a power supply capable of 1920 mA (roughly 2A) and at least 3.2V (5V will be fine).

For your second set of LEDs you need 320 mA and at least 3.4V (5V will be fine).  You can experiment with these using the Arduino supply and switch to the high-power ones when you get a 2A supply.

> 5. To output 20mA I'll use a 1K resistor, and I'll be able to use the Ardunio's USB power as 3 x 20mA = 60mA which is less than 400mA.

Yes.  16*20 = 320 mA which is still below the max that USB can provide.

> This seems bit of a shame as I was hoping to power 16 LED's without resorting to an external power source- I guess I'll have to go down that route?

Yes.  For 16 high-power LEDs you will need more power than the Arduino regulator can provide.

You have two choices for running everything on one supply:

Regulated 5V supply at 2A or more:  Connect + to the Arduino "+5V" pin.  Connect + to the TLC "Vcc" pin.  Connect + to the anode of each LED.  Connect - to Arduino "GND" and TLC "GND".

Unregulated 7-9V supply at 2A or more:  Connect + to the Arduino "Vin" pin.  Connect Arduino "+5V" pin to the TLC "Vcc" pin.  Connect + to the anode of each LED.  Connect - to Arduino "GND" and TLC "GND".

to power both the LEDs and the Arduino (through the Vin pin).  The Vcc pin of the TLC would use 5V from the Arduino "+5V" pin.  The raw 7-9V would connect to the anodes of all the LEDs.  The cathodes of the LEDs would connect to OUT0 through OUT15 of the TLC.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

#### zcwaa22

#5
##### Jan 20, 2013, 04:38 pm
Hi John, thanks for taking the time to help- you've made it a lot clearer.

I'll probably be back once my bits arrive!

#### zcwaa22

#6
##### Jan 29, 2013, 06:57 pm
Hi,

Hope it's ok to bring this thread back- thought it's best to keep everything in one place rather than starting a new thread.

I've recieved my LEDs and Power Supply and am trying to follow John's instructions of plugging it all together- already burnt out one TLC5940 so thought I'd be better off posting here!

My power supply is Regulated 5V 2000mA. I've used the following image to set everything up on breadboard:

To do the following:
>> Regulated 5V supply at 2A or more:  Connect + to the Arduino "+5V" pin.  Connect + to the TLC "Vcc" pin.  Connect + to the anode of each LED.  Connect - to Arduino "GND" and TLC "GND".

I've tried leaving everything plugged in as it is and adding the Power Supply's "+" to the "+" line on the breadboard and Power Supply's "-" to the breadboard's "-" line- When I do this nothing works?

I've also tried replacing on the breadboard the wires from Arduino's "+5V" and "GND" and plugging my Power Supply's "+" and "-" into the holes the Arduino's wires were in. Also doesn't work.

Should I plug the Power Supply's "+" directly into the Arduino's Board's +5V Pin? That doesn't seem to make sense as then the power wont be getting to the breadboard?

Just tried plugging the Power Supply's "+" into the Arduino's Vin Pin and the power supplies "-" into the Breadboard's "-" line. This works but I'm aiming to run 16 120mA LEDs fora total of 1920mA- and I've read the Arduino wont let more than 1000mA through it?

Sorry to ask for help for such a simple question I just don't want to mess any more chips up!

#### Hippynerd

#7
##### Jan 29, 2013, 08:00 pm
it sounds to me like you hooked it up correctly, like shown in the fritzing image. My only guess is you somehow got polarity backwards, or accidentally disconnected something while connecting something, or maybe just forgot to connect something.

In this image, I have 3 TLCs and a nano. Try to ignore all the brightly colored wires, and focus on the two parallel wires (one red, one black) that start in the lower right corner. T

#### fungus

#8
##### Jan 29, 2013, 08:26 pm

does this mean that it can output 16 x 120mA all at once?

Yes....with certain caveats.

When you light up a LED you have a supply voltage, eg. 5V. The LED will use part of that (eg. 3.6V for a green LED) and the chip has to dissipate the leftover part as heat.

The problem is the 'leftover'. The bigger the difference between the supply voltage and the LED voltage, the more leftover there is. eg. The chip will get far hotter running the 3.6V LED from a 12V supply than from a 5V supply.

So...you can run all 16 LEDs at 120mA, IF the total power the chip has to dissipate at any time is less than about 1500mW.

This is less than 100mW per LED. At 120mA your supply voltage has to be less than (100/120)=0.83V away away from the LED voltage. You can use external resistors to drop the voltage to within that range.

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

#### fungus

#9
##### Jan 29, 2013, 08:29 pm

> 1. I've read that each channel can output 120mA- does this mean that it can output 16 x 120mA all at once?

That's what my reading of the datasheet would indicate. You have to feed the chip more then 3.6V to get 120 mA out.  At lower voltage it's 60 mA.

The chip has a total power dissipation rating. You can do 120mA per channel but the total power being dissipated by the chip must be kept within strict limits.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

#### zcwaa22

#10
##### Jan 30, 2013, 12:19 am
Thanks for the input guys. I went back and started from scratch, ended up attaching the Power Supply's "+" and "-" to the breadboards "+" and "-" lines while leaving the Arduino's +5V and Gnd Plugged into the same lines and its all working.

As for the power dissipation the TLC5940 datasheet say's it has a power dissipation of 2.5W- fungus you stated 1.5W is this just incoraporating a safety margin?

My LED's use 3.2V at 120mA so 5V-3.2V = 1.8V.... 1.8V * 120mA == 0.216W per channel. 2.5W/ 0.216W = 11.57 ..... So I can run 11 of these LED's.

Putting these numbers into this site:  http://led.linear1.org/led.wiz -advises that I use a 15ohm resistor on each channel in order to run all 16 of LED's.

Hopefully that will work- I haven't accounted for the current the TLC uses and am new to this so might be completely wrong!

#### fungus

#11
##### Jan 30, 2013, 12:41 amLast Edit: Jan 30, 2013, 12:44 am by fungus Reason: 1

As for the power dissipation the TLC5940 datasheet say's it has a power dissipation of 2.5W- fungus you stated 1.5W is this just incoraporating a safety margin?

That's at 25°C, but ... if you run it at 2.5W without active cooling it won't stay at 25 degrees for very long!

Where will the temperature level out? That's hard to say, but the datasheet says to remove 19.65mW per °C.

1.5W seems like a safe value and it's one you can achieve easily with just an extra external resistor per LED. That's why I picked it.

It might be able to handle more than 1.5W but I doubt it's anywhere near 2.5W without heatsinks+fans, etc.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

#### zcwaa22

#12
##### Jan 30, 2013, 12:53 amLast Edit: Jan 30, 2013, 02:27 am by zcwaa22 Reason: 1
Ah ok! Thanks for clarifying that fungus!

I'll definately be putting a resistor on each LED.

http://led.linear1.org/led.wiz says that a 15ohm resistor on each LED will dissipate 216mW per resistor which I guess leaves the TLC hardly anything to dissipate- does that soudn right to you? I thought I'd try and double check this and looked up resistor dissipation on wikipedia and got this equation but it's midnight here and my brain isn't working too well- I'll take another look in the morning.

#### fungus

#13
##### Jan 30, 2013, 11:15 am

Ah ok! Thanks for clarifying that fungus!

I'll definately be putting a resistor on each LED.

http://led.linear1.org/led.wiz says that a 15ohm resistor on each LED will dissipate 216mW per resistor which I guess leaves the TLC hardly anything to dissipate- does that soudn right to you?

At 120mA a 15 Ohm resistor will swallow 1.8V.

So...if the LED takes 2.4V, the resistor takes 1.8V, that leaves 0.8V for the TLC5940.

0.8V*120mA*16=1.536W total dissipation - that's within spec.

1.5W is still quite a lot of heat for a chip to dissipate though. It's going to get quite warm if you set all LEDs to full power for more than a few seconds (nb. I don't know how many LEDs will ever be on simultaneously...)

If it was me I'd use 16 or 18 Ohm resistors just because it's no effort and it reduces the load on the chip a little bit more.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Go Up