Maker Pro
Maker Pro

LM338 Power Supply: Help with Schematic

Hi,

I was originally set on building an amp but seeing that I really don't have a true lab power supply, I thought I'd build one seeing that some pretty simple ones can be made. Now I could have gone with an LM317 but I thought I might want a little more juice for future projects. Also, it would open more doors of opportunity as I won't be limited to circuits that use <2A of current.

So for all of the projects I plan on doing, I hope to be using one of these.

Here's what I am basing it off of: http://worldtechnical.blogspot.com/2008/12/5a-power-supply-12-25v.html#comment-form

I have two questions.

1.) Does that transformer need to be 24V? (24V seems a bit overkill for what I will ever need it for.) I was hoping I could use something like a 12V transformer which will bring down the cost substantially. Is it just a drop in replacement?

2.) Can that trimpot (I am assuming its a trimmer), be replaced with a regular non-trimmer potentiometer? And does 2K5 stand for 2.5K? or is that like a dual ganged pot?

Thanks very much.

-TheLaw
 

davenn

Moderator
Hi,

I was originally set on building an amp but seeing that I really don't have a true lab power supply, I thought I'd build one seeing that some pretty simple ones can be made. Now I could have gone with an LM317 but I thought I might want a little more juice for future projects. Also, it would open more doors of opportunity as I won't be limited to circuits that use <2A of current.
So for all of the projects I plan on doing, I hope to be using one of these.
Here's what I am basing it off of: http://worldtechnical.blogspot.com/2008/12/5a-power-supply-12-25v.html#comment-form
I have two questions.

1.) Does that transformer need to be 24V? (24V seems a bit overkill for what I will ever need it for.) I was hoping I could use something like a 12V transformer which will bring down the cost substantially. Is it just a drop in replacement?

Well it depends on what max DC voltage you want out you aint gonna get 24VDC from a 12VAC secondary transformer, you mite get 10 - 12VDC max after regulation

2.) Can that trimpot (I am assuming its a trimmer), be replaced with a regular non-trimmer potentiometer? And does 2K5 stand for 2.5K? or is that like a dual ganged pot?
Thanks very much.
-TheLaw

Yes 2k5 means 2.5k Ohms its the more common way of writing it

quote from the www site...... The regulator must be electrically isolated from the angular profile for better heat conductivity ......

dunno how he figures that one out.... what a dopey statement!!!!


Dave
 
Well it depends on what max DC voltage you want out you aint gonna get 24VDC from a 12VAC secondary transformer, you mite get 10 - 12VDC max after regulation



Yes 2k5 means 2.5k Ohms its the more common way of writing it

quote from the www site...... The regulator must be electrically isolated from the angular profile for better heat conductivity ......

dunno how he figures that one out.... what a dopey statement!!!!


Dave

Thanks Dave! in the first question, I don't mean I want to get 24V out of a 12V transfomer...because that obviously isn't going to happen. What I do mean is can I simply use a 12V transformer and in turn only get a maximum of 12V output? And would I have to alter the circuit?

Thanks.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
can I simply use a 12V transformer and in turn only get a maximum of 12V output? And would I have to alter the circuit?.

12VAC is 12V RMS AC. The peak voltage is 12 * sqrt(2) = 16.97V DC

However that ignores the losses in the rectifier which can be determined from a datasheet, bit let's call it 1V. In a bridge rectifier, 2 diodes are conducting, effectively in series at any one time, so subtract 2V leaving 14.97 volts.

The LM317 requires some headroom to be able to maintain regulation. This is called the dropout voltage and the LM317 datasheet has graphs showing this over temperature and current. If we assume it will never get below freezing, and that a max current of 1A is to be required, then a figure of 2V is reasonable. This the maximum regulated current falls to 12.97 volts.

Unfortunately, this calculation does not take into account the fact that there will be ripple on the DC generated from the bridge rectifier and capacitor under load. This ripple will have to be subtracted from our maximum regulated voltage too as we can't allow it to eat into the dropout voltage. So let's aim to keep it under 1V, thus reducing our maximum voltage to (ta-da!) 12 volts DC. Use the same size capacitors (4700uF 25V) and you'll be safe in this respect.

If you really want to do this properly, you'll allow for 10% mains voltage changes, and start your calculation assuming an AC voltage of 10.8V (90% of 12V). You will also consider that to keep the filter capacitor charged, the only time you can extract power from your transformer is at the very peaks of the waveforms, and the actual current being drawn from the transformer may be substantially higher than you expect. This may cause problems, ranging from resistive losses in the transformer winding to other problems that require a little more understanding of transformers to understand. The practical upshot is that the maximum voltage is again reduced.

A 1.2 to 12V power supply is quite reasonable, and will likely be quite useful. 1A output is likewise going to be plenty for most things.

OK, so to your original question -- The schematic looks good. He attaches the bridge rectifier to the heatsink which I think is unnecessary. He also uses a TO-3 LM317. A TO-220 version (smaller package) will be quite sufficient.

(OK, yeah, he's using an LM338 which is a 5A regulator. A TO-3 version is justified, as is heatsinking the rectifier -- but we're talking LM317 :))

You will need to make one change in the circuit. The potentiometer and some other resistors in the voltage divider will need to be changed to give you the full voltage range over the range of the pot. Check out a datasheet for more information.

Also note that the LM317 requires a minimum current to maintain regulation. R1 serves this purpose (amongst other things) so be sure not to change this to anything substantially higher. Incidentally, this sets the current in the voltage divider to 10 mA, so use this to check the power dissipation for any potentiometer.

As a quick hint, replacing R2 and R3 with a 1K pot will give you a voltage range of 1.2 to 11.2 Volts. Making R2 100 ohms and R3 a 1K pot will give you a range of 2.5 to 12.5 volts.
 
Last edited:
12VAC is 12V RMS AC. The peak voltage is 12 * sqrt(2) = 16.97V DC

However that ignores the losses in the rectifier which can be determined from a datasheet, bit let's call it 1V. In a bridge rectifier, 2 diodes are conducting, effectively in series at any one time, so subtract 2V leaving 14.97 volts.

The LM317 requires some headroom to be able to maintain regulation. This is called the dropout voltage and the LM317 datasheet has graphs showing this over temperature and current. If we assume it will never get below freezing, and that a max current of 1A is to be required, then a figure of 2V is reasonable. This the maximum regulated current falls to 12.97 volts.

Unfortunately, this calculation does not take into account the fact that there will be ripple on the DC generated from the bridge rectifier and capacitor under load. This ripple will have to be subtracted from our maximum regulated voltage too as we can't allow it to eat into the dropout voltage. So let's aim to keep it under 1V, thus reducing our maximum voltage to (ta-da!) 12 volts DC. Use the same size capacitors (4700uF 25V) and you'll be safe in this respect.

If you really want to do this properly, you'll allow for 10% mains voltage changes, and start your calculation assuming an AC voltage of 10.8V (90% of 12V). You will also consider that to keep the filter capacitor charged, the only time you can extract power from your transformer is at the very peaks of the waveforms, and the actual current being drawn from the transformer may be substantially higher than you expect. This may cause problems, ranging from resistive losses in the transformer winding to other problems that require a little more understanding of transformers to understand. The practical upshot is that the maximum voltage is again reduced.

A 1.2 to 12V power supply is quite reasonable, and will likely be quite useful. 1A output is likewise going to be plenty for most things.

OK, so to your original question -- The schematic looks good. He attaches the bridge rectifier to the heatsink which I think is unnecessary. He also uses a TO-3 LM317. A TO-220 version (smaller package) will be quite sufficient.

(OK, yeah, he's using an LM338 which is a 5A regulator. A TO-3 version is justified, as is heatsinking the rectifier -- but we're talking LM317 :))

You will need to make one change in the circuit. The potentiometer and some other resistors in the voltage divider will need to be changed to give you the full voltage range over the range of the pot. Check out a datasheet for more information.

Also note that the LM317 requires a minimum current to maintain regulation. R1 serves this purpose (amongst other things) so be sure not to change this to anything substantially higher. Incidentally, this sets the current in the voltage divider to 10 mA, so use this to check the power dissipation for any potentiometer.

As a quick hint, replacing R2 and R3 with a 1K pot will give you a voltage range of 1.2 to 11.2 Volts. Making R2 100 ohms and R3 a 1K pot will give you a range of 2.5 to 12.5 volts.

Thanks Steve. I'm still debating between and LM317 and LM338. The circuits for each are quite similar but its the cost of the transformer that is killing me. $50 at least. I'm pretty sure I won't ever have a 5A application. I mean 5A is pretty big. Most simple-ish circuits will do fine on microamps, though I am being very vague.

And I thought I just might use a TO-3 pack anyway because of the metal heatsink which will allow for much better dissipation and transfer of heat than a plastic case.

One question on TO-3 packs. I only see two visable pins on the botton and I am sure that there must be three for the variable option. Is the case itself the output or something? Would that be sort of dangerous? And a metal heatsink would conduct that electricity. I am confused.

Thanks for help all.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
For a 1A power supply, the TO-220 package is fine. TO-220 has a metal tab thet is screwed to the heatsink (some devices have isolated tabs or are in a plastic package, but this is not one of them).

Yes the heatsink is metal, and yes the case of a TO-3 package is one of the terminals. You will need the appropriate mounting to ensure the heatsink is insulated (electrically) from the device. (it's not essential in all cases, but in this case I'd advise it).

Have a look at the datasheet and that will tell you which pin is connected to the case for TO-3.
 
For a 1A power supply, the TO-220 package is fine. TO-220 has a metal tab thet is screwed to the heatsink (some devices have isolated tabs or are in a plastic package, but this is not one of them).

Yes the heatsink is metal, and yes the case of a TO-3 package is one of the terminals. You will need the appropriate mounting to ensure the heatsink is insulated (electrically) from the device. (it's not essential in all cases, but in this case I'd advise it).

Have a look at the datasheet and that will tell you which pin is connected to the case for TO-3.

Thanks. I think I'll just use a TO-220. ;) And I am liking LM317 more.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
If you're doing this, it makes sense to also have a fixed 5V output too. Get a three terminal 5V regulator and attach it to the same heatsink (insulate them both).

If you work on logic circuits, 5V is a common power supply. It saves you from worrying about knocking the voltage setting.

Also you could think about a cheap panel meter to show you what voltage you have selected.

I've used these and they work fine. Note that the -ve rail of the power supply and the -ve rail of what is measured are actually common. And it's another reason to have a 5V regulator since these require 20mA or so at 5V.

If you do have a 5V regulator, remember that even though both may be rated for 1A, the total load may be limited by your transformer.
 
If you're doing this, it makes sense to also have a fixed 5V output too. Get a three terminal 5V regulator and attach it to the same heatsink (insulate them both).

If you work on logic circuits, 5V is a common power supply. It saves you from worrying about knocking the voltage setting.

Also you could think about a cheap panel meter to show you what voltage you have selected.

I've used these and they work fine. Note that the -ve rail of the power supply and the -ve rail of what is measured are actually common. And it's another reason to have a 5V regulator since these require 20mA or so at 5V.

If you do have a 5V regulator, remember that even though both may be rated for 1A, the total load may be limited by your transformer.

Well I pretty much found a design dead on to your recommendations. Yes, I do plan to do a bit with microcontrollers and other types of data related circuits.

It seems to be pretty accurate and well designed.

http://www.raijuu.net/2009/02/power/#more-25

I would probably just add heatsinks to the regulators and that's about it. I happen to have some really big (22,000uf 50V Nichicon caps), that I bought a couple of years ago. Would that be an okay replacement for the 4,700uF cap? And in general, is using higher capacitance caps better for a power supply, or does it make no difference when you hit a certain point. Also, does anyone have any feelings about using polyester/polypropylene vs ceramics for the filters.

It might cost more than batteries initially, but a good quality power supply will last for ever, so I am pretty set on this one. Solid power is pretty much the most important element of a circuit, in my opinion, so if anything, this comes first.

Thanks Steve and everyone else.
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
The capacitors you have may be physically much larger and you will either have to redesign the PCB, or connect them with flying leads. If you choose the latter, use thick wire and make the wiring as short and direct as reasonably possible to minimise both resistance and inductance.

The major problem with the high capacitance is that when you switch the circuit on, there will be a high current drawn to charge them. I'm not sure if you're at the point where this will cause a problem, but it may well necessitate a mains fuse larger than would otherwise be needed.

In the worst case, the current may be high enough (and for a long enough duration) to damage the rectifier or the transformer. You will notice that rectifiers have some impressive surge ratings -- but only for a single mains half cycle -- this is why.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Your next question (well one of them) should be "how big does my heatsink have to be"?

This video blog entry should be of some assistance.
 
Your next question (well one of them) should be "how big does my heatsink have to be"?

This video blog entry should be of some assistance.

As crazy as that guy is, he's pretty helpful. I'll give him that. Suprisngly I started watching this yesterday, but they tend to be quite lengthy and never finished it.

Thanks for the help. I don't know where I'd be without it.
 
What is meant when it says 15+15V?

And wouldn't giving the 5V reg all that excess voltage not be good?

4wire.png
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
15+15 refers to the secondary that is a 30V centre tapped winding.

That circuit goes on to show a full wave rectifier using a centre tapped transformer.

You're most likely th have:

a) a transformer with a single primary suited to your local power (so ignore what is to the left of the transformer)

b) a transformer without a centre tap so that you will use a bridge rectifier.

A full wave rectifier with a centre tapped transformer and 2 diodes was all well and good when diodes came in glass bottles full of vacuum, and cost a significant fraction of the cost of a transformer (not to mention tens of volts drop across them -- 60V at 125mA was not atypical). It's not a design that you would typically choose today.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
And wouldn't giving the 5V reg all that excess voltage not be good?

Consider that your variable supply may be regulating from a couple of volts up to (say) 12V. It is in a worse position when asked to supply less than 5V.

In any case, the power dissipated is the difference between the unregulated voltage and the regulated voltage, multiplied by the current.

For the 5V regulator, if we assume the input voltage is around 15V, at 1 A it will be supplying 5W of power and dissipating 10W.

For the variable supply, at 12V 1A it will be dissipating 3W, and at 1.2V it will be dissipating about 14W.

If the regulators were shorted out, the dissipation would rise even more.

If I were choosing a heatsink, and my transformer was rated at (say) 2A, I would use a ballpark figure of 20W as my maximum dissipation. It could be higher, but it's unlikely you'd ever be exceeding that for long (if at all). In the very worst case, the regulators will shut down if they go over temp (that's generally to be avoided, but it beats the smoke getting out)

Both regulators have a max input voltage of around 35V (check the specs) so 18 to 20V is not going to cause problems.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
As crazy as that guy is, he's pretty helpful. I'll give him that. Suprisngly I started watching this yesterday, but they tend to be quite lengthy and never finished it.

That one goes into a lot of detail. There is an earlier one where he talks about designing a dummy load (he mentions it in the opening seconds). In that one he uses more "rules of thumb" and gets a result that is usually "good enough".

Once you understand the concepts, it's not too hard. You only really need to understand the finer details if you plan on "pushing the envelope".
 
15+15 refers to the secondary that is a 30V centre tapped winding.

That circuit goes on to show a full wave rectifier using a centre tapped transformer.

You're most likely th have:

a) a transformer with a single primary suited to your local power (so ignore what is to the left of the transformer)

b) a transformer without a centre tap so that you will use a bridge rectifier.

A full wave rectifier with a centre tapped transformer and 2 diodes was all well and good when diodes came in glass bottles full of vacuum, and cost a significant fraction of the cost of a transformer (not to mention tens of volts drop across them -- 60V at 125mA was not atypical). It's not a design that you would typically choose today.

Well disregard this. I finally figured out exactly what you are saying so I just deleted everything I wrote...I am so dumb. Let me come up with a REAL response now.
 
Last edited:
So the idea would be to use a transformer that has a single output and then to use a bridge rectifier to get the center tap effect? So you are kind of faking a center tap by using a regular transformer with a bridge rectifier. I've seen it on tons of other supplies but I never understood I guess EXACTLY why they were there. And how would I get two separate 15Vs? Hell, maybe I still don't get it...

One thing regarding safety. I've been perusing the web and people keep on saying how dangerous it can be to wire a transformer and such but quite frankly, what could really go wrong? Do they thing I am going to stick a bare wire into a outlet terminal and grab it or something?

What am I missing?
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
A bridge rectifier using 2 diodes and a centre tap is effectively using only one half of the secondary winding at a time. In effect it pushes from one side on it's positive half cycle, then from the other on it's positive half cycle.

A bridge rectifier using 4 diodes enables you to use both the positive and negative half cycles.

If you were to build a double ended supply, the easiest way is to use a centre tapped transformer and bridge rectify the secondary the same as you would for a single ended supply, but use the centre tap to provide a middle rail (conventionally called 0V). The resulting rails are regulated with respect to the oV rail. Here is an example.

It's dangerous to do mains wiring because there are a lot of things that can go wrong and you don't have the experience to know what they all are and what to do to mitigate them.

For example, it is wise to ensure that your earth wire is longer than all of the other wires so that if the cable gets yanked, it is the last to separate. That way there is more chance of protection. Similarly, you should ensure that the cable is secured so it can't get yanked out. You have to ensure that there is no way people can touch the mains voltage, or that anything inside the case can short between your mains and low voltage areas. You should allow for live and neutral to be swapped without harm or danger, although you must do whatever is required to prevent that from happening (doesn't always apply in countries like the US where 2 pin plugs -- if fitted -- can be inserted either way around). In some countries it is actually illegal to do this type of wiring unless you are qualified.
 
A bridge rectifier using 2 diodes and a centre tap is effectively using only one half of the secondary winding at a time. In effect it pushes from one side on it's positive half cycle, then from the other on it's positive half cycle.

A bridge rectifier using 4 diodes enables you to use both the positive and negative half cycles.

If you were to build a double ended supply, the easiest way is to use a centre tapped transformer and bridge rectify the secondary the same as you would for a single ended supply, but use the centre tap to provide a middle rail (conventionally called 0V). The resulting rails are regulated with respect to the oV rail. Here is an example.

It's dangerous to do mains wiring because there are a lot of things that can go wrong and you don't have the experience to know what they all are and what to do to mitigate them.

For example, it is wise to ensure that your earth wire is longer than all of the other wires so that if the cable gets yanked, it is the last to separate. That way there is more chance of protection. Similarly, you should ensure that the cable is secured so it can't get yanked out. You have to ensure that there is no way people can touch the mains voltage, or that anything inside the case can short between your mains and low voltage areas. You should allow for live and neutral to be swapped without harm or danger, although you must do whatever is required to prevent that from happening (doesn't always apply in countries like the US where 2 pin plugs -- if fitted -- can be inserted either way around). In some countries it is actually illegal to do this type of wiring unless you are qualified.

Thanks. Well since its not legal, maybe I should take the hint. As you can tell, I'm not too good with the power end of it, and heaven forbid something went wrong and blew up in someones face. Though I am still not fond of buying a $300 supply that can only do 5A...

I'll continue my research. You've helped me understand power delivery a lot better and I thank you sincerely.

Thanks
 
Top