Constant current led circuit - best components and general advice?

Thread Starter

paddyB

Joined Oct 9, 2017
11
Hi all, first post
Briefly, I live on a sailing boat, have been playing around with arduinos/Pi/esp for a while and some fairly basic electronics so a bit up from newbie but not too far.
I made a constant current LED anchor light and separate on/off light sense switch a while ago which has been working really well for many many nights. Now looking at a new one with PCBs from jlcpcb. So think the first one is what questions should i be asking :)

So the circuit below works if I've copied it over right from the perf board version. Constant current side came from here..
Some discussion about the first version here -
http://www.ybw.com/forums/showthread.php?438936-DIY-anchor-light
The rest i sort of guessed so not sure if the FET/transistor are ideal, or any of the components for that matter.
The on/off side seems a bit busier than it should be, again i just guessed and fiddled til it worked. General idea is open source, anyone can click the easyeda link, order the boards from jlcpcb and components from lcsc and build their own.
Designed in easyeda - used the auto create tracks which seems to be bit frowned upon but probably does a better job than i could. Project here - https://easyeda.com/paddyb/anchorlightmaster_copy
Sheet1 copy is the circuit in question.
Jlcpcb do a surface mount assembly service but only have a limited selection of components preloaded hence the resister networks and double capacitors .
So does that look ok - could it be better? Are there better choices of components? LEDs will be cree 503d-wan.
Any pointers about best practice, or general pointers at all gratefully received :)
Thanks!




 

Sensacell

Joined Jun 19, 2012
3,432
There must be some reason why this circuit is so complex that is not conveyed in the post?

You might get away with this design if the LED's are very evenly matched- but this could fail if there is an imbalance in Vf due to manufacturing differences.

The whole point of a constant current circuit is to ensure that the current is constant in all the LED's - shared evenly and regulated.
The series-parallel branches of LED's will not share the current evenly, the stack with the lowest combined Vf will hog the current, causing it to heat up... lowering the Vf... and therefore causing a vicious cycle. A current-hogging branch might experience 8 X the intended current!

This is especially true when there are many branches that share a common constant-current bus.
The main current must be equal to all the branch currents combined, current hogging can quickly lead to runaway.

Just use a current limiting ballast resistor for each branch of LED's and be done with it.
The ballast resistors 'dilute' the effects of uneven Vf, so the currents will remain much more equal, preventing runaway.

If you need to dim them, add a single current sink/source to the circuit, as long as the individual ballast resistors remain.
A linear dimmer will always be nonlinear and perform crappy at the low brightness end- PWM is much better.
 

Thread Starter

paddyB

Joined Oct 9, 2017
11
Thanks for the reply, the anchor light needs to run brightly from voltages which could be anything between under 12v to above 15v so a constant current circuit seems well worth the extra effort, which isn't much really for such a vital piece of equipment. This is commonplace for led boat nav lights but most use pwm which has been known to interfere with vhf comms if there isn't adequate filtering.
In the first version some time was spent ensuring each string of 3 leds had closely matched Vf but it turned out the cree 503 leds were very closely matched anyway so even picked randomly there was next to no difference in the strings. The whole thing will be potted in epoxy so have substantial thermal inertia. The leds are being run at 66% of the max datasheet constant current. First version has been running for hundreds of nights so far without issue.
 

DickCappels

Joined Aug 21, 2008
10,153
Other than as a way to spread power dissipation around, the adjustable voltage supply on the anodes is redundant since you have a constant current source on the cathodes.

As Sensacell mentioned, it is a really good idea to make sure the LEDs are all matched for voltage drop -manufacturers have specifications that address this. Otherwise you could have LEDs that either hog current or are too dim but regardless of how you look at it some LEDs will be getting more current than intended and that could lead to early wear-our of failure.

A good practice when the LED voltages are not well characterized is to place a low value resistor in series with each LED so that the LED voltage differences will not have a great effect on LED current.
 

Thread Starter

paddyB

Joined Oct 9, 2017
11
Other than as a way to spread power dissipation around, the adjustable voltage supply on the anodes is redundant since you have a constant current source on the cathodes..
Sorry, don't quite understand that - the tlv431/Mosfet controls the current to about 150mA, no other current control in the circuit?
.
As Sensacell mentioned, it is a really good idea to make sure the LEDs are all matched for voltage drop -manufacturers have specifications that address this. Otherwise you could have LEDs that either hog current or are too dim but regardless of how you look at it some LEDs will be getting more current than intended and that could lead to early wear-our of failure.
.
In the first version some time was spent getting each string with the same Vf but the LEDs were so closely matched I gave up as picking them random was within a few mA.

A good practice when the LED voltages are not well characterized is to place a low value resistor in series with each LED so that the LED voltage differences will not have a great effect on LED current.
Maybe worth putting a small resistor in anyway? What sort of difference in Vf would warrant this?

Thanks
 

DickCappels

Joined Aug 21, 2008
10,153
The 2N6718 looks to be a voltage adjustment. Not needed unless things get too hot without it.

If you are confident that none of your LEDs will be subject to damaging current levels then the series resistors will not be needed.
 

Thread Starter

paddyB

Joined Oct 9, 2017
11
The 2N6718 looks to be a voltage adjustment. Not needed unless things get too hot without it.
Ah, ok, that's not very clear. There's a photo resistor which goes in parallel with the 2 capacitors c2 & c3 which turns on the light when it's dark.
 

Thread Starter

paddyB

Joined Oct 9, 2017
11
Just for clarification, what is the purpose of Q2?
It's not actually very obvious in the circuit diagram. Photo resister is attached to the header in parallel with c2 & c3, type in the notes top left. When it's light it has low resistance and pulls the base to ground so the whole thing is turned off, gets dark then resistance increases and base goes to 12v so the circuit is powered.
Header h2 is if you want to bypass the on/off and have it on all the time.
 

Sensacell

Joined Jun 19, 2012
3,432
The dark-on circuit will see significant power dissipation when transitioning between day and night.

The 2N6718 is rated for 1 watt absolute maximum, this could occur at 150 ma with 7 volts across the transistor, which seems likely.
Never good to operate at a specified absolute max rating.

A snap-action circuit with hysteresis would cure that.

Also note that the maximum cathode voltage for the TLV431 is rated for 7 volts.
Your design could put much more voltage there if there was a cold solder joint etc.
Small manufacturing problems should not cascade to bigger ones.
 

Thread Starter

paddyB

Joined Oct 9, 2017
11
Thanks V much Sensacell, component selection is the bit I struggle with. Thought I'd checked through the datasheet on both of those but certainly didn't do a very good job :)
So is there like a website of the most common transistors, mosfets for certain power levels/applications? Or do you just learn as you go on.
What about just putting another STP16NF06 instead of the 2N6718 , costs a bit more but not really a budget breker in this case.
 

ronsimpson

Joined Oct 7, 2019
2,988
Questions: Is the "12V" really 12 volts or is it automotive 12V which is not 12 volts. (14.5V +/-!!)

I looked at a data sheet for the "cree 503d-wan" and the forward voltage is 3.2 typical but could be as high as 4.0 volts. (3.2x3=9.6 and 4.0x3=12) So the voltage across the LEDs might be 9.6V but could be 12V.

The way you are using the TL431 + mosfet there will be 2.5V across the current sense resistor(s). Then there should be voltage drop across the mosfet. And there is loss in Q2. It looks to me you need a supply of 15 to 20V to make this work.

You should try this before you make a PCB.
 

Thread Starter

paddyB

Joined Oct 9, 2017
11
Questions: Is the "12V" really 12 volts or is it automotive 12V which is not 12 volts. (14.5V +/-!!)

I looked at a data sheet for the "cree 503d-wan" and the forward voltage is 3.2 typical but could be as high as 4.0 volts. (3.2x3=9.6 and 4.0x3=12) So the voltage across the LEDs might be 9.6V but could be 12V.

The way you are using the TL431 + mosfet there will be 2.5V across the current sense resistor(s). Then there should be voltage drop across the mosfet. And there is loss in Q2. It looks to me you need a supply of 15 to 20V to make this work.

You should try this before you make a PCB.
Thanks for the repy
It has been working, on a bit of perfboard epoxied into some plumbing pipe, for over a year - the tlv431 used is(was) 1.24v across the sense resistor. From memory it would work down to about 11v, maybe lower. From a previous comment I'm now looking at this TLV431 - https://datasheet.lcsc.com/szlcsc/Texas-Instruments-TI-TLVH431BIDBZR_C131986.pdf
And yes, battery voltage could be anywhere from under 12v to over 15v.
Some images of the first version -
100mA (15 LEDs, 5 strings of 3) 8.9Vf.
upload_2019-10-8_13-15-51.png
upload_2019-10-8_13-19-3.png

V1 was a bit messy .... :)
upload_2019-10-8_13-18-0.png
 

ronsimpson

Joined Oct 7, 2019
2,988
Good pictures.
I now see you are using the 1.24V version of the "431" IC.
You have the photo sensor on the base of Q2. Have you tried it on the gate of Q1? Pull down the gate and Q1 will open up and stop the current.
 

Thread Starter

paddyB

Joined Oct 9, 2017
11
Good pictures.
I now see you are using the 1.24V version of the "431" IC.
You have the photo sensor on the base of Q2. Have you tried it on the gate of Q1? Pull down the gate and Q1 will open up and stop the current.
Oh, that's clever - of course!! Something like this maybe?

Would that mean the tLV431 would try to get the voltage at the gate back up? Though would that matter?
I'll be back on the boat tomorrow so will be able to have a play to see if it works.
Thanks!
 

ronsimpson

Joined Oct 7, 2019
2,988
The 431 can only pull down. It has no power supply. It can not pull up. That is what the 1k does (pull up). The power to run the 431 comes from the K pin. That is why the K pin can not go all the way to ground and have the part work.
upload_2019-10-8_8-33-21.png
 

Thread Starter

paddyB

Joined Oct 9, 2017
11
Cheers, the mists slowly clear... :)
So trying to get my head round this......
The photoresistors i had a quick look at had a resistance of ~1Kohm in the dark and 10 - 100Mohm in the light. So is this along the right lines - say in post 15,if RN3 was 1Mohm and it was dark, then there woild be roughly 6v going to the gate of the mosfet which the tlv431 could then pull down to limit the current. Then in the light the voltage would be down near 1v,maybe on the edge of turning on the mosfet. But, would 1Mohm allow enough current through to run the tlv431?
 
Last edited:

RPLaJeunesse

Joined Jul 29, 2018
252
I like the idea of gating off the 16NF06 with the photocell. But I'd use the photocell to drive a BSS138 (or other small NFET) as a "source follower / switch" that sits between pullup RN3 and the 16NF06-TLV431 node. Ground the photocell, and use maybe 22K as a pullup (or 4.7K plus a 50K pot). The result reduces your daytime current draw yet maintains day/night switching. Better yet, connect the low end of the photocell to the 16NF06 source node, thus giving some hysteresis to on/off switching. Some caveats: A) I've seen LED current sources oscillate at radio frequencies, we needed to bypass the LEDs with 100nF to keep everything quiet. B) "12v" isn't. I had a V6 with an ignition noise issue - pushed the voltage regulator to produce 18V. Also, If the battery connection is bad, the alternator can "load dump" to the battery line, driving it to 40V or more for most of a second. So design for 18V or more steady state and make sure to protect any battery driven FET gates from a load dump - possibly with a 12 or 15V zener gate to source. With 18V in RN3 at 1K might be a bit low for the max current allowed by the TLV431, which is 20mA max. Using multiple sections, i.e. 2K or 3K, might be safer.
 
Top