TLC5940 p-channel mosfet dimming curve

I´ve made a circuit using a tlc5940 and a p-channel mosfet to control a 3W powerled. This is the circuit:

It works, but has one big problem: the dimming curve makes it more or less useless for my purposes of slowly fading in and out the light.

Two years ago I made a similar circuit based on the LM317 and a transistor, which worked quite ok, but which wasn´t very power-efficient and had the problem of the inverted output (4095 off, 0 on). This circuit made perfect fades though.

To illustrate, when using the p-ch mosfet circuit, changing from 1 to 2 (in the 4095 range) makes the light incredibly much brighter than 1. This would correspond to maybe about 50 steps using my old circuit.

I have tried with four different mosfets, giving more or less the same result (irf5305,irf9z24n,irf9510,irf9610).

So, is this an expected effect of using a p-channel mosfet or is there something I can do with my circuit to improve this?

hc

This is the circuit:

No you have drawn the LED the wrong way round. It will never work the way you have drawn it.

I have tried with four different mosfets, giving more or less the same result (irf5305

I have only checked the first one but this is not a logic level FET therefore you can't turn it fully on with 5V. It is not the gate threshold but the quoted gate voltage in the Rds(on) parameter you have to worry about. This would normally make the LED not so bright but is over ridden by your biggest mistake:- You can't control a power LED with just a series resistor, its forward voltage is just too volatile to let a 1R8 resistor control it. You need a constant current source like you had with the LM317.

and had the problem of the inverted output (4095 off, 0 on)

Why is this a problem? If you have a variable "value" than all you do is use 4095 - value when ever you want to actually output it.

excuse my omnigraffle sloppiness. The LED is connected the right way.

I don´t see how my circuit is different from this one here (from Odisej), which is also based on 3w leds :

http://arduino.cc/forum/index.php/topic,52672.0.html

I would love to see the definite power led circuit for the tlc5940.

The inverted values is not a big problem, no, but it would be great to know that I have a circuit that get´s the maximum out of my leds.

hc

For the record, here is the corrected schematic:

I don´t see how my circuit is different from this one here (from Odisej), which is also based on 3w leds :

Well for one he had a 10R resistor and you have a 1R8 which makes a big difference, and for another that was a rubbish circuit as well.

I would love to see the definite power led circuit for the tlc5940.

Use the LM317 circuit you had and feed it from the TLC5940.

If I don´t remember wrong you trashed my LM317 circuit as well, and that has been working pretty good for two years :)

The strange thing about my new circuit is that no components get particularly hot even after leaving the led on full for 10 minutes, I still haven´t fried any leds, it worked with +5v (the old one needed +9 because of the voltage drop from the LM317), and the only thing I am unhappy about is the dimming curve. Oh well.

I would love to get constructive criticism/suggestions for improvement/simplification of my old circuit, so here is a simplified diagram (hope this one is drawn correctly) of that one. and you can check out an image of the actual dimmer here (actually two connected together for a total of 32 channels): http://www.flickr.com/photos/hcgilje/3945006625/in/set-72157622330769436

Both the transistors and the voltage regulators got pretty hot in this setup (the board is resting on two long heatsinks for the LM317s), and a few channels have died, maybe because I should have used resistors with higher effect?

What’s the beta (hfe) value of the TIP122? And it seems you’ve used the wrong symbol for a PNP as well.

the tip 122 is a NPN resistor

If I don´t remember wrong you trashed my LM317 circuit as well

I probably did, it's not a very good circuit but much better than a simple resistor.

and that has been working pretty good for two years

Sadly that doesn't prove the circuit to be reliable, repeatable & stable. The main problems with that sort of design is:- 1) The current limit is controlled by a fixed resistor that takes all the current flowing through it. This means it has to be a high wattage and you are restricted to standard values so you don't have proper control over the current. A better circuit would have a fixed small current sensing resistor, with an op amp and reference voltage providing a finely adjustable current.

2) Excess power is burned off by the LM317 in the way of heat. A more efficient circuit would have a switched mode regulator boosting the voltage up to (or down to) what is required for the current.

Both the transistors and the voltage regulators got pretty hot in this setup

Yes they will. Replace the transistor with a logic level n-channel FET, and it will not get hot. Also lower the voltage input to make the regulator run cooler.

If somebody on the forum has made something similar to what Mike describes, it would be great if they could share their circuit.

There are so many posts describing bits and pieces of a circuit, but it´s hard to know if it actually works before someone has designed, built and tested the complete circuit.

Just do a google image search for constant current led driver This looks like a good one of the sort I was talking about although it does use a small PIC:- http://www.datasheetdir.com/Digital-Constant-Current-Power-Led-Driver+Application-Notes

This also looks promising:- http://www.datasheetdir.com/Ncp3063-To-36-Vin-Dc-Constant-Current-Led-Driver+Application-Notes

So what you are implying is that all the simpler solutions, like the one below, are flawed solutions? http://www.instructables.com/id/Circuits-for-using-High-Power-LED-s/step8/a-little-micro-makes-all-the-difference/

I would have liked to see a version of the above instructable adapted for the tlc5940.

I just wanted to confirm that the last sketch I linked to (using the 2nd circuit without the zener) works fine when controlled from an arduino.
My components
3w white led (700mA)
q1 small npn transistor 2N5088BU
q2 powerfet n-channel FQP50N06L
r1 100k
r3 .75 ohm 2w

From the description at Instructables:
"

  • Q2 (a power NFET) is used as a variable resistor. Q2 starts out turned on by R1.

  • Q1 (a small NPN) is used as an over-current sensing switch, and R3 is the “sense resistor” or “set resistor” that triggers Q1 when too much current is flowing.

  • The main current flow is through the LED’s, through Q2, and through R3. When too much current flows through R3, Q1 will start to turn on, which starts turning off Q2. Turning off Q2 reduces the current through the LED’s and R3. So we’ve created a “feedback loop”, which continuously monitors the LED current and keeps it exactly at the set point at all times. transistors are clever, huh!

  • R1 has high resistance, so that when Q1 starts turning on, it easily overpowers R1.

  • The result is that Q2 acts like a resistor, and its resistance is always perfectly set to keep the LED current correct. Any excess power is burned in Q2. Thus for maximum efficiency, we want to configure our LED string so that it is close to the power supply voltage. It will work fine if we don’t do this, we’ll just waste power. this is really the only downside of this circuit compared to a step-down switching regulator!"

The benefits of porting this to the TLC5940 is higher resolution (4095 steps vs 255) and a lot of channels running from a single arduino.

So, anybody up for the challenge of modifying this for the tlc5940?
I only assume this would involve a p-channel mosfet, but I am not clever enough to figure this out by myself.

Just some suggestions to OP.
Both of your design approach aren’t optimal, from my point of view.
Basically, what you have is a chip that outputs constant CURRENT. Than you feed that outputs to VOLTAGE amplifiers ( MOSFET or BJT ) and after trying to re-create another constant current source for power LED ( using LM317, or just resistor ). It just doesn’t make any sense.
Why not amplify a current directly, if you need it more than chip could provide (900 mA instead of 120 mA or so). Simple PNP BJT with hfe ~6 (no darlingtons) would be sufficient enough for this.
Unfortunately, there is a little problem with variation hfe between transistors and with temperature.
But it could be solved by selection of transistors with close hfe ( let say 10%), than bringing it even closer adjusting base-emitter resistor (degrading hfe for devises with higher value), or setting dot correction in the chip.
Second obstacle, temperature variation, also not big deal, you can attach 50 cent temperature meter sensor to heatthink of the transistor, and compensate changing in the hfe with negative feedback to TLC5940, or make “software” correction by arduino itself.

You may also want to check out the TI LED reference design cookbook - http://www.ti.com/ww/en/analog/led/slyt394a.pdf ; lots of useful design information there.

So what you are implying is that all the simpler solutions, like the one below, are flawed solutions?

Yes the all have short comings. The link you posted is worst than the LM317 solution. It doesn't address the concerns in reply #8 in any way.

I would have liked to see a version of the above instructable adapted for the tlc5940.

God forbid, that site is pure and utter crap when it comes to electronic circuits, designed by morons for the consumption of idiots in general. That circuit is one of the better ones on the site and it is only so so.

Just think about it, there are simple solutions and complex ones. The reason there are complex solutions is that the simple ones leave something to be desired, designers don't just add a load of components for the hell of it. There are simple looking solutions but that is where those circuit functions of the complex ones have been mopped up into an IC. Like the BCR450, or the LM3407, LM3402, or the modules 3421 Buck Puck or the A6281.