So far in this website we have studied LM317 based linear power supply circuits, here I have explained 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 I have explained 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
Another Feedback from a Dedicated Follower of this Blog, Mr. Prashanth Suvarna
As a dedicated follower of your work, I would like to share some observations related to the previous discussion.
I needed a balanced ±24V power supply for an output transformer (OPT) stage that only needed ±24V, not the 39V given by the original amplifier. I modified your basic circuit design to incorporate a negative switcher. One of the driver ICs is variable, which allows for accurate voltage balance.
One major advantage of this method is the substantial reduction in heat dissipation when compared to a similar circuit working in linear mode. The smaller Darlingtons (122/127) first concerned me because of their failures. They failed even without overheating. To remedy this issue, I replaced them with (TIP)143/147, which functioned excellently.
Please find the attached pictures below, which were taken while analyzing the design.










Comments
Since 50uF capacitors and 240R resistors are not available in shops, can we use 47uF capacitors and 270R resistors
Yes, no issues, you can use them…those values are not too critical.
This is the high voltage regulator called maida regulator, it can up to 170v input
https://www.homemade-circuits.com/wp-content/uploads/2024/07/high-vooltage-LM317-regulator-circuit.jpg
Thank you, it looks good, but I am not sure how this can be converted into a buck converter using an inductor.
Please can the above lm317 buck converter be modified like this to take in high input voltage and regulate to produce current up to 10amps with corresponding input power. Thanks Mr Swagatam
Hi Daniel,
10 amps may be possible by modifying R1, Q1, L1, but voltage cannot exceed above 60V.
please for 12v battery, which value should I set the charging for optimal efficiency with 60v input
You can use 14V max.
Thanks sir, please between using appropriate specs of voltage and current for a charger and converting excess voltage using buck converter, which is more effective and efficient for charging
That depends on your power supply source, if you have the exact spec then that is ideally suitable, but if you power supply does not match the battery spec, and has higher voltage and lower current, then using buck converter becomes a necessity.
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.
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.
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!
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…
GE Sir, regarding available of the door in Q, I wish to point out that you can use a more easily available BA159 as it works perfectly well and is commonly used in many TV,s.
Thank you Prashanth,
I appreciate your images and your feedback very much, and I have already posted them in the above article.
Please check this link, at the bottom of the article you can find all your images published with the required details:
https://www.homemade-circuits.com/lm317-variable-switch-mode-power-supply/
And none of your comments have disappeared, they might be temporarily not visible to you due to cache…
Hello there! I’m sorry, but I remember sending a reply to u but I presume a it may have disappeared.As req I hv sent the snaps for your perusal and hope it clarifies many of the issues raised by some of your readers. I want your observations on the waveforms esp the some waves and the awful amount of noise at the transistor collector. But most of the noise has instead come down dramatically at the Lm317 opt due to its noise filters. BTW AAS fast as poss was supposed an abbreviation for AFAP (like ASAP) for as far as possible. thnx for pointing it out. This is because I prefer to use glide typing as is quick and convenient, by we should always approve matter b4 posting. Of traders wish to clarify anything in cnnx with my variation on the above circuit. they could get in touch with me by raising any issues as I will be glad to help.Thank you.My mail id is prashanth58in@gmail.com
Sorry boss 4 being out of touch 4 such a long time. Uc I 4got the original link 2 reply 2u. That should have been only far/fast as poss (As applicable) The word creepy in as I usually use glide typing which throws up errors sometimes whic we are supposed 2 lookout 4 B4 opposing which I overlooked Sorry abt that. Btw I hope you will highlight the photos that you have observed on these columns as it will be of significant interest to concerned members of your coloum due to its offbeat application.I appreciate any comments or Q on the above and will be glad to be of any help on the same. Thank you.
Thank you Prasantha, for your kind feedback,
yes, understanding the text abbreviations or SMS language takes more effort…
I have added the photos which you sent me in my email.
I appreciate your observations and the experiments conducted on the above concept…
Many thanks…
Thank You Prasanth,
I have seen the images you sent in my email, the results look very nice indeed!
In your previous comment you mentioned “AAS fast as poss ex”….can you please tell me what it means?
Fine boss! I hv uploaded my observations as directed into your E-Mail homemadecircuits@gmail.com
Good evening Prashanth! Thank you for your kind concerns!
Yes, unfortunately there’s no facility to upload images in this commenting platform.
But no worries, you can send them to my following email ID, I will check them out:
homemadecircuits
@gmail.com
GdEvng Sir! Happy to hear your appreciation on my comments on the above. Now it was ONLY agree submition of my text that I realised that there was no option/provision for submitting photos, graphs etc as I could not locate the same. Pz guide me on the same Asap or send me your Em.I will post them imm. Thank you.
Thanks so much Prashanth, for the interesting facts about this design, it is greatly appreciated!
I hope the readers will find this information very helpful while designing an LM317 IC based step-down switching regulator circuit.
Please let me how I can access the pictures that you have submitted…many thanks.
As a committed fan of your posts, I wish to add some of my observations to the above. I needed a balanced+-24-0-24 for powering a Opt stage that req only+24-24 instead of the 39 v that the unit was supplying to the original amp.I have used your basic circuit AAS fast as poss ex that I took it a step further and used it to make a negative switcher as well with one of the driver Ic,s being variable in order to realise a perfectly balanced voltage. Points worth mentioning is the dramatic reduction in the amount of heat dissipation compared to the same ckt working in the linear mode. The smaller Darlingtons122/127 made me quite apprehensive due to its failures twice even without heating, so they were imm changed to(Tip)143/147 which matched wonderfully.Ihave submitted the photos made at the time for your and the readers consideration.
Dear sir, Thanks a lot for ur kind reply.
Hi M. Ahsan, you can try FR107 or BA159 diode for D1.
hi Swagatam!
I’m having problem to getting exact value of diode in cct. kindly plz suggest me any other value of diode.
Will a pc817 work for the photo couple or do I need to make one with the photo resistor?
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…