# LM 338 Driver Problems



## Carbon2010 (Dec 2, 2009)

I'm building a set of LM338 drivers for some cree's I purchased. I'm using a 12V 3.33A laptop charger as my power supply. Now i hooked up the circuit like this


Lm338:
Vin > 12V+
Vadj > from resistor to LED
VOut > 1.6Ohm resistor To Vadj

( this type of driver circuit can be found here:
http://www.reuk.co.uk/Using-The-LM317T-With-LED-Lighting.htm
It uses a lm317 which is just a lower amp rating of the 338)

My end voltage is great. 10V meaning the regulator is functioning and i'm only dropping 2V, but my issue is current. I'm trying to put out 800mA. By doing the calculation:

1.25 / .800 = 1.6Ohm resistor.

Hooked everything up yet i'm only getting .04A(40mA) through my meter?

Is there something i'm missing here?


----------



## jeffosborne (Dec 2, 2009)

Hi Carbon2010 - how many LEDs are you wiring in series?

Jeff O.


----------



## Carbon2010 (Dec 2, 2009)

I will be hooking up two LEDs in series. There will be 4 of these circuits all ran off of their own lm 338 and sharing the powersupply.


----------



## Carbon2010 (Dec 2, 2009)

Could it be that I'm measuring amps wrong?

-I plug the red probe into the 10A input and set it to 10Amp.
-I plug the black probe to ground
-Connect the positive to the output from the resistor (after the Vout pin)
-Connect the negative to the ground of the powersupply?


I get .04A @ 10.xxVolts.
I dont want to test with two Crees and risk a Fry...


----------



## Der Wichtel (Dec 2, 2009)

Carbon2010 said:


> I will be hooking up two LEDs in series. There will be 4 of these circuits all ran off of their own lm 338 and sharing the powersupply.



so currently no LEDs are connected? What are you using instead?



Carbon2010 said:


> Could it be that I'm measuring amps wrong?




the amperemeter must be connected in series of your circuit. For example between input voltage and your regulator


----------



## Carbon2010 (Dec 2, 2009)

Your correct nothing is connected. I wanted to test the circuit before hooking anything up. And yup the meter was in aeries with the circuit


----------



## Carbon2010 (Dec 3, 2009)

Could it be that because there is no LEDs the circuit isn't drawing the amps? I tryed hooking up some computer fans and they turned so slow they would stop Almost twitching due to the lack of current. I'm sure I hooked the circuit up correctly. Is there a problem with my electronics?


----------



## Der Wichtel (Dec 3, 2009)

computerfans need higher voltage (12V) which the lm388 can't deliver.

Your circuit should be correct.


----------



## Carbon2010 (Dec 3, 2009)

Well my meter said I was outputting 10ish volts more then enough to get some air from a 12v 13mA fan.


----------



## Der Wichtel (Dec 3, 2009)

Just try to connect a higher load like a 12V halogen bulb.


----------



## Carbon2010 (Dec 3, 2009)

Hooked up a 12v light and nothing lit. Then I hooked directly to the power supply and it lit up. I'm really lost on this one?


----------



## lctorana (Dec 3, 2009)

Go here, and skip to page 8, the "5A Current Regulator". Three questions:

1. Apart from the value of R1, this is the circuit you are using, yes?

2. Your mention of the LM317 made me wonder whether you might have the wrong polarity - you are satisfied everyting is hooked up the right way around?

3. Check the pinouts, to ensure the 3 connections are actually where you think they are.

Other than that or a faulty device, I can't see anything wrong with your hookup.


----------



## Carbon2010 (Dec 3, 2009)

I snapped some pics with my iphone quickly - excuse the terrible quality:


THE MAIN LINE (RED WIRE WITH TERMINAL) GOES TO THE POSITIVE OF THE SUPPLY
THE LOOSE LEADS FROM THE RESISTOR GO TO THE LEDS
LET ME KNOW WHAT YOU GUYS THINK OF THIS CIRCUIT...ITS MY FIRST TIME USING A SOLDERING GUN



 





 





 





 





 





 





I think everything is hooked up correctly? Hope nothing is fried...


----------



## Illum (Dec 3, 2009)

your paralleling 4 LM338s?! why would you do that if you want only 800ma out of it? they can handle 5 amps each!

If I'm looking at this correctly....


 


Your resistors are soldered to the wrong place. Its a common mistake if your just following wiring diagrams
For both LM317 and LM338, if your holding it in front of you where you can read the embedded words on the black encapsulation and have the heatsink facing the back, the pin sequence from left to right is Adj, Vout, Vin

In your case, a resistor is wired between Vout and Vin and your adj pin is bridged across 4 LM338s

All schematic charts put adj in the middle because the wiring diagram won't have crossed lines
consult the datasheets for LM338 and LM317 and take a look at the TO-220 diagram 

What you are measuring is not the output I(load), but output I(gnd) because there is no resistor between the adj pin and the output pin as far as the driver is aware of, your making it try to compute by dividing by zero, I(gnd) is transient current loss through ground, and is used to factor in power loss, total current input, and efficiency. 40ma/4 = 10ma loss per driver at current configuration...this tells you something bad happened somewhere as transient loss is usually measured in micro-amps (µA), 1 µA = one millionth ( 10^-6 ) of an amp.

10ma = 1000µA


----------



## Carbon2010 (Dec 3, 2009)

I wanted to keep heat down to an absolute minimum and they were only 1.50$ each..I thought why not.

Wow...Such a silly mistake on my part...I guess you learn from your mistakes and it is true; a picture does say a 1000 words. I'll flip the regulators over and re-try. Thank you for you help everyone. I'll let you guys know what happens.


----------



## Illum (Dec 3, 2009)

o....back when I was playing with LM317s I had the same issue, only I didn't realize it until everything is potted in permanently.

your doing on thing right thus far, you tested your circuit for consistency before going ahead with other add-ons :thumbsup:

Paralleling four regulators should get you 800x4 = 3200ma output if you use the same resistors across the regulators and connecting the Vout on the same bus


----------



## Carbon2010 (Dec 3, 2009)

Much much kudos illum for the help and the kind words. Aside from my slipup how does the circuit look?

Each regulator will run two LEDs. I opted to use a 1.8ohm resistor so my curent will be around 700 ma. Does this all make sense to yea?


----------



## Carbon2010 (Dec 3, 2009)

So just to makesure how can I test the voltage and current output with my meter before I plug an led onto it?


----------



## Illum (Dec 4, 2009)

The easiest way you can repair it is flipping the chips backwords, where Vout is now in place of the existing Adj. If you mounting the heatsink with epoxy then....depending on the amount of overhead space it might be better to stand the chips up, exposing more surface area for passive air convection to those heatsinks.



Carbon2010 said:


> Much much kudos illum for the help and the kind words. Aside from my slipup how does the circuit look?
> 
> Each regulator will run two LEDs. I opted to use a 1.8ohm resistor so my curent will be around 700 ma. Does this all make sense to yea?



yep

circuit looks great! I would have never considered the use of solid copper as conducting bridges...mine would have jumper wires traversing across the perf board.

I'm not sure about the LM338 but some power supplies have a different reading between load and no load. That is, if there's an open circuit on the output end, it may give you erratic results. For much complicated power supplies, an open circuit on the output end will fry its electronics, not sure how this works. I can only see how this may happen if the circuit is closed then suddenly opened, where the output capacitors could dump its stored power back to the IC. 

What multimeter do you have? 
Some digital multimeters have more than one voltage selection as well as current selection...in addition to three ports for probes instead of two.
If I know what multimeter you use I can walk you though it easier

For basic understanding of meters, measuring volts you would parallel your multimeter with some type of a load, where you will measure the potential without the majority of the output current rushing through it.. Measuring current is exact opposite, the meter is wires in-line, or in series with your load, where the only path for current to go is through your multimeter.

*For other noteworthy things to consider adding on to your generously wide board... Good for reference, or you can just skip it...your choice.
Some of the stuff down here originates directly from my own sketchbooks back when I used LM317 almost anywhere that needed a cheap point of load current regulated supply. 
* 
Measuring power loss [or heat output] of the LM338 use

```
P = (Vin - Vload) x I
P = Power loss
Vin = supply voltage
Vload = voltage consumed by your output end
I = current
```
you noted that you will be wiring two LEDs in series and you waqnt to drive them at 800ma.
LEDs are current regulated creatures, depending on the current applied the Vf will vary as a function [close to a parabola] with current. Say if your using white CREE XREs, the Voltage input is 3.3V at 350ma but will shift to 3.5V when driven at 700ma. There will be slight changes between batches but this is just illustrative. 

Suppose you are using two XREs, you would go and pull up the datasheet to see what the draft looks like. In this case, while the typical forward voltage [or Vf] to the LED is 3.3V the Vf is in actuality 3.7V at 800ma

Okay, now you can solve your power loss

The “differential = 2V” part means at minimum the regulator will consume 2V, and its primarily used to solve for minimum power input. In this case you are using 12V, which might be a tad too big a value to promote minimum heat output

Two LEDs in series: 
3.7V as Vf [learned from datasheet, each LED is different]
3.7V x 2 = 7.4V
2V differential exists on the LM338, now add that to it
7.4V + 2V = 9.4V, at a 9.4V input the regulator will incur minimum power loss

Where you are with 12V exists that 
12-9.4 = 2.6V excess
Excess voltage [2.6V] multiplied by 0.8A of current will contribute an additional 2.08W of power loss. 

```
P = [12V – (3.7V x 2)] x 0.8A
  P = [4.6V] x 0.8A 
  P = 3.68W
```
 3.68 here represent total power loss for each LM338 in this configuration, noting that 2.08W is from excess voltage applied. By reducing your input voltage, you could have effectively eliminated approximately [2.08/3.68=0.5652] 57% of the power loss we see here.

Choosing your heatsink...in this case you would have wanted a heatsink capable of at minimum dissipating 5W of heat, and depending on whether or not the device is enclosed, you might want much bugger heatsinks

you've got current adjustment covered, so I'll omit it here

looks like you've got the resistor power rating for the adj pin covered as well

```
P = UI
P = Power across the Resistor
U = 1.25V for the LM338/317
I = desired current output
```
This is the power that ill travel through the resistor


```
Pd = I^2 x R
Pd = Power disspiated
I = current across resistor
R = resistance value
```
Pd = (0.8)^2 x 1.6
Pd = 1.024W
this value is the power that's dissipated from the resistor

At minimum use an at least 10% higher power value for resistors, I use 25% or more...resistors are cheap, but some values may not be as common as others. A 1/4W resistor jolted with 1/4W of heat will actual light up like a toaster, a 1W carbon composition resistor jolted with 1W will actually burst into flames

Also...be sure to add some capacitors to your LM338s for stability
read though this segment of the datasheet


> External Capacitors
> An input bypass capacitor is recommended. A 0.1 µF disc or 1 µF solid tantalum on the input is suitable input bypassing for almost all applications. The device is more sensitive to the absence of input bypassing when adjustment or output capacitors are used but the above values will eliminate the possiblity of problems.
> The adjustment terminal can be bypassed to ground on the LM138 to improve ripple rejection. This bypass capacitor prevents ripple from being amplified as the output voltage is increased. With a 10 µF bypass capacitor 75 dB ripple rejection is obtainable at any output level. Increases over 20 µF do not appreciably improve the ripple rejection at frequencies above 120 Hz. If the bypass capacitor is used, it is sometimes necessary to include protection diodes to prevent the capacitor from discharging through internal low current paths and damaging the device.
> In general, the best types of capacitors to use are solid tantalum. Solid tantalum capacitors have low impedance even at high frequencies. Depending upon capacitor construction, it takes about 25 µF in aluminum electrolytic to equal 1 µF solid tantalum at high frequencies. Ceramic capacitors are also good at high frequencies; but some types have a large decrease in capacitance at frequencies around 0.5 MHz. For this reason, 0.01 µF disc may seem to work better than a 0.1 µF disc as a bypass.
> Although the LM138 is stable with no output capacitors, like any feedback circuit, certain values of external capacitance can cause excessive ringing. This occurs with values between 500 pF and 5000 pF. A 1 µF solid tantalum (or 25 µF aluminum electrolytic) on the output swamps this effect and insures stability.


basically...you'll need something like this
Electrolytic caps are used for low frequency filtering of power due to their slow response times, high frequency filtering is facilitated by tantalum capacitors. 
Here's some of the caps the datasheet talked about [your only going to need one electrolytic, one "red" tantalum, and one regular "yellow" tantalum]



left to right: Electrolytic, tantalum, poly-film, ceramic, disc

After reading the datasheet you should have something like this




caps make things stable, caps needs diodes to protect what your trying to keep stable
Then it gets interesting, recall what I said about a sudden open circuit on the output end damaging chips? well...you might want to plan for that in the event one of your LED chains burn out and opens the circuit.

capacitors can provide an exceptional amount of current within a very small time...
the datasheet warns this


> Most 20 µF capacitors have low enough internal series resistance to deliver 20A spikes when shorted. Although the surge is short, there is enough energy to damage parts of the IC.


and provides a diagram of where to put diodes where that power will flow through instead of forcing its way through the IC
I redrew it below. IN400x diodes are general purpose diodes that are found in many places, like radioshack, etc, but if your interested I can supply you with sources for these parts







5 additional components per IC will populate that perf board in no time =P


----------



## jar3ds (Dec 4, 2009)

i don't mean to steal the thread.... but how do you calculate what watt rating of a resistor you need? I understand how to calc the actual resistor but not its watt rating...


----------



## Der Wichtel (Dec 4, 2009)

P = R*I²


----------



## Illum (Dec 4, 2009)

Der Wichtel said:


> P = R*I²



Resistors bother me...alot now
What does the wattage on a resistor represent? the power its capable of transmitting or the power it is capable of dissipating in heat? :thinking:


----------



## Der Wichtel (Dec 4, 2009)

It's the wattage it can dissipate in heat.
It does not matter how much power it is transmitting. 
As long the power the resistor consumes is lower than the max. power it's allowed to consume everything is ok.


----------



## Carbon2010 (Dec 4, 2009)

Illum, WOW...You have managed in 5 min to take something that a kinda understood to something WAYYYY over my head. 

I kinda just wanted to build a circuit that was a step up from a resistor soldered in series kinda thing? Heat wont be an issue for me as everything is in a metal ported project box with a rather large computer fan on it.

I'm really just trying to make this work and not burn on a month down the road. I'm not worries if i'm using a lot of extra power as long as really...nothing catches fire:thinking:

Illum - Beer on me mate. MUCH appreciation for the extended help on this one. You made me realize that i should'nt quit my day job..thanks:twothumbs


On another note...

I switched the LM338 around and it seems to work? I hooked up a computer fan and it ran. I then hooked it directly to the 12V and it ran faster, so the regulator is doing something...

My meter has 4 inputs:

V/Ohms
Com
A-200maMAX
10A

To measure amps I put it in series with the 10A and common. set the meter to 10A and Check the reading after regulator? If there is no load wont it create a short?

I will be running two Crees I got of DealExtreme (XR-E Q5) in series off each regulator. 3.7V at around 700mA. I just want to check everything with a meter first prior to hooking everything up. I waited a long time and don't want to screw this up.

I realize I'm a little over my head as I don't understand a lot of what you said Illum. If you could ... how could I put this...Dumb it down for me 

Again thanks everyone for the help thus far.


----------



## Illum (Dec 4, 2009)

well...if your measuring current without the LEDs you are effectively shorting the output end with no caps in place, the simple order your using at the moment it shouldn't pose an issue since its current regulated. I knew LM317s proved to be quite resilient but I could be wrong because I never did it this way, I coupled a 1 ohm 10W resistor as a load when I played with the LM317

Set to 10A, connect probes one to each terminal...if you get an error reverse the polarity.

Now... you will never see 0.8A on the readings, you will either get a value lightly higher or a value slightly lower, it depends on what tolerance your resistor has. If its a 5% resistor, then you could expect 800ma +/- 5%, or a variance of 40ma in the output.

It would pose an issue for current regulators to measure voltage open circuit because it would expect a voltage drop using a load of some sort...for these cases a resistor wouldn't work as a load because resistors don't have a set voltage drop, its voltage drop varies with current input. 

I'd imagine using a couple diodes in series might work as an effective load. 
something like 4 IN4001 diodes in series [each have Vfm = 1V @ If = 1A] it would provide a consistent 4V voltage drop at an input of 1A, 800ma is slightly below so I imagine 4 diodes in series would constitute as one CREE XR-E. IN4001 diodes [if you don't buy from radioshack] its about $0.025 each:nana:

This will dive into murky waters because I've never tried this, so I cannot guarantee any of this will work as I expect.


----------



## Carbon2010 (Dec 4, 2009)

Looking at how my circuit it, and i'll post pictures of my readings tomorrow, Do you think I can safely hook up my leds and measure everything quickly (if they are being overdriven, its not for long?


----------



## Carbon2010 (Dec 5, 2009)

Well I said screw it and went ahead and connected two. It turns on!!!

But here's the kicker:

it showed me .70amps on my meter. Perfect exactly what I wanted. 700mA. But the thing I noticed is it slowly started to rise. 710...720...ect. My thoughts are I was getting thermal runaway. The two that I tested we not on a heat sink. They were only connected for under 10 seconds, enough so I can get a steady reading. The voltage surprised me. I got a reading of 8.8v. That means to many volts are going through? Properly heatsinked (and will they ever be) will this occuar? I'm also feeding the full 12v 3.33amps through the regulator and only two LEDs are using them.


----------



## Illum (Dec 5, 2009)

um....

you got the first part right, as LEDs heat up, their foward voltage will decrease, increasing their current draw...which could be what your looking at. If the LED is not heatsinked, and driven at 700ma...it'll be hot enough to put burn marks on paper in a few seconds, eventually destroying itself when Tj hits 150C.

As far as voltage goes um...
Somehow that never occurred to me.... :thinking:
XREs are 3.7V at 800ma, 3.5V at 700ma
8.8V across two CREE XREs in series:
If Iout = 700ma is 8.8-(3.5x2) = 1.8V too much, but at Iout = 800ma is 8.8-(3.7x2) = 1.4V

12Vin -> LM338 -> 8.8V, meaning its dropping 3.2V through it, while maintaining am average tolerance of +/- 13% voltage regulation. interesting..

What I would do at this point, if this is really a concern...
I would add a LM317 in voltage regulated mode before the LM338, currently in current-regulation mode and compensate the output voltage with the LED forward voltage in sum with the LM338 differential minimum. It won't be the most efficient, but it should guarantee that your throwing out 7V (3.5x2) at 700ma.

Due to the severe thermal dissipation, my LM317 projects never driven LEDs greater than 200ma... 

2xCREEs are 3.5x2 = 7V, the 338 drops 2V, so its 9V minimal in. Adding an LM317 means the input must be 2V greater than output. 9V + 2V = 11V From a 12V power supply, it might be worth a try to take advantage of the voltage drop the LM317 has. 

Modifying an earlier diagram...my thoughts look something like this 0.o, which I suggest you ask someone else more experienced because this is way too complicated for a simple LED Driver 





If this was to be built, and if this were to go as planned mathematically you should get a 9.06V after IC1, 9.06-2=7.06V after IC2. 7.06V/2 = 3.53V per LED
IC2 would limit the current down to 694.44ma...but I'm sure there are easier ways to accustom for the issue than this. I don't know of any at this point :shrug:

I've stopped building my own drivers long ago, hopefully someone more circuit savvy can contribute


----------



## Carbon2010 (Dec 5, 2009)

Well I saw a simple circuit the uses the lm 338 in voltage regulation. Regulate to 6.8v and then run to the bus line. It's just an ic and two resistors. I hope something like that would work. 

I thought the LEDs would only draw as much as they need and only that? Guess I'm back to the board with another ic


----------



## Carbon2010 (Dec 5, 2009)

Here's the rehulator for voltage I was going to use:

http://www.reuk.co.uk/LM317-Voltage-Calculator.htm

it even has a nice list at the bottom to tell me exactly what two resistors are needed. My question is do I wire this in parallel (+ from powersuply to Vin and leaves from Vout. - from powersuply attaches to the second resistor) 

This should now give me regulated voltage aswell?


----------



## Illum (Dec 5, 2009)

Since the LM317/338 must either be wired in voltage regulating mode OR current regulated mode... its impossible to have the best of two worlds...you'll have to use two ICs...



Carbon2010 said:


> Here's the rehulator for voltage I was going to use:
> 
> http://www.reuk.co.uk/LM317-Voltage-Calculator.htm
> 
> ...



The two resistor you see there is called a voltage divider, it creates an independent potential difference between [Ground and Vout] and [Ground and Vin]
If used stand alone, then it could be solved by Vout = [R1/(R1+R2)] x Vin

I have no idea how they solve it for the LM317/338 because their values do not match Vout = 1.25 * ( 1 + R2/R1 ) 

I already made the calculation for you, to get a Vout of ~9V you'll need 160 ohms between adj and Vout and 1 Kohm between adj and Gnd.

It is wired exactly as shown, it does not connect to the input line at all, it does not connect anywhere that may impede the IC receiving incoming power. It connects the adj to two places, the output line, and the ground:wave:


----------



## Carbon2010 (Dec 5, 2009)

Oh allright so I can connect the Vin and Vout to the positive in series to the powersuply and the Adj to the ground in series. Then just wire as usuall?

And because it's all wired on parallel voltage stay the same at 9v (3.5+3.5+2=9)

will the ic draw more than 2v ever?


----------



## Carbon2010 (Dec 5, 2009)

I have a spare lm317. If my powersuply outputs 3.33amps at 12v can o use this or is it over the limit ?


----------



## Illum (Dec 5, 2009)

Carbon2010 said:


> Oh allright so I can connect the Vin and Vout to the positive in series to the powersuply and the Adj to the ground in series. Then just wire as usuall?
> 
> And because it's all wired on parallel voltage stay the same at 9v (3.5+3.5+2=9)
> 
> will the ic draw more than 2v ever?



uh...for voltage regulation
Vin to the "+" end of the power supply
Gnd to the "-" end of the power supply
connect R1 between adj and vout
connect R2 between adj and gnd

for current regulation
Vin to the incoming positive [either "+" end of power supply or "Vout" from voltage regulator]
Gnd to Gnd 
Vout to the resistor
Adj to the other end of the resistor connected on the Vout



Carbon2010 said:


> I have a spare lm317. If my powersuply outputs 3.33amps at 12v can o use this or is it over the limit ?



LM317 limits the output to a maximum of 1.5A [for TO-220 pkg], unless you plan on using 3.33A it has no effect to your build

I've sketched up schematics using power transistor 2N3772s to increase the current output way above the Imax = 1.5A


----------



## Carbon2010 (Dec 6, 2009)

well because I will be using almost all of the 3.3amps for my leds. 

(8 leds in total. two in series pulling in 700mA. 2.8Amps used)

If I use the 317 in voltage mode, as long as im below 37V I wont damage anything?


----------



## Illum (Dec 6, 2009)

LM317s in voltage mode...
Each LM317 will only output 1.5A max into your LM338

In an illustrative sense, amps = water current
Power supply -> LM317 -> LM338 
is analogous to a pipe capable of flowing 3.3A of "juice" connected to a pipe capable of 1.5A that is then connected to a pipe capable of 5A, but since your application needs only a pipe big enough to flow 0.7A of 'juice" it really doesn't matter and no it won't harm it at all.

If your using the LM317 in voltage regulation mode, set to Vout = 9V than the LM317 will function as long as the input voltage maintains above 9+1.5 = 10.5V. The upper limit will depend on how big of a heatsink your willing to work with, if you heatsink it to a CPU heatsink, might want to keep the voltage as low as possible, but if you heatsink it to an engine block [Vout = 9V] you should be able to whack it with close to 50V with no issues, it wouldn't be very happy, the efficiency would be in the 40s, but you won't damage it:laughing:

you mentioned 2.8A consumption...that value will change somewhat as things heat up. Also, its not the best practice to build projects that will make the Voltage regulated wallworts a good run for the money. They are often designed for 50-70% capacity and the internal heatsinks may be too poorly suited for 100% capacity. They seem to burn out in this sense easily. I dunno about laptop power supplies though...so YMMV. Round it up to 3A to give some overhead. 

if I was building this I'd have everything tied to a active cooling heatsink like this, since your input voltage is so conveniently 12V

_image removed, its more confusing than it gives me credit for_ But that's just me


----------



## Carbon2010 (Dec 6, 2009)

Thaanks this makes things a lot more clear. But each led draw 700ma yes. But in total it draws 2.8a. Don't I have to worry about the total amps and not what one or two in series require?


----------



## Illum (Dec 6, 2009)

Carbon2010 said:


> Thaanks this makes things a lot more clear. But each led draw 700ma yes. But in total it draws 2.8a. Don't I have to worry about the total amps and not what one or two in series require?



700ma is what will pass through a string of LEDs in series, each LED will see the same current, but their voltage will add up, hence 3.5x2

4 strings of 2 will pull 700x4 = 2.8A, each string will consume 3.5x2x4 = 28V but thats distributed among 4 LM317s.

If your doing this without any additional add-ons, like fans, you will never hit 3.33A draw unless there's a short or something is overheating. You should have no issues at this point as long as the LEDs are receiving 700ma to begin with. 800ma there might be an issue.


----------



## Carbon2010 (Dec 7, 2009)

Wait you drew that I would need a voltage regulator for every current regulator...I can't just use one? I won't be using any caps either. Are you able to show me the diagram without caps and only one lm338 as a voltage regulator (if possible)


----------



## Illum (Dec 7, 2009)

Carbon2010 said:


> Wait you drew that I would need a voltage regulator for every current regulator...I can't just use one? I won't be using any caps either. Are you able to show me the diagram without caps and only one lm338 as a voltage regulator (if possible)



Honestly, I have no idea how you can tie all four LM338s under one LM317
I've never done it before, nor do I have the materials to do my own testing before I show you the results.

I've drawn that diagram as a hypothetical drawing consisting of four separate channels. I've only built one channel [Voltage regulator + Current regulator] and it appears to work. I haven't a clue what might happen in 4 seperate channels, let alone 4-in-1 channels


----------



## Carbon2010 (Dec 7, 2009)

well i soldered everything up now i'll go pick up the two resistors for voltage tomorrow afternoon. I just ended up using 4 lm 317....boy is everything crammed!

I'll keep you updated.


----------



## Illum (Dec 8, 2009)

> Well i tryed hooking it up tonight and am getting crazy results... will start outputting 1A then drop to around 550mA all while maintaining 8.4V....I'm completely lost.


:shrug:

I'm not completely sure whether this is the cause of not using caps or not...

assuming your using only one channel [1 LM317 before 1 LM338]

8.4V measured at the voltage regulator or at the current regulator?

if 8.4V is measured after the 338 which is piggybacked on the 317 it would mean that 

source voltage (12) - 317 voltage regulation drop (~1.5) - 338 current regulation voltage drop (2) = ~8.5V 

is correct...but something alone the lines of the 317 equations is wrong

LED voltage = 3.5V at 700ma, 2 LEDs in series = 7V
I must have assumed the 317 also dropped 2V instead of 1.5 

1.4V extra would somehow mean that either the 338 is dropping only 0.6V, I factored in 317's voltage drop when I didn't have to...or a combination of both. :thinking:

_I prefer to use potentiometers instead of fixed resistors for projects like this...because while the equation is constant, the nature of applications is different. For each trial an error I'll need to acquire a different resistor...and for each resistor [assuming 1/4W] I buy a minimum order of 100, which equates to $0.15 [Radioshack sells 1/4W resistors at 5count for $1, ONE WHOLE DOLLAR, your paying for packaging]. Should I need to make 10 trial and errors, my inventory closet will resemble a ammo locker. Potentiometers, especially 500 ohm linear tapers are awesome because you get to tweak everything by hand until you get what you want, then measure the resistance of the pot using a DMM. All hands on, no math or theory 
I have a couple potentiometers on hand for stuff like this, it'll take awhile to find them, but according to inventory I should have 100 ohm trim, 100 ohm linear taper 250 ohm trim, 500ohm linear taper 5K linear taper, 10K linear tapers, etc...readily available. Only thing on my desk is the 100 linear and the 500 linear 
_ 
Assuming this is measured on the LEDs a quick fix might be rolling back the voltage preset on the 317 back by 1.4V, which will have to recalc vout = 7.6V max. 

R1 set to 200 ohm, R2 remain at 1000 ohm should give you 7.5V, its preferred to underdrive LEDs than overdrive them.

1A dropping to 550ma on the LED chain? tells me that something went wrong in the calculation of the current limiting resistor and a possible undersized heatsink thats causing it to scale back on output. Its a thermal limiting feature for LM117/317s to cut back on output when it gets too hot. 

Initial surge of 1A bothers me...I've never seen this happen but then again I never needed to power something at 700ma:candle:


----------



## Carbon2010 (Dec 8, 2009)

Ill try hooking things up raw witht he new resistors (200 / 1k) And see what that puts me at for voltage and current.


----------



## Illum (Dec 8, 2009)

Kinda have to mess with it until it comes out the way you want it.:shrug:

I remember getting some crazy number for resistance once I had to buy 3 different resistors and solder them in parallel to get that value.
I've once considered building a couple 12 position rotary switches where each pin would be one resistor value above the first...just so when I use them as "potentiometers" I'll be building parts with readily available resistor values, not "half-way" values that I can neither source nor buy at limited quantities


----------



## Illum (Dec 9, 2009)

I see where your problem is...
for a voltage divider to work, the adjust pin must be connected to two places: vout and Gnd by two resistors, what you have here [in red] is two resistors both feeding into Vout, one of those resistors needs to tie to ground for normal operation.

Both of your red resistors are in the wrong place. Note the diagram that while adj is connected to both Vout and Ground, Vout flows freely without any resistance. Where you've placed R1 directly inhibits Vout's flow, thereby placing a "current regulator" on top of a "suppressed current regulator" and getting bad readouts.

R1 should be placed on the adj pin before being tied to Vout, adj pin also tied to another resistor, R2, connected to the ground.

I've added the schematic on the correct wiring to your diagram [see abive, lower left corner]

It seems counter intuitive to tie adj to ground because it looks like a short, it isn't...the resistor between adj and ground acts as a sensing load that tells the IC how much power to allow through.


----------



## Illum (Dec 11, 2009)

Has the driver worked out?


----------



## Carbon2010 (Dec 13, 2009)

still with this new setup im getting 1amp to start. then the lm338 heats up to 53*C and the current drops to .44amps. the voltage is also high(10.9V) but once the regulator heats up, it drops to a nice 7.01V thats perfect to run everything. now heres the kicker...If i blow on the regulator to cool it down, it increases everything to what it was at the start. but the regulator will only heat up if i'm checking the current? I think i have something wired wrong...

So what would I have to pay you to build me this board setup


----------



## Illum (Dec 13, 2009)

Carbon2010 said:


> still with this new setup im getting 1amp to start. then the lm338 heats up to 53*C and the current drops to .44amps. the voltage is also high(10.9V) but once the regulator heats up, it drops to a nice 7.01V thats perfect to run everything. now heres the kicker...If i blow on the regulator to cool it down, it increases everything to what it was at the start. but the regulator will only heat up if i'm checking the current? I think i have something wired wrong...
> 
> So what would I have to pay you to build me this board setup



they are thermally limiting themselves, so unless they are heatsinked properly the current output will drop in a negative slope.

The regulator will only heat up when there is a load applied, I'm assuming your measuring current without a resistor or LEDs...what you are effectively doing is shorting your current regulator to see if it would work...and it gives you exactly what you want: "all the power it can provide"

I've been trying to get this exact circuit to work with two LM317s [1 TO-220, set to 50ma] consuming voltage set to 3.3V from an LM317LZ [Vf = 5V, Imax = 100ma]...and a week later its currently a wreck, I cannot get the measurements within 20% of what I want it. I no longer feel confident enough to provide solutions to help you on this setup... 

As far as I can figure...current regulation goes _before _voltage regulation

I would, however, recommend buying a couple Luxdrive 700ma Buckpucks, wire 2-3LEDs to one...then be done with it:shrug:


----------



## Carbon2010 (Dec 14, 2009)

Arg...So much time and effort lost...

I guess i'll grab two of these:
http://www.ledsupply.com/03021-d-i-700.php

Can I wire them both off the same power supply i'm using (12v 3.33A DC Labtop charger) And how many led's can I run?

4 leds in series is 14V at 700mA...Now it comes to a point where I buy a third buckpuck and run 3 LEDS of each (10.5V at700mA) or get a new charger and run it at 14V at 700mA




Or do i have this all confused and need 28V (14V for each buckpuck)


Also I was going to get the non-wired version so i can throw it on my pcb. Can I also purchase a general 1k pot and use it as a dimmer between the control and rel pin?


----------



## Illum (Dec 14, 2009)

Carbon2010 said:


> Arg...So much time and effort lost...



your not the only one in this matter, perhaps go back to where you only had one LM338 and try and work out the function. 

What I am profoundly surprised about was the fact that there's no one else willing to help


----------



## Carbon2010 (Dec 15, 2009)

Think i'll just cut my losses and grab a buckpuck.

Which would I need I posted a setup around two posts up.?


----------



## Illum (Dec 15, 2009)

If I was cutting losses I'd get a new PCB, unsolder the LM317s and LM338s and start over. I'm not sure how you prototype but when I am I do not trim the legs of components so short that they end where the solder meets the board, this allows me to break down a PC board, extract all the components, then reassemble in a likewise fashion. Only when the design is ideal do I actually trim to fit, breadboard would be nice, but I'm too cheap and have PC boards soldered over and over until they resemble a solder "plane" :sick2:

To power 8 XREs at 700ma would mean you'll be dropping 3.5V in pairs of 4, totaling to 28V...to do this with the buckpuck you'll need to acquire one puck for every 2 CREEs at 12Vin, which will cost you a minimum of $60 in drivers alone, and you will need a couple input caps to keep the harmonics down since this is power fed by a switching power supply.

Come to think of it, your power supply is 12V 3.3A yes? In your particular scenario...Buying buck-pucks probably will cost more than buying a boost-puck, as well as narrowing your options down to two types, as compared to the six type breakdown of buckpucks. However, Boostpucks only come in 350ma versions. :thinking:

Boostpucks, 
8 XREs at 350ma
3.3V x 8 = 26.4V at 350ma 
Efficiency = 92% [Vin = 12V]

so...a preliminary calculation of input current would come out as...:thinking:


```
Efficiency  = Output  /  Input
Input       = Output /   Efficiency
(Vin x Iin) = (Vout x Iout)/E
(12 x Iin)  = (26.4 x 0.35)/0.92
(12 x Iin)  = 10.043478
Iin = 0.8369A
```
If this calculation was to hold true, you could drive 8 XREs at 350ma from a 12V 1 amp power supply. 

But given that you want 700ma to the LEDs, this option has no merit in the plan. 

Buckpucks, 
8 XREs at 700ma, parted out to 2 XREs per puck
3.5V x 2 = 7V at 700ma
Efficiency = 92% at 12V


```
Efficiency  = Output  /  Input
Input       = Output /   Efficiency
(Vin x Iin) = (Vout x Iout)/E
(12 x Iin)  = (7 x 0.7)/0.92
(12 x Iin)  = 5.326
Iin = 0.4438A
```
If you were to use 4 buckpucks to drive a total of 8 XREs at 700ma, you will be drawing a total of 0.4438 x 4 = 1.7752, roughly 1.8A from your power supply. 

Its not cheap, but considering the efficiency and the fact that no heatsinking is necessary...it really depends on your budget


----------



## Carbon2010 (Dec 15, 2009)

Could I not just drive all 8 off a single puck? Something like 30v and 1amp supply? Or 4 off one puck? They say there able to run 5 3watt LEDs and good for 32v


----------



## Illum (Dec 15, 2009)

Carbon2010 said:


> Could I not just drive all 8 off a single puck? Something like 30v and 1amp supply? Or 4 off one puck? They say there able to run 5 3watt LEDs and good for 32v



For the 700ma version you can drive up to 21V, exactly 6 CREE XREs at 3.5V each. BUT..._you did mention your using a 12V power supply to power everything, therefore I calculated it based on your input voltage [12V]_. Perhaps I should have asked. My bad :nana:

*You can drive 4 to one puck*, using the 700ma version, you'll get an input voltage minimum of (3.5 x 4 ) + 2 = 16V
Efficiency for the 700 at 16Vin is 88%


```
Efficiency  = Output  /  Input
Input       = Output /   Efficiency
(Vin x Iin) = (Vout x Iout)/E
(16 x Iin)  = (14 x 0.7)/0.88
(16 x Iin)  = 11.13636
Iin = 0.69602A
```
4 to one puck you'll need an input voltage at minimum of 16V and capable of 700ma current supply. 

_For reference, loading a Buckpuck-350 with 8 LEDs, you get an input voltage minimum of (3.3 x 8) + 2 = 28.4V
Efficiency for the 350 at 28Vin is 87%



Code:


 Efficiency  = Output  /  Input
 Input       = Output /   Efficiency
 (Vin x Iin) = (Vout x Iout)/E
 (28.5 x Iin)  = (26.4 x 0.35)/0.87
 (28.5 x Iin)  = 10.62069
 Iin = 0.37265A

You'll need at minimum 28.5Vin with a current draw of ~375ma
_ 
this also reinforces why I drive everything with 350ma. Xitaniums has the exact limitation buckpucks have:shakehead


----------



## Carbon2010 (Dec 17, 2009)

Can I drive both buckpucks off a single power supply. If one puck requires 16V can I supply then both (in parallel) with 32+ volts? This would mean there both getting there required voltage and I get to only use one plug (a necessity for me)


----------



## Carbon2010 (Dec 17, 2009)

I mean can I also just run 4 in series off my 12v supply and a single resistor? I know it's the cheeter way but will it even work? Or for how long?


----------



## Illum (Dec 17, 2009)

Carbon2010 said:


> Can I drive both buckpucks off a single power supply. If one puck requires 16V can I supply then both (in parallel) with 32+ volts? This would mean there both getting there required voltage and I get to only use one plug (a necessity for me)



you can drive both buckpucks off a single supply in the sense that your forward biasing 16V total and paralleling the two to one supply, I don't know of a procedure that allows you to run them in series. 

Since buckpucks are good for up to 32V a printer adapter yielding 30V 500ma might be a good candidate. When I state 16V, I meant the minimum requirement for it to operate, higher voltages won't kill it, just don't expect the efficiency to exceed 90%. Compared to the LDO linear regulator you were using, even 80% is amazingly efficient, as no heatsinking is necessary.



Carbon2010 said:


> I mean can I also just run 4 in series off my 12v supply and a single resistor? I know it's the cheeter way but will it even work? Or for how long?



well...it'll work but you'll need a huge heatsink, the duration of the runtime will depend on how long you are able to keep the resistors from overheating. 

And no, 4 series off 12V won't work, because CREE XREs at 700ma consume 3.5V, total voltage for a 4 series string is 14V, exceeding 12V input, you'll only be able to run 3 in series maximum for 12Vin, unless you want to underdrive then

Still, 3 in series off 12V will push a little more than 1W of heat out of the resistor, so if possible find a 2W minimum resistor to use. 

```
R = Resistance, Vin = input voltage, I = current

R = V/I
R = 12-(3.5 x 3)/ 0.7
R = 1.5/0.7
R = 2.14
Closest to that value is 2.2 ohms
```
2.2 ohms will limit the current to 682ma

Thermal dissipation is solved

```
Pd = thermal dissipation, I = current, R = resistance 

Pd = (I^2)R
Pd = (0.7^2)(2.2)
Pd = 1.078W
```
Its recommended that the wattage of the resistor be higher than the dissipated wattage, so a 2W is preferred. If you plan on mounting them to a heatsink, 10W resistors might be easier because they're square

If you can add one more XRE in the string, it would work very well, running two XREs on 12V might be a bit...a bit, _hot_.


```
R = V/I
R = 12-(3.5 x 2)/ 0.7
R = 5/0.7
R = 7.14 ohms

Closest to 7.2 is 8.2 ohms

Pd = (I^2)R
Pd = (0.7^2)(8.2)
Pd = 4.018W
```
Your going to need a minimum 5W resistor for the last string of two

Jameco.com has 5W wirewound resistors, 2 ohms [part no. 66021] and 8.2 ohms [part no. 660359] for only $0.39/each,


----------



## Carbon2010 (Dec 18, 2009)

see now here is the odd thing. I tested with some spare 7W 1.2Ohm resistors I had on hand. Hooked up 3 LEDS to a chain and when I tested the Voltage at an LED (+ probe to positive on LED and - probe on negative of led) It gave me 3.2V and around (Broke the chain and connected in series)380mA...I mean there bright enough for my application. And 7W resistors are mighty big...Just is this a safe operation? I didn't have the LEDS on heat sinks as they were not ran for more the 20 seconds but they did start to get warm. (22*C) They will be on ample heat sinks down the road though. I don't want my LED's to be blown a week down the road????

What i'm lost about is the voltage??? 3.2Vx3 =9.6V. Since im running them off a 12V supply Where are the other 2.4V gone to??? and the resistors i'm using dont add up for the amperage i'm getting? I mean it works, and there bright...but this doesn't add up for me?


----------



## Illum (Dec 18, 2009)

Carbon2010 said:


> see now here is the odd thing. I tested with some spare 7W 1.2Ohm resistors I had on hand. Hooked up 3 LEDS to a chain and when I tested the Voltage at an LED (+ probe to positive on LED and - probe on negative of led) It gave me 3.2V and around (Broke the chain and connected in series)380mA...I mean there bright enough for my application. And 7W resistors are mighty big...Just is this a safe operation?



Interesting, at 380ma you'll only dissipate 173mw out of a resistor that's capable of 7000mw, which eliminates heatsinking for the Resistor, the math didn't come out right at all, and I fail to notice whats wrong. 12V input, 9.6V string, 380ma output...theoretically your resistor should be at minimum 6.3 ohms, yet it isn't. 

Buy anyway, the LEDs will require heatsinking, but the resistors don't need it. Be advised that resistors will get warm, sometimes hot to the touch, but it won't decompose under it. 



> What i'm lost about is the voltage??? 3.2Vx3 =9.6V. Since im running them off a 12V supply Where are the other 2.4V gone to??? and the resistors i'm using dont add up for the amperage i'm getting? I mean it works, and there bright...but this doesn't add up for me?



um...its odd, I'm in the same position as you.
one of the main reasons why resistors are frowned upon for efficiency is due to the voltage drop, or the voltage consumed by the resistor as a function of current. In this case, the voltage consumed by the resistor as a function of overall voltage input is 12-9.6 = 2.4. 

Assuming your 1.2 ohm value is correct...and that your LEDs are getting 3.2V and 380ma current input...

The only way for the math to work out is if your input voltage is around 10V and not 12V, 10.056V to be exact _before factoring in _resistor tolerance of 5%

Test the power supply end with your voltmeter and see what it reads


----------



## Carbon2010 (Dec 18, 2009)

Tested the PS and its around 12.1V... This is REALLY odd. I mean I had the LEDS running for around 1min and they started to get warm, but not hot so with the heatsinking they are getting, i'm sure they will be more then good.

The 7W resistors are 1.24Ohms. They also have a 2%Tol, Good stuff. This is just Odd...But i mean i'll throw the leds with a fan on top and the meter hook up and run them for 5min checking the readings every 20 seconds or so. If nothing is fluctuating to crazy numbers will this be allright? The leds are mighty underpowered so there is some "leeway" for them.


----------



## Illum (Dec 18, 2009)

If your using resistors chances are numbers won't fluctuate that much. 

LEDs actually like being driven at 350ma, it is both most stable and the highest efficiency...CREEs are capable of 1000ma so members here tend to overdrive them. I run my indoor fixed lighting at 350ma max, 700ma for outdoors.

the math doesn't make sense...at all
The only way this would make sense, assuming your multimeter is correct, is for you to power up 3*.6* LEDs in series

Well, the math doesn't have to work for the unit to work properly, but this is way too wild


----------



## Carbon2010 (Dec 19, 2009)

Well i'm glad i'll be running them more stable. Ill do a bench test today with 3 meters (perks of working at a mechanic shop I guess) 

-one measuring voltage at the PS
-one measuring voltage at an LED
-one measuring amps in the chain of three
-I'll also check the temps of the LEDs (with a IR Thermometer) every 30 seconds.


I'll check all my results. The leds will have a fan blowing on them to keep everything cool. I think a 5min run time should give me somewhat good results. If nothing seems crazy i'll move to a 10min ... then 30min.

Keep you posted.


----------



## Carbon2010 (Dec 22, 2009)

Success!!!

I ran the LEDs for 30min straight. I used a 120mm Computer fan I had kicking around propped up on two tissue boxes (high tech) There were 3 LEDS running in series putting out 455ish mA. There was no heatsink on the back of the LEDs but the fan was directly blowing on them. 

Results for 30min:

Amps: 455-456mA
Voltage: 3.26V
Heat: 24-28*C
Voltage at PS: 12.08V Constant

I'm quite happy with the results. Does it make sense on paper though...NOT AT ALL!!! I still don't understand how this is exactly working? It's not the LM338 700mA circuit I wish worked but it does indeed do it's job? Exactly how, i'm still unsure.

Illum once I get everything hooked up expect some pictures and a little "surprise" on the inside of the light fixture. Thanks again for all your help. I'll keep you posted with update pictures of my process

Now to my soldering station!


----------

