LM317 alternative for CC regulator help

Thread Starter

ThePanMan

Joined Mar 13, 2020
367
The fish pond - yes, I'm not finished with that yet. I bought a constant current regulator that was supposed to operate from 5V to 28VDC and have a constant current output of 150mA. I connected that to my UV-C LED's and was very much unimpressed with the outcome. Upon measuring the current I was reading 52mA. No, I didn't miss typing in the "1", that was it. 0.052A. I started looking closer at the website I bought this stuff from and discovered that they claimed their single LED chip had a Vf of 5.6 volts. The same exact claim was made regarding the tripple series LED chip. Three chips on a board. Looking up the manufacturers data on the LED chip it's reportedly 5.6Vf per chip. Probably no wonder why at 12VDC the LED's barely glowed and read 52mA. I don't even know how they got that much current. The sales technician said the LED's I got were the older kind with a Vf of 3 volts. OK, so that's 3 volts of headroom. That should account for something.

So I upped the input voltage to 19VDC @500mA. Still the LED's glow was unimpressive. It wasn't until I put a 24VAC transformer through a Bridge Rectifier that I was able to get - using a 47Ω resistor a current of somewhere around and just over 100mA. And at that the resistor did not get hot. I was expecting it to fry. It didn't.

So now I'm just going to build my own CC source. The LED max current is listed as 200mA but is recommended to run at 150mA. I'd be happy with that. So I'm looking into building something small that has to fit in a cup approximately 1 1/2" diameter by 1 1/2" deep. Looked at Amazon but what I was finding there just was too big to fit in. So I'm considering using an LM317 for a CC regulator. However, I'm unsure how to go about calculating for the current. I know I=1.25/R. But I'm unsure about the Vf of the LED's. I do need to test them to see what that is and I just have to knuckle down and do that. But do I need to factor that into the current? Is it like a regular LED and resistor? Or do I need to consider something else here?
 

Thread Starter

ThePanMan

Joined Mar 13, 2020
367
At 24VAC full wave rectified (no filter cap) and a 100Ω resistor the current measured was 75.5mA and the voltage across the three LED's was 15.6Vf. That gives an average of 5.2Vf per chip.
 

Dodgydave

Joined Jun 22, 2012
10,306
For a constant current led driver you don't need to bother about the Vf of the leds as they will alter as the current increases or decreases, if you're putting more than one led in series then all the led voltages will add up , so give yourself about 5V height.

Lm317 is great for a led driver,
as for the current calculation yes it's 1.25V /R

So for 75mA it's about 16ohms, i would use a 33 ohms preset and adjust for the best response.

and the wattage of the resistor or preset is VxV/R
 
Last edited:

Thread Starter

ThePanMan

Joined Mar 13, 2020
367
Looking like: 1.25 ÷ 0.15 = 8.3Ω. I'm confident that's right, but sometimes in confidence we can walk off a cliff. So are my numbers right? 1.25 x 0.15 = 1875mW. A quarter watt resistor should be fine. No?

Two resistors parallel; 47Ω and 10Ω should be 8.25Ω. No?

Filter cap on the input side after the BR?
 

crutschow

Joined Mar 14, 2008
29,792
Note that the dissipation of the LM317 is 152mA * (34-15.6) = 2.8W, so it will need to be on an appropriate heat-sink.

And you will need a filter capacitor of more than 0.1µF if you want the bridge output to be low ripple DC.
 
Last edited:

Thread Starter

ThePanMan

Joined Mar 13, 2020
367
it will need to be on an appropriate heat-sink.
Just had to rain on my parade. But thanks for the cool drink of water. OK, I'll figure out how to incorporate a heat sink. This does raise another concern for me - the unit will be under water in a sealed plastic compartment. The transformer will be above ground (above water) so there's little concern there for heat or for introducing 120VAC into the pond.

The concern is lack of air flow. The LED will be in a glass tube with heat sink compound to the glass, so any heat there will be quickly dissipated into the glass and into the water. Maybe I can figure a way to attach the 317 to the back side of the heat sink and dump its heat into the water. But then I'm heating my LED's further. HMMmmmmmmm. What to do? How to tackle this issue?!
you will need a filter capacitor of more than 0.1µF if you want the bridge output to be low ripple DC
What would you recommend? The LED's are UV-C and inside a filtration system, so there's no observable light. Flickering LED's will not bother me. Or the fish I'm sure. Will it bother the LED's at all? I don't even care if there's no cap. I just don't want the 317 to start ringing - if that's a possibility. No filter cap - lower RMS voltage (24VDC with heavy ripple). (24 - 15.6) * 152 = 1.28W
 

Dodgydave

Joined Jun 22, 2012
10,306
Just had to rain on my parade. But thanks for the cool drink of water. OK, I'll figure out how to incorporate a heat sink. This does raise another concern for me - the unit will be under water in a sealed plastic compartment. The transformer will be above ground (above water) so there's little concern there for heat or for introducing 120VAC into the pond.

The concern is lack of air flow. The LED will be in a glass tube with heat sink compound to the glass, so any heat there will be quickly dissipated into the glass and into the water. Maybe I can figure a way to attach the 317 to the back side of the heat sink and dump its heat into the water. But then I'm heating my LED's further. HMMmmmmmmm. What to do? How to tackle this issue?!
What would you recommend? The LED's are UV-C and inside a filtration system, so there's no observable light. Flickering LED's will not bother me. Or the fish I'm sure. Will it bother the LED's at all? I don't even care if there's no cap. I just don't want the 317 to start ringing - if that's a possibility.
Just have the leds in the water and keep the regulator etc outside , and just have a pair of wires into the tank.
 

Thread Starter

ThePanMan

Joined Mar 13, 2020
367
Just have the leds in the water and keep the regulator etc outside , and just have a pair of wires into the tank.
Yeah, um that would make too much sense.

As for the transformer I WAS planning on putting it inside a piece of ABS capped at one end and NPT screw plug on the other so the stuffing could be installed and removed for repair whenever the time comes.

Thanks Dave of the Dodgy type.
 

crutschow

Joined Mar 14, 2008
29,792
Below is the simulation of the circuit with the 0.12µF filter capacitor:
R1 was reduced to 5Ω to get an average 151mA through the load (simulated here by a 15V Zener diode).

The average LM317 dissipation for that condition is reduced to 1.5W.

1652909870261.png
 

Thread Starter

ThePanMan

Joined Mar 13, 2020
367
Why is I(R1) showing some 245mA? Trust me, there's a lot I don't understand. I see the wattage is half wave but I don't follow the "Average" wattage.
 

Audioguru again

Joined Oct 21, 2019
4,685
The LM317 produces 1.25V in the 5 ohms resistor which limits the peak output current to 1.25V/5 ohms= 250mA.
The rectifier produces pulses between 0A and 250mA then the average current is 151.26mA.
 

crutschow

Joined Mar 14, 2008
29,792
I don't follow the "Average" wattage.
The top plot is not showing wattage, it's current .
So, for example, if the current is 200mA for 3/4 of the time, and zero for 1/4, then the average current is 150mA.

I increased the peak current so the average would be near the 150mA you wanted.
 
Last edited:

Thread Starter

ThePanMan

Joined Mar 13, 2020
367
If you are going to use this around water, for safety you should ground it or, even better, use a ground fault interrupter on the AC input.
Yes, around water. Yes, grounded. Yes GFCI protected.

As the plan is evolving and taking clearer shape the plan now is to only have the LED unit beneath water. The transformer, bridge rectifier and current regulator will be mounted inside an ABS or PVC pipe with a sealed cap on what will be mounted as the TOP, and the bottom will have a threaded sleeve pierced with power in and regulated out. This will be mounted to the fence beneath the overhang and largely protected from weather. The only possible intrusion of moisture, whether condensate or rain/sprinkler (very unlikely) should protect the guts. The thing I'm still grappling with is the heatsink for the 317. I've scrapped a few old computers and have kept a bunch of different heatsinks so finding one that will fit and work well isn't the issue. The thing I'm troubling over is the sealed environment that will trap the heat and get warmer as time progresses.

I've found a new (old) doorbell transformer with 8, 16 and 24VDC output. The LED's were measured at 75mA to have a Vf of 5.2 volts average among the three in series. 15.6Vf total. If I use the 16 volt tap and filter it with a bigger cap I'm looking at a good DC voltage (very little ripple) of 22.6V. 22.6 - 15.6 = 7.6 volts difference. At 150mW, that's going to be 1.14 watts that have to be dissipated.

If I'm going to go with a PVC case I could (and probably should) buy a CC regulator from Spamazon. Something I'll look into. If it's based on PWM then that's going to be less wasted heat. And since I haven't built anything yet other than to bodge things together just to get a measurement or two - I don't see having much of anything to lose.

Your thoughts?
 

Thread Starter

ThePanMan

Joined Mar 13, 2020
367
Yes the first one is ideal, B06x...
Less heat waste , as i said earlier, put all the electronics outside of the tank and just run two DC wires into the sealed leds .
Yes, outside is the go-to. Just have to choose a heatsink. I have a couple that will do. One will need a threaded hole, but I can do that.
As the plan is evolving and taking clearer shape the plan now is to only have the LED unit beneath water. The transformer, bridge rectifier and current regulator will be mounted inside an ABS or PVC pipe with a sealed cap on what will be mounted as the TOP, and the bottom will have a threaded sleeve pierced with power in and regulated out. This will be mounted to the fence beneath the overhang and largely protected from weather.
Electronics will not be in the pond. At first that was the direction I was leaning, but good advice is worth following. I was taught by my father: "If you want what another man has - take his advice."
 

Thread Starter

ThePanMan

Joined Mar 13, 2020
367
Three options for heatsinking. The center one already has a drilled and tapped hole and screw. The other two - I can drill and tap them too. Which do you think is sufficient and which would you choose?
1652983512560.png
 
Top