Help required for Linear Power Supply build using LM317 - Page 1
Forum section: electronics / beginners

author: MrOmnos
author_rank: Frequent Contributor
timestamp: November 12, 2015, 09:53:02 pm
content: Hi! I have been trying to build a liner power supply using LM317 voltage regulator but I am stuck. I am not a pro but I am not a total newbie as well. I have built stuff before. I have worked with digital electronics, programmed microprocessors built few arduino based projects but I never tried to build a power supply because I thought it was too easy. But this project threw me on the ground, kicked me right in the face and showed me my level.I fried 4 lm317 chips with no result.Here's my schematic. All the values are also leveled on the schematic. Since, I was going to use this power supply to run a small DC fan I made so, I didn't bother to add extra caps. Just basic stuff.I am using a center tapped transformer with 12v-0-12v/1A rating. I am using the both 12v taps to get the output of total 24 volts Ac. Instead of using 4 diodes as rectifiers I am using a DS2BA60 rectifier. I am using 4700?F 50v as an input cap and a 22?F as an output cap. I also added couple of diodes so when the fan stops, the collapsing field won't destroy the regulator IC. I soldered all the components according to the schematics on a perfboard. Turned on the power, used a DMM to measure the output voltage and it was showing around 30 volts. So, the first thing I did was check all the connections. It was all fine. I measured the rectified voltage, it was around 22-23 volts. I measured the voltage with 4700?F cap and it showed 30v. How?? (shouldn't the caps be charged up to the input voltage i.e 22-23?) This 30V was appearing directly on the output. The input and output of Lm317 seemed to completely shorted. So I did a continuity test and yes, it was shorted. Then I measured the voltage between output and adjust pin and it was way higher than 1.25 volts so, at this point I figured out the IC was fried. So, I plugged in another one. It was fried too. First I thought the ICs were Chinese knock offs because I had checked my circuit 100 times and it was good. So I went out and bought couple of more ICs from a trusted supplier. I tested them on a breadboard with a 5v DC input on the same circuit as in the schematic expect for the input cap and the rectifier and they were working fine. Then I plugged one in to my power supply circuit and checked the output voltage. It was 30v. Adjusting the pot had no effect what so ever. Whatever voltage I was measuring at the input(30v) , same was appearing at the output as well. And I had fried another IC. So, now I started doubting my circuit and my soldering. I connected the same circuit on the breadboad with my last Lm317 and turned on the switch. Measured the voltage at the output, same 30v. The chip was fried. And this time, I also saw a spark in the pot in one of the leads connected to the adj. pin. But the pot is fine. I checked it afterwards. Now, can someone please tell meis happening?

author: fivefish
author_rank: Frequent Contributor
timestamp: November 12, 2015, 10:16:27 pm
content: You need to use dots on where the net connections are joined together. This is just sloppy work.. Adjusting the pot had no effect what so ever.Leg 2 of R2, connect to either side... or just connect leg 2 to ground.Measured the voltage at the output, same 30v.On your actual project, are you sure you didn't put D1 in the wrong orientation? If you put D1 backwards, you'll measure your input voltage on the output voltage of your regulator. Schematic shows correct orientation, but don't know if you inserted it backwards in the real world.I see a lack of 0.1uf caps on your PSU. Add some of the input side, and output side.Also add a 10uf across R2 to ground.

author: Fank1
author_rank: Regular Contributor
timestamp: November 12, 2015, 10:21:28 pm
content: LM317 has a minimum load current of about 5ma.Put a load resistor across the output capacitor and see if that helps.

author: Andy Watson
author_rank: Super Contributor
timestamp: November 12, 2015, 10:24:41 pm
content: The rating of the transformer will be the RMS voltage at full load. The peak value will be 1.41 times the RMS value, plus some percentage when operated off-load. If you have connected R2 as shown in your schematic then it is behaving as a resistor only, i.e. no adjustment. With R2=10K, I estimate the output would need to be 56V before regulation.

author: Gyro
author_rank: Super Contributor
timestamp: November 12, 2015, 10:28:07 pm
content: Also note that the absolute maximum rating for input-output voltage of the LM317 is 40V so if you try to adjust the output down to near 0V with minimum load you may exceed this and blow it.

author: go0fy42
author_rank: Newbie
timestamp: November 12, 2015, 10:30:34 pm
content: Also check, that you have your LM317 pins right. I blew up several of these before my brain realized, that the physical pin out is different from what the schematic suggests (Pin 1 is Adj, while the schematic may lead you to think that pin 2 is Adj)

author: Seekonk
author_rank: Super Contributor
timestamp: November 12, 2015, 10:31:00 pm
content: I would try it with a transformer set to 12V first. 24VRMS could easily get you to the 40V limit of a 317. I would never use a 317 near that voltage let alone some crap you probably from from China. That would explain destroying four the first time you power up. Of course, you may also have the pins backward.

author: AF6LJ
author_rank: Unknown
timestamp: November 12, 2015, 10:35:36 pm
content: One item of note about the LM317, they sometimes can be unstable depending on the wiring and other factors, you might want to add a .1mf ceramic cap from the input pin to ground and one from the output to ground using short leads.The LM317 like other regulator ICs contains a number of high gain transistors and it is not uncommon for the regulator to become unstable and oscillate without some bypass caps.Electrolytic caps have poor performance as high frequency bypass caps, so adding the .1s will eliminate that issue, but they must be close to the regulator chip.

author: Farley
author_rank: Regular Contributor
timestamp: November 12, 2015, 11:02:07 pm
content: If R2 is wired as shown it appears the wiper is not connected to anything. In the schematic shown, the LM317 is set to provide about 58V out. Refer to page 10 in the TI LM317 data sheet for information on setting the regulated voltage of the LM317:http://www.ti.com/lit/ds/symlink/lm317.pdfTry changing the pot to a 5K and connect the wiper (pin 2) to the pin 3 end of the pot. It's also good practice to place a resistor on the pin 1 end of R2 to set the low end of your adjustment range.

author: MrOmnos
author_rank: Frequent Contributor
timestamp: November 12, 2015, 11:59:29 pm
content: The pot is connection is correct. I made the mistake while making the schematics to post on the forum. Before I had it on a paper. Sorry for the sloppy work I have never made schematics before on a PC. My work mostely involves paper and pencils. The pins of my Lm317 are connected correctly. In fact that's the first thing I checked for when the problem arose. I have checked it a 100 times. I have already tried the following schematics before with all the extra caps but it didn't work that is why I came here. I didn't mention it because I thought I was not necessary.And yes the Diodes are also connected correctly. I even checked the circuit without the diodes and different pots. The result is same. Tell me more about the input cap. And if anyone has built one before, what circuit did you use and how well did it work with larger loads?

author: MrOmnos
author_rank: Frequent Contributor
timestamp: November 13, 2015, 12:06:45 am
content: Also I would like to know the how 23v rectified input gets to 30v when the 4700mf cap is connected?

author: AF6LJ
author_rank: Unknown
timestamp: November 13, 2015, 12:19:32 am
content: The transformer's output is 23V RMS If you look at the the output from just the rectifier on a scope. (no cap or anything else connected) you will see a series of half cycles that make up the raw DC. The filter cap charges up and stores energy which explains the higher DC voltage. It is a value that is very close to the peak AC voltage. 1.414 times the RMS value. If you place a load on that circuit it will drop some, increase the load and it will drop even more. if you were watching the DC on a scope as the load increased the DC would become less pure and you would see ripple on the DC.

author: fivefish
author_rank: Frequent Contributor
timestamp: November 13, 2015, 12:23:37 am
content: As someone already mentioned, 5K trimmer is a more appropriate value for your PSU.Is it working now after you've wired the wiper of R2?Is orientation of D1 correct on your breadboard?Barring any mistake on your prototype board/breadboard, your PSU should work.

author: KL27x
author_rank: Super Contributor
timestamp: November 13, 2015, 12:27:01 am
content: QuoteYes, as someone else previously explained, this is not a hard limit. This is the in/out differential. An LM317 doesn't have a ground pin, so the voltage input is only relative. Have seen them used with 120V supply.Anyhow, if you want to get the full rated output of the part, your Vin/out should be only 3V. Starting with 30V, you will be able to sustain only a piddly amount of current at 5V.

author: IanB
author_rank: Super Contributor
timestamp: November 13, 2015, 12:42:36 am
content: Quote from: MrOmnos on November 13, 2015, 12:06:45 am23 x 1.414 = 32.5Take 32.5 V and remove some diode drops, you will get about 30 V.The peak voltage of an AC sine wave is about 1.414 times the RMS voltage. If you rectify it and charge up a capacitor the capacitor will be charged up to the peak voltage.

author: Paul Price
author_rank: Super Contributor
timestamp: November 13, 2015, 12:53:22 am
content: Fivefish: There is no chance of wiring ambiguity with the original schematic if you have any knowledge about electronics at all. The only wires that cross are those near the bridge rectifier and not even a noob would expect these wires to be connected.Fank1: The 220 ohm from the 317 out to Adj. pin gives the required 5mA min current needed to regulate.Since >5mA must always flow through R2 to stay in regulation, there should be a resistor from pin 1 (LM317 Adj. pin) to R2 wiper to ground to limit the max resistance to approx 5.3K so that the output voltage range Adj. stays below below the input voltage minus the dropout voltage of the LM317. Allowing the output to fall out of regulation with too high a max setting of R2 allows the output voltage to become unregulated and almost reach the peak to peak rectified regulator input DC voltage =1.414 x 24V RMS =34V approx. at no load and high mains line voltage. Rotating the pot rapidly then to turn the voltage down to zero will damage the pot if C5 is present.Farley: The pot is wired correctly in both schematics presented, pin 2 is the wiper of the pot. In the second schematic, connecting R2 pin 1 to 2 clamps the max resistance presented to the LM317 even with a possible instantaneous open circuit of the wiper hitting a bad spot or dust during rotation. This is a good idea for a current bearing adjustment pot.Putting a resistor on R2 pin 1 (on either schematic) does nothing and fails to set a min. output voltage as all R2 current flows to ground through the wiper.If the circuit was regulating as expected, a rapid change from full output voltage to Min (1.2V ) output voltage would cause R2 to be damaged by an instantaneous high current caused as C5 discharges from a full charge of approx. 30V to 1.2V through the pot's wiper.If the devices you have worked in the breadboard and not in your wired circuit it can mean only one thing. You have created a short-circuit condition. The chance of getting a 317 defective part even from ebay is very unlikely. The most likely cause: mis-connecting the LM317 or reversed diode D1 or D2 or else a solder bridge else D1 or D2 or the LM317 is NFG.

author: fivefish
author_rank: Frequent Contributor
timestamp: November 13, 2015, 01:05:18 am
content: I didn't say anything about ambiguity. It's sloppy work what I said.

author: Paul Price
author_rank: Super Contributor
timestamp: November 13, 2015, 01:06:32 am
content: Fivefish: It is not sloppy work if it the schematic does the job of describing the circuit completely without ambiguity.

author: Farley
author_rank: Regular Contributor
timestamp: November 13, 2015, 01:17:34 am
content: It appears that the schematic in the first post has been updated. In the original post, the wiper of the pot was not connected.Paul Price: You are correct. Wired as it is now a resistor to ground would serve no real purpose.

author: fivefish
author_rank: Frequent Contributor
timestamp: November 13, 2015, 01:19:18 am
content: We're getting off topic. Let's just agree to disagree. Sloppy, not sloppy, tomato, potato.Different people have different standards and levels of attention to detail. A little sloppiness here and there, lack of attention to a small detail, and pretty soon someone can't even make a simple circuit like this work. Who knows what else might be missing on the actual breadboard. Maybe a missing connection or a short circuit. But hey, that's just a minor detail.

author: Paul Price
author_rank: Super Contributor
timestamp: November 13, 2015, 01:23:42 am
content: Farley: In the first schematic of the OP, the wiper is, to my eyes, clearly shown connected.The devil is always in the details, but the cause of malfunction is not in the OP's first schematic.

author: fivefish
author_rank: Frequent Contributor
timestamp: November 13, 2015, 01:27:20 am
content: OP edited post #1 and removed his original schematic and replaced it with newer schematic.Original schematic was wrong and would not adjust the voltage the way he originally drew it. (originally, Wiper R2 not connected to anything).

author: Farley
author_rank: Regular Contributor
timestamp: November 13, 2015, 01:33:21 am
content: I suppose the lesson here is to copy the original image into any replies to maintain context.

author: hibone
author_rank: Regular Contributor
timestamp: November 13, 2015, 01:36:56 am
content: If I may:- be extra careful with the metal back of the package, if any, since it is connected to a pin (whichever it was) and can cause shorts if an heat spreader is connected and touches the wrong wire- check the DMM; if battery powered, a low battery level may cause drift in the reported value.- a diode in parallel with the pot (thus in series with D2 and D1) could be inserted to protect both caps and lm317 against reverse polarisation- both R1 and R2 can be lowered. I don't remember the datasheet by heart but sometimes a value of 120 ohm is suggested (depending on circumstances) (minimum current should be 10mA IIRC)- consider inserting a resistor in series with the wiper, so that accidental shorts may be avoided.- check that diodes are working correctly- Read the manual about the maximum ratings, and internal protectionsSince you are experienced with programming, thinking of solder as a programming language (R.I.P. B.Pease ), may be of help

author: Paul Price
author_rank: Super Contributor
timestamp: November 13, 2015, 01:59:59 am
content: Hibone: A weak battery is often displayed on the display on most DVMs, but an out of accuracy reading is not the case here, the OP says if doesn't work at all.A min. current of 5mA is fine, lowering the 220 ohm to 120 would needlessly increases wasted power to achieve 10mA quiescent current, but this doesn't otherwise offer any advantage when >~5mA is sped'd for proper operation of the LM317.A diode reversed biased across the output,(across C2) not R2, would better protect against reverse connecting this PS..but again, reverse polarity protection if a good idea but is not causing the problems the OP is experiencing.I doubt there is a manual, but the LM317 Spec. sheet is definitely a good read for this project.

author: IanB
author_rank: Super Contributor
timestamp: November 13, 2015, 03:46:27 am
content: Quote from: fivefish on November 12, 2015, 10:16:27 pmThe presence of dots or otherwise at junctions is an attribute of the schematic drawing package.However, there is a well understood and standard drawing convention that lines are connected at tees where three lines meet, and lines cross without connection where two orthogonal lines cross over each other.There is nothing sloppy about using a different drawing convention than the one you are used to. It just means you need to adjust your perceptions and to understand that your way is not the only way.

author: JoeO
author_rank: Frequent Contributor
timestamp: November 13, 2015, 05:45:18 am
content: It is time to post a picture of your power supply.

author: Joule Thief
author_rank: Regular Contributor
timestamp: November 13, 2015, 05:55:25 am
content: Quote from: Farley on November 12, 2015, 11:02:07 pmYes, this ^using a potentiometer in the "rheostat mode" can lead to issues with too much current flowing thru the wiper of the component. I don't recall if you mentioned the wattage of the potentiometer you are using. The fact you saw a flash from the pot makes me suspicious this may be a contributor to your problems.

author: AF6LJ
author_rank: Unknown
timestamp: November 13, 2015, 01:50:49 pm
content: Quote from: Joule Thief on November 13, 2015, 05:55:25 amThe current in that leg of the LM317 is very small; with that said I wouldn't use any pot small than a quarter watt rating.

author: Seekonk
author_rank: Super Contributor
timestamp: November 13, 2015, 03:29:01 pm
content: Should you get this working, take a lesson from some of the linear supply manufacturers. Put a switch in to switch the secondary of the transformer to 12 04 24V This will reduce heating when operating the supply at low voltages. Manufacturers have a output voltage detector that does this automatically switching a relay. You could add this later with a LM431 and a relay.

author: MrOmnos
author_rank: Frequent Contributor
timestamp: November 17, 2015, 12:04:22 am
content: Hi guys. Sorry for no immediate updates. I was busy as the entire Indian subcontinent is going through festive season. But the good news is I have got the power supply working. It's the same circuit. I just changed the input AC voltage to 15volts. I guess the IC couldn't handle more than 30 volts even though it is rated for maximum 40 volts. So, now with the input of 15volts AC, I am getting about 22-23 volts after rectification. That's pretty close to (15*1.414). I have also added 300 ohms in series with the 10k pot to get an starting voltage of 3volts.I had to built the thing in modules. A rectifier module and the regulator module, I wanted to test it with different transformers, different rectifiers and with DC input from other supplies because I wanted to know the cause after frying 5 ICs.Regulator ModuleFrontBack*soldering skillzzz*Rectifier ModuleIf anyone is interested in the ICs, here's a pic.PS Currently I am getting the max output voltage close to Input voltage i.e 21v since I have a 10k pot. But I am thinking of limiting the output voltage to 15 volts. I have done the maths, to get around 15v of output I would need a pot of around 2.5K (calculated resistance 2420 ohms) but I have searched everywhere and It seems 2.5k pots are very rare and I couldn't find a single one. So I did the maths and found out that if I connect a 3k permanent resistance in parallel with 10K pot I will be able to get maximum resistance of about 2.3k which I guess is good enough. Theoretically It should work but I have a feeling this is not going to work. I have also calculated and plotted the graph of how the total resistance is going to change with when the pot is turned from 0-10k.How voltage is going to change when the pot is turned with 3K resistance in parallel.It looks fine to me and I think voltage should be controllable with the 10K pot. What do you think? Will I have a fair amount of control on the voltage.

author: AF6LJ
author_rank: Unknown
timestamp: November 17, 2015, 03:12:55 am
content: Good deal, not bad...

author: macboy
author_rank: Super Contributor
timestamp: November 17, 2015, 02:07:00 pm
content: Where is the heatsink?!

author: Seekonk
author_rank: Super Contributor
timestamp: November 17, 2015, 02:19:28 pm
content: When you can't find the pot you want, change the resistor on the output of the regulator.

author: rdl
author_rank: Super Contributor
timestamp: November 17, 2015, 03:04:13 pm
content: Though probably best not to wander too far below 10 mA minimum load current. LM317 from TI is specified at 3.5 typical, 10 mA max, but not all brands may work as well.

author: SharpEars
author_rank: Unknown
timestamp: November 17, 2015, 03:13:51 pm
content: And the answer everyone didn't realize for why the original circuit didn't work:The LM317s he is using (based on the pics above) are cheap Chinese fakes. Is it really surprising that they fail to work at the Max voltage rating from the spec sheet. I am more surprised that you got them to work at all.So, the lesson learned here is not to just look at the circuit presented, but at the authenticity and operability of the parts used.

author: fcb
author_rank: Super Contributor
timestamp: November 17, 2015, 03:40:47 pm
content: Suggest you prove your circuit works using the 0-12V tapping at this stage, before you go the whole hog to 24VAC input (which is getting close to the Vmax of your 317T).

author: KL27x
author_rank: Super Contributor
timestamp: November 17, 2015, 07:31:14 pm
content: Quote+1 But he will find that out for himself.With 22V in, you won't be able to sustain more than a trickle at 3V out. For every watt you draw at 3V, the regulator will have to dissipate 6x that much as heat.The T0-220 package LM7805 that is inside my 20V PSU (simply to run the panel meter!) can't even do its job without help. Well, to be fair, it worked for a couple years before I had to tweak it with a series resistor between the input pin and the 20V rail.I've another project where the only standby draw is a single micro and one LED. At 20V in, a Dpak 7805 cannot reliably supply the 5V out, longterm, without help. Again, it worked for a year or two before it started to fail. Series resistor to the rescue, once again.

author: MrOmnos
author_rank: Frequent Contributor
timestamp: November 17, 2015, 07:58:49 pm
content: Quote from: SharpEars on November 17, 2015, 03:13:51 pmYes, they are all fakes. I did some extensive research, read some reviews of similar looking products on amazon and turns out people have had similar problems. I can't imagine a company like ST is letting these Chinese thugs rip off their name like this.

author: MrOmnos
author_rank: Frequent Contributor
timestamp: November 17, 2015, 08:23:09 pm
content: Quote from: macboy on November 17, 2015, 02:07:00 pmI have it but I haven't screwed it on yet, because I won't be using this power supply for anything useful. I was planing to use it to run the fume extractor fan which I had assembled for my bench, but I won't be using it now. The Ic's are fake and I doubt it is going to last. This project has become more of a test project for me. And I have gained a lot of experience from this single project.Conclusion : If you need a power supply with an output of 12 volts/1 Amps, go get yourself one of those wireless router DC adapters and save your precious time.