So far in this website we have studied LM317 based linear power supply circuits, here we will learn how an LM317 can be executed as a variable switch mode power or SMPS with zero loss.
LM317 as Linear Regulator
We all know that an LM317 IC is internally designed to work as a linear voltage regulator IC, which has a serious drawback of power dissipation through heating. Moreover such topology also requires the input to be minimum 3V higher than the desired output, adding further restrictions to the given regulator configuration.
Here we discuss how the same IC could be simply implemented as a 0-40V variable power supply using SMPS topology and therefore eliminating the losses mentioned in the above paragraph.
Modifying LM317 Circuit into a PWM Switching Regulator Circuit
The LM317 variable SMPS circuit explained here effortlessly converts an ordinary LM317 IC into an inductor based switching regulator power supply counterpart, as exhibited in the following diagram:
Circuit Diagram


Referring to the above shown diagram we can see that the LM317 is configured in its usual variable regulator mode but with some additional parts in the form of R6, C3, and D1.
We can also see an inductor attached with D1 and an associated power BJT Q1.
How it Works
Here the LM317 IC performs two tasks together. It varies the output voltage through the indicated pot R4, and in turn causes a PWM to initiate for the base of Q1.
Basically, the introduction of R6/C3 transforms the LM317 regulator circuit into a high frequency oscillator circuit, forcing the output of the LM317 to switch ON/OFF rapidly with a varying PWM, which is dependent on the setting of R4.
The BJT Q1 along with the inductor L1 and D1 forms a standard buck converter circuit which is controlled by the above explained PWM generated by the LM317 circuit.
This implies that while the pot R4 is varied, the voltage pulse width developed across R1 also varies proportionately causing Q1 to switch L1 in accordance with the varying PWMs.
Higher pulse widths enable the inductor to produce higher voltages and vice versa.
Capacitor C4 makes sure that the fluctuating output from L1 at the output is adequately smoothed and eliminated, this consequently enhances the ripple current into a stable DC.
In the proposed LM317 switch mode power supply circuit since the IC LM317 is not directly involved with the handling of the load current, it's restricted from dissipating current, and thus ensures an efficient regulation of the high input voltage into the desired low output voltage levels.
The design also allows the user to upgrade the circuit into a high current SMPS circuit simply by changing the Q1, L1, D1 rating as per the required output current specifications.
L1 can be built by winding bifilar enameled copper wire over any suitable ferrite core.
Although this LM317 SMPS circuit promises a near zero loss output, Q1 must be mounted on a heatsink and some degree of dissipation may be expected from it.
Interesting Feedback from one of the Avid Readers:
Mr. Swagatam:
I am a retired EE, but continue to have an interest in various areas. Happened to come across your website when I was researching power supplies using LM317.
Saw the interesting switch mode power supply schematic using the LM317.
As it turns out, the exact circuit shows up in the 1978 National Semiconductor Voltage Regulator Handbook, with additional verbiage to explain its behavior.
However, I found it even more helpful to simulate the circuit using LTSpiceVII (which is free to download and use) to get a better idea of how the circuit operates with component value changes.
Anyway, I decided to scan the two pages from the 1978 Handbook and email to you in the event you care to post them with the schematic for others who might be interested in a little more detail.
Regards,
Denton Conrad
Raleigh, NC


Complete article can be found in the following pdf link:
https://www.homemade-circuits.com/wp-content/uploads/2023/05/LM317-switching-regulator.pdf
Where is figure 10 in the latter part of the article?
It is not available with me. You may have to check the original datasheet for it.
Thanks Mr. Swagatam! Cct is working perfectly. Suggest me upgrade , how can I add more components to make it more efficient.
Thank You M.Ahsan, glad the circuit is working now.
However, I cannot suggest any upgrade except for the transistor and the coil, because rest all are designed by the manufacturer and cannot be upgraded or modified.
For the transistor and the coil you can upgrade these by increasing their current handling capacity appropriately, which will allow you to increase the output power of the circuit.
Thank u sir, for your most valuable feedbacks.
You are most welcome M. Ahsan
Sir, will flyback generated by inductor L1 make some effect for other semiconductors after switching off the power? can I add some protection? r not necessary ?
The voltage generated from L1 will be stored inside C4, so it is fine no external protection is necessary. You can increase the value of C4 to 1000uf if possible.
hi sir, today I tried to arrange this cct. I set it to 24 v input and 15 output. but the Q1 TIP36 got heated at load of 2 amp. and LM317 got burn. then I tried LM339 in place of LM317. this LM339 working perfectly without heating. but still Q1 is heating, with load.
and when I decrease the current of power supply, the output voltages drops from 15 to 9 V. .. and Input drops from 24 to 12v, with load. is it normal thing with decreasing input current? plz guide.
cct arrangement with some replacements.
a)D1– Fr107 instead of 1N3880
b)Q1– TIP 36 instead of 2N3792
c) inductor I think as it is. 600 u H
**and especially what can I do to overcome the heat of Q1?
thanks.
Regards:
M.Ahsan
Hi M.Ahsan,
The LM317 is internally protected from output over current and short circuit and over heat, so it should never burn under any circumstances unless the input voltage exceeds 40 V. Also, the TIP36 is rated to handle up to 25 amps so it should not heat up at 2 amps. I think the parts you brought might not be original.
Yes LM338 being rated at 5 amps it will be cooler than LM317.
Yes if you decrease the input current then the output voltage will drop since the load is not getting sufficient current as per its specifications.
You can supply any amount of current at the input that will not cause any harm to the IC or the transistor, but the voltage to the load must be correctly adjusted so that the load and the transistor are not over loaded.
So you just have to take care of the following things:
Input voltage should be ideally below 40 V
Input current can be any value even upto a million amps, that is irrelevant.
Output voltage to the load is crucial and must be accurately set as per the load specifications..
Output load current specifications must be in accordance with the transistor specifications…2 amp is very less for TIP36 and it should not heat up. It can heat up slightly but not too much.
Make sure the inductor wire gauge is at least 1 mm or 2 mm thick.
thank u sir for ur valuable reply.
My pleasure!
sorry sir for again, in present scenario above what should I do? should I increase the thickness of coil or decrease? for overcome heating and voltage dropping problems less then 2 amp?
You can try changing the transistor. You can perhaps try TIP2955. Yes increase the coil wire thickness to 1 mm at least.
sir, Can I use 2n3055 in place of 2N3792?
and I am having problem to getting tantalum capacitors, plz suggest the replace. Regards, M.Ahsan
M. Ahsan,
2N3055 is an NPN transistor so it cannot be replaced with 2N3792. You can try TIP2955 or TIP36.
Tanatalum capacitor is recommended, but if don’t get it, you can use other ordinary type.
thank u sir , u solve my problem.
I am glad to help!
it’s very useful. i like it. but u didn’t mention the wattage of resistors used in this cct. plz mention the wattage of resistors used in cct.
Thank you! R1 and R2 can be 1 watt rated and rest of the resistors can be 1/4 watt rated.
thanks bro for ur quick reply.
That verbiage from the National Semiconductor Voltage Regulator Handbook was not descriptive of the circuit in question, it was descriptive of the next illustration, that of a much improved version using an NPN-PNP arrangement (a 2N2905 and three LM395s with internal overload protection) in place of the PNP transistor.
Hi Swagatam
I wrote to you regarding using IN 4148 in parallel but I think I made a mistake,
I thought they are 1amp diodes but realized they are only 150 ma……. sorry about that. I can’t use them.
Thanks again for all your help Swagatam
All the best
Regards
Vee
OK will do, no problem…
Hi Swagatam
Can I use 4 or 5 IN4148 diodes in parallel as they are fast switching diodes but only rated as 1 Amp will the voltage be affected
Thanks
Vee
Hi Swagatam
Thanks for your reply regarding the diode but you didn’t tell me what I asked you about the inductor coil, please let me know about the winding .
I have a ferrite bar about 1” long and should the the layer of windings be insulated with tape between the layers of windings
Thanks Swagatam
Regards
Vee
Hi Vee, Since the wire itself is super enameled, and since the turns are for a single winding therefore insulation is not needed between layers…
Hi Swagatam
Thanks for your reply
I check the coil again, do I have to use insulation tape between the layers of the coil.
The Ferrite core bar is about 1” long with the wire around it.Is the RG2Z diode ok to use does this also matter.
I tried many places but cant get the IN 3880 diode or the equivalent, I can’t understand why.
Thanks again
Vee
Hi Vee, the diode current must be higher than the required output current. If the output requirement is 2 amps, then the diode must be rated at 4 amps and so on, otherwise the diode may heat up….
Hi Swagatam
Thanks for your reply, I did try the circuit with a load if upto 750 ma and I sent you the readings as you suggest I shall try to get thicker gauge wire and try once the situation gets better with the stores.
The only thing is what do I do about the C3 capacitor, why is cutting of the power
Anyway shall keep trying, if possible please let me know what I could do
Thanks immensely once again for all your help
Vee
No problem Vee, let’s hope you ultimately succeed with the project, but the 300 pf is crucial in the circuit since it determines the frequency of the buck oscillator….I think your coil may have problems, please confirm its value with the inductance meter and make sure it is rated at 600 uH, and everything else in the circuit is exactly same as the diagram.
Hi Swagatam
I happened to have a 330pf and tried it out but when i switch on the power comes on for a second and goes off, I don’t know why but when I remove it, the power stays on. What should I do
I further tried with a load of 1.77 amps and its fine the temperature etc
When I tried with 2.00 amp load the inductor temperature went up to 80*C and I switched off immediately, guess i have to use a thicker gauge wire.
Thanks
Vee
Hi Vee, I think a load will be required while testing the results. Yes you can try increasing the wire thickness, or try the existing circuit with smaller load, and see the results
Hi Swagatam
The diode I used was RG2Z this is the only one I had instead if the IN3880 Is this ok
Sorry to bother you again
Thanks
Vee
Hi Vee, the diode will work up to 500 mA current after that it may start heating up
Hi Swagatam
Thank you so much for your immediate reply, shall see what caps I have to match the 300 pf. Should this be exactly 300pf or anything close to it …. what value
I forgot to tell you the power supply I used is a transformerless 24.5vdc /6 A
Are the temperatures ok which I mentioned……please let me know
Thanks again
Vee
Hi Swagatam
Guess I have some good news
I tried out the SMPS circuit and it seems it worked. I shall give you the details of the parameters I observed please let me know if they are OK
Input voltage from power supply- 24.5Vdc
Output volts of SMPS on adjusting -12.54vdc
I used 12v/550ma bulb & a cooling fan 12v/ 1.05amps (Totally about 1.54Amp load)
After 10 to 15 minutes
Temperature of
MJE 2955 was 39/41*C with heat sink
LM 317 was 27/29*C with a small heatsink
Inductor coil was about 34* C
Out put was steady
Are these parameters normal and is the SMPS working the way it should
NOTE: I did not have the 300pf ceramic capacitor which is in parallel with the 15k resistor , I used one of little lesser value but the LM 317 was heating up so I did not use any.
I’d like to send you a video of the temporary setup but don’t know how to get it to you
Please let me know your opinion
Thanks for you help Swagatam
All the best to you
Vee
Hi Vee, that sounds great, and the results look impressive, however C3 may be an important part which should not be be missed, in fact it is responsible for the oscillation, so I think you must include it. If you don’t have the exact value, you can adjust the value by adding a few known capacitors in series or parallel.
Once you add the 300pF, and if you get the adjustable feature from 3V onward, with load and without heating up the devices then I will consider the experiment to be 100% successful.
Hi Swagatam
Thank you very much fir your reply, shall try out the circuit.
All the best to you
Regards
Vee
You are most welcome Vee!
Hi Swagatam
I happened to find among my stuff a 612 &655 uH inductors which I used to use for my electronic fan regulators but the wire gauge is 0.5. /0.6mm and I have a RG2Z & RG4Z diode can I use this in place of the IN 3880 diode and also the inductors I have in the switching power supply here in this article ……. I think you said I could use the MJE 2955 in place of the transistor 2N3792 and iI have a preset which reads 7.8 k
Please let me know if i can use these items to tryout the variable SMPS with the input from a 24v/6A smps
Still cant get the exact parts due to closure of all these stores.
Thanks
Vee
Hi Vee, I think you can try those parts just for testing sake…..this will let you know whether the basic circuit is working or not with a low current set up….if you find the circuit working with lower current you can afterwards change the coil with a more heavy duty one for getting higher current output
hi Swagatam!
I’m having problem to getting exact value of diode in cct. kindly plz suggest me any other value of diode.
Hi M. Ahsan, you can try FR107 or BA159 diode for D1.
Dear sir, Thanks a lot for ur kind reply.
Hi Swagatam
Thank you immensely for all you help and guidance. I shall try to get all the components that are required to build the LM 317 SMPS circuit once the shops are opened again and shall let you know how it went .
Till the next time all the best to you,bless you
Kind regards
Vee
My pleasure Vee, I wish you too all the best!
Hi Swagatam
In the manual it does not show or mention what the 36 volts max is but in the pictures on the net it shows “ Capacitance test sockets” across the two sockets where it says max 36 volts what are these sockets for, does it mean we can test capacitors with the two leads in these sockets and is this the volts of the capacitor value
Thanks
Vee
Hi Vee, I saw the picture of the LCR meter, and also saw the 36 V marking on it.
It seems the meter is suggesting not to check capacitors which may have a stored voltage of over 36V….so before testing any capacitor make sure to discharge the capacitor first, and then connect the probes to it.