Beginer New power supply - Page 1
Forum section: electronics / beginners

author: drew
author_rank: Newbie
timestamp: July 03, 2014, 05:09:51 am
content: I am working on a Power Supply design and would Like to get some feedback. See attachment.I am in Canada so our power line is 120v FYI. I want to add a 3 digit voltage indicator to the design.

author: mij59
author_rank: Frequent Contributor
timestamp: July 03, 2014, 05:37:48 am
content: Hi,You could search on eBay for panel meter.Are going build according to the provided schematic ?

author: drew
author_rank: Newbie
timestamp: July 03, 2014, 05:46:09 am
content: That is my design so yes that is how I plan to build it right now.

author: Asim
author_rank: Regular Contributor
timestamp: July 03, 2014, 06:02:21 am
content: I wouldn't reccomand this transformer for two reasons.1- the lm317 has a maximum input output voltage of 40v difference, and with your transformer you are on the margin ( 30 vac >>30v x 1.414=42.4 v rectified) assuming a 2 v losses through the bridge and you will be at 40.4v input . Assuming your output voltage at minimum you will be at input output difference of 39.15 v difference2- power dissipation , you will need a massive heatsink ( pd= (vin-vout)xIout)Moral of the story, don't use such a transformer unless you will use the higher voltages

author: Asim
author_rank: Regular Contributor
timestamp: July 03, 2014, 06:11:51 am
content: I should mention that there is a high voltage version of the lm317 which is lm317HV ( 60v input output voltage difference ). I recommend using this one just to be in the safe side if you are using the 30vac transformer

author: mij59
author_rank: Frequent Contributor
timestamp: July 03, 2014, 06:22:10 am
content: Quote from: drew on July 03, 2014, 05:46:09 amIf you are using the 30 Vac transformer you must use the LM317HV.The value of C1 should be 2200 uF or higher.The value of the potmeter is too high, check the data sheet.Add an parallel to C12, e.g. 4,7 uF.Add a fuse on the primary side of the transformer.

author: Wh1sper
author_rank: Regular Contributor
timestamp: July 03, 2014, 06:29:37 am
content: For which amount of Current is the used?C1 should be around 2200µF for 1A. Even more could not be bad.The Pot should be 10KI would use a backwarded diode from "out" to "in" pins of the regulator.This diode would save the regulator beeing blown when you supply an higher voltsge @the output by accident.

author: VK5RC
author_rank: Unknown
timestamp: July 03, 2014, 07:53:50 am
content: Looks a lot like my first power supply(40yrs ago) the above comments are useful, a cheap led volt meter and ammeter would be really helpful, my first supply (pretty dodgy really) had 3 switchable fuses in the output 0.1, . 0.3, and 1A fuses. Used it a lot.Build it, use it modify it. Have fun.

author: Zepnat
author_rank: Regular Contributor
timestamp: July 03, 2014, 09:11:03 am
content: For your meter I would recommend thishttp://www.aliexpress.com/item/DC-0V-100V-Led-Volt-Amp-Meter-Voltage-Meter-Current-Meter-Ampere-Panel-Meter-Voltmeter-Ammeter/1590498780.htmlSilly cheap but accurate enough, it has a current sense shunt on the back all you do is connect it inline with the - lead. Power to the meter is 3.5 - 35v I think, so you can run it off the transformer that's what I've done and it works great.

author: nuno
author_rank: Frequent Contributor
timestamp: July 03, 2014, 09:37:07 am
content: You should pick a 15-0-15V (or 12-0-12V) instead of the 30V transformer; has same function as the 30V but in the future you will be able to improve the PSU.

author: made2hack
author_rank: Frequent Contributor
timestamp: July 03, 2014, 10:15:36 am
content: Don't forget to add a Fuse to your PSU.

author: drew
author_rank: Newbie
timestamp: July 07, 2014, 12:03:39 am
content: I doubt I will go above 37v DC in my projects. So in keeping the LM317 what transformer should I use?

author: mariush
author_rank: Super Contributor
timestamp: July 07, 2014, 01:27:00 am
content: LM317 has a maximum input voltage of 40v but you really shouldn't go higher than 37-38v.When you rectify the output of a transformer using a bridge rectifier, you'll have a DC output with a peak voltage of Vac x 1.414. Depending on the current amount, there will be a voltage drop on the rectifier of about 1v - 2.2v (two times the voltage drop on one diode in the rectifier, the voltage drop varies with the current going through the diode and you have a graph in the datasheet for that rectifier).You also have to be careful when choosing a transformer because at low currents, the output of a transformer will be higher than its specified rating by 5-10% usually, but it could be much higher especially if the transformer is small (has a low VA rating).For example, if you go with a 24 Vac transformer rated for 75VA, that means that after rectification you may have as dc voltage with a peak that can be as little as 24x1.414 - 2x1.2v = ~ 31.5v and as much as ( 24v + 10% ) x 1.414 - 1v = about 35.2vThe maximum current this 75VA transformer will be able to provide can be approximated with the formula Current = 0.62 x 75VA / 24V = 1.93A, which is cool because LM317 can output a maximum of 1.5A so we know this 75VA is more than enough.Now keep in mind, after rectification you have a dc voltage that has a lot of waves, it's not smooth. You need some capacitor after the rectifier which will make sure there A MINIMUM voltage all the time feeding the linear regulator:Your input capacitor is close to useless, it's much too small. You can approximate the capacitance required using this formula : C = Current / (2 x FrequencyAC x Vripple) where FrequencyAC is your mains frequency and Vripple is how many volts you're willing to let the voltage go down from the peak voltage.With my example, after rectification there's a voltage that can have a peek at about 31.5v in the worst case, so I use that. Let's say I want the LM317 to be able to output smooth 24v DC.The LM317 needs to have the input voltage higher than the output voltage by about 1.5v -2v, depending on how much current it outputs. See page 5, figure 10 here :http://www.onsemi.com/pub_link/Collateral/LM317-D.PDFYou have there a graph... at 1.5 A that will be the maximum current I want and at about 100C (the temperature of the regulator, seems much but you'll see it can happen), the voltage drop will be about 2v.So the input voltage has to stay always 2v above the maximum output voltage I want, 24v.You can now go back and do the math. You have peak voltage of 31.5v, you want a maximum of 24v DC so you need the minimum voltage to always be 24+2 = 26v. This means your Vripple will be 31.5v - 26v = 5.5vAssuming a frequency of 60Hz (replace with 50Hz if you're in Europe or some other countries using 220-240v 50Hz) then you can approximate the capacitor with the formula I already mentioned:C = Current / ( 2 x Fac x Vripple) = 1.5A / 2 * 60 * 5.5 = 1.5/660 = 0.002272 Farads or about 2272 uF. So you need at least 2200uF to keep the voltage above 26v.What voltage rating should the capacitor be? Well, normally you would think 35v rated capacitor will be enough because the maximum calculated voltage was 31.5v but now you know that at low currents both the transformer and bridge rectifier will work better (transformer outputs more, bridge rectifier has smaller losses) so you may have over 35v at low currents, therefore you should use a 50v or 63v rated capacitor.Now you may think you're solved all the problems, but you'd be wrong.See, linear regulators output a stable voltage by throwing away the difference between the input voltage and output voltage as heat. No matter how big of a heatsink you have, there's only so much surface through which heat can move away from the linear regulator, and too much heat will either burn the regulator, or will make the regulator stop working until it cools down.Most linear regulators have some degree of thermal protection, and will stop working completely or behave erratically when they get too hot.Let's check again the LM317 datasheet from On Semi that I linked above:http://www.onsemi.com/pub_link/Collateral/LM317-D.PDFIf you go on page 2, you will see there an interesting line in that table:Maximum Output CurrentVI?VO <= 15 V, PD <= Pmax, T Package Imax = 1.5A minimum , 2.2A maximumVI?VO = 40 V, PD <= Pmax, TA = +25C, T Package Imax = 0.15 minimum , 0.4 A maximumand there's a note there at the bottom that says Pmax = 20w.This basically says that the minimum 1.5A of current output is only guaranteed if the voltage difference between input and output is smaller than 15v and if the power dissipated is less than 20w.In my example, the voltage regulator always has 26v or more at the input.If I want to output 5v and what I connect to the power supply uses 1A, this means that there's a voltage difference of 26-5 = 21v and there's a power dissipated of (26v - 5v ) x 1A = 21w. Not only is my voltage difference bigger than 15v, the power dissipated is also larger at 21w.Simply put, the linear regulator won't be able to provide 1A without overheating itself, no matter what heatsink you may use.Another example, let's say I want 15v out and 1.5A ... I have 26v at the input in worst case, so voltage difference will be 26-15= 11v (which is ok) and the power dissipated will be (26-15) x 1.5 = 16.5w. This will work, but it's very close to the maximum permitted.So how can you get around this issues, to have your power supply output anything between 1.25v and 24v DC without any issues?Well, a very common and simple solution is to use a transformer with a center tap or two secondary windings. When you want low voltage, you flip a switch and connect just one half of the secondary side of your transformer, when you want big voltage you connect both secondary windings:backup image, click on this one to view full size for example :Note that I also suggested some other improvements. The fixed resistor for example is better to be lower at around 100-120 ohm, in some situations and depending on who made the chip, 220ohm can be too high. 100-120 ohm is better. The potentiometer you listed in schematic is too big so you won't be able to fine tune the output voltage well.The output voltage is set by formula Vout = 1.25 ( 1 + R / Rfixed) or R = (V out / 1.25 - 1 ) * Rfixed so for 100ohm fixed resistor, if you want 24v DC out then the pot will be at R = (24/1.25 - 1) x 100 = 1820 ohm. Basically, if you use a 100k pot, you barely twist the knob a few degrees and you're already at maximum voltage. Use a 5k or 10k pot in worst case scenario.But let's get back to the modification.With the switch set to use just one half of the 24v AC transformer, you'll have 12v AC rectified to DC, so you'll have 12 x 1.414 - 2v (on rectifier, average) = 15v.You have the formula C = Current / 2 x Fac x Vripple which can be rewritten to Vripple = Current / 2X Facx C so for 2200uF you have Vripple = 1.5A / 2 x60x0.0022 = 1.5/0.352 = 4.26v so that means your input voltage will be between 11.75 and 15v which in turns means that your lm317 will work just fine to output between 1.25v and 11.75-2 = 9.75v. Let's round it up to 10v.Now you have 10v @ 1.5A max with switch on one winding, 24v @ 1.5A max with switch on both windings.If we want 5v @ 1A , now the regulator will only waste (15v - 5v) x 1 = 10w and the voltage difference is only 10v.

author: cellularmitosis
author_rank: Unknown
timestamp: July 09, 2014, 11:03:23 pm
content: Hi drew,One of the other reasons people are recommending a smaller value potentiometer is that the LM317 needs a minimum load in order to be stable. The most convenient thing to do is to use the resistor and potentiometer to provide enough of a load to keep the LM317 stable even when you don't have anything connected to it.You might think the load which a potentiometer presents to the LM317 would be variable. A neat trick of this circuit is that the resistance tracks the change in output voltage, so that resistor divider always draws the same number of mA through it regardless of the position of the potentiometer. Nifty!I created a quick LM317 calculator spreadsheet which shows both the voltage range as well as the quiescent current drawn by the voltage divider, so that I can quickly pick out a voltage range I need while ensuring the 317 remains stable:https://docs.google.com/spreadsheet/ccc?key=0Aps_jTQV0tKndEtNN3BURUVHVGQ2c0FFODRzdGtjNkE&usp=sharingFrom that spreadsheet, you can see that R1 really shouldn't be any higher value than about 220 (the LM317 datasheets always use 240, which is about as high as you can go while still guaranteeing the 5mA draw you need to keep it stable, worst-case).

author: cellularmitosis
author_rank: Unknown
timestamp: July 09, 2014, 11:11:46 pm
content: using something like fooplot.com is also very useful for figuring out what your choice of resistor and potentiometer "looks like":http://fooplot.com/#W3sidHlwZSI6MCwiZXEiOiIxLjI1KDEreC8yNDApIiwiY29sb3IiOiIjMDAwMDAwIn0seyJ0eXBlIjoxMDAwLCJ3aW5kb3ciOlsiMCIsIjUwMDAiLCIwIiwiMzAiXX1dReplace the 240 value in the equation with your fixed resistor, and replace the 5000 upper bound of the x axis with your potentiometer, then adjust the 30 upper bound of the y axis so you can see the entire plot.Here, we see that a 240 ohm resistor and a 4.7k pot would yield a maximum output just over 25 volts.

author: ilcaccillo
author_rank: Contributor
timestamp: December 15, 2017, 01:12:42 am
content: Mariush,thank you so much for your post and the clear and detailed explanation.

author: mc172
author_rank: Frequent Contributor
timestamp: December 15, 2017, 01:30:45 am
content: Quote from: mariush on July 07, 2014, 01:27:00 amExcellent reply.

author: Audioguru
author_rank: Super Contributor
timestamp: December 15, 2017, 03:19:36 am
content: Quote from: cellularmitosis on July 09, 2014, 11:03:23 pmNope, look again. The datasheet forthe more expensive LM117shows 240 ohms because it works with a max of 5mA minimum load current. But the datasheet shows thatthe LM317has a max of 10mA minimum load current so its max resistor between ADJ and OUT is 120 ohms.