A question about power supplies based on LM317. - Page 1
Forum section: electronics / beginners

author: Asim
author_rank: Regular Contributor
timestamp: June 15, 2013, 04:43:43 pm
content: Hi everyoneI am planning on building a power supply based on LM317. I will use a standard Laptop Adapter that its output is 19V , 4.74A asthe input of the circuit and the output of the circuit should be 5V -15V. I will use this power supply to power up my other small projects.my concern is:1- Is it fine to use this adapter ?2- Is it safe ?This is the circuit i am going to build.thanks.

author: Jebnor
author_rank: Regular Contributor
timestamp: June 15, 2013, 04:52:58 pm
content: Yup this will work. The only thing I would warn about watching the input current. With near 5A available you can easily release the magic blue smoke from your LM317.I'm still a rookie, but that is the first thing that comes to mind.

author: Mr Smiley
author_rank: Frequent Contributor
timestamp: June 15, 2013, 06:42:05 pm
content: 5v 1Amp output = 14 watts dissipated in 317 = magic smoke without a decent heatsink

author: mariush
author_rank: Super Contributor
timestamp: June 15, 2013, 07:02:08 pm
content: The only problem you have is that with linear regulators, the difference in voltage gets dissipated as heat.Therefore, if you feed 19v and you want 5v at 1A, then you're wasting (19v - 5v ) x 1A = 14 watts as heat.The LM317 and most linear regulators have a maximum power dissipation of about 15 watts so you'd need a very big heatsink to keep the linear regulator cool.You want to keep the voltage difference as low as possible, but at the same time it has to be at least 2v difference due to how the linear regulator is made.My advice is to forget about the laptop adapter and search for an old computer power supply that gives 12v, or look for a 12v monitor power supply - a lot of new monitors have an outside power brick rated for 12v 3-5a and you can find lots of these on eBay or Amazon, for example :http://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=12v+monitor+power+supply&rh=i%3Aaps%2Ck%3A12v+monitor+power+supplyAlternatively, get one of those adjustable power supplies, like this one:http://www.amazon.co.uk/1000ma-Regulated-Ac-Multivoltage-Adaptor/dp/B003IUW7O6/ref=pd_sim_ce_2and set the voltage to at least 2v above what your linear regulator needs to output ... if you want 5v out, set the adapter to 7.5v - you're limited with something like this to about 10v.There are also 7.5v and 9v power adapters, if you search eBay or some hardware shops in your country you may find these with super cheap old switches and network hubs. They usually are rated for at least 1A compared to the above adjustable adapters (which usually can only do 0.3-0.5A) and they might be actually cheaper. But these fixed 7.5v and 9v would obviously limit your output to 5-7v.

author: Muhammad Nasar
author_rank: Contributor
timestamp: June 15, 2013, 07:35:07 pm
content: One thing to also watch out for are mains non-isolated (Grounded) laptop adapters, it would be great that the power supply you built should be mains isolated, which would result in safe probing of your test circuit powered by that power supply.So using a mains isolated laptop adapter (having its input ground pin not connected to common of DC out) would be an important thing that you should consider.

author: Asim
author_rank: Regular Contributor
timestamp: June 15, 2013, 07:52:07 pm
content: @mariush: yea, i am going to use a large heat sink to keep the voltage regulator cool in worst cases . I need the 19V adapter because I want my power supply to go up to 15 V.@ Muhammad Nasar: I will consider that.thanks guys.

author: mariush
author_rank: Super Contributor
timestamp: June 15, 2013, 08:25:54 pm
content: 14 watts of heat is not easy to dissipate even with a large heatsink. You may need to add a fan to blow over the heatsink making it noisy.Consider going for a regular transformer then, with two secondary windings or with a center tap.For example, get a 18v AC 30-50VA transformer with center tap, so you'll have 9V AC and 18v AC... should be about 10-15$ plus shipping.By switching between 9v AC and 18v AC, you will have after the bridge rectifier about 10-20v (9v AC x1.41 = 12.5v, -2v loss in bridge rectifier = 10v).This way, at 5v output you'll only waste 5w as heat and you'll only need a smaller heatsink.

author: KarlMonster
author_rank: Contributor
timestamp: June 15, 2013, 08:37:26 pm
content: Alternatively, it would be a small issue to add a resistor at the Vin. For example, a potentiometer of appropriate wattage to start with, which could be replaced with specific value resistors later.The idea behind this addition is to dissipate some of the excess wattage outside of the LM 317.At least, I don't see why all 14 volts needs to be dissipated at the Reg.

author: Unknown
author_rank: Unknown
timestamp: June 15, 2013, 09:28:51 pm
content: My concern would also be, the AC non-isolation from the switched output; return mains wiring between equipments might be an issue ? depending on the PSU design.

author: Asim
author_rank: Regular Contributor
timestamp: June 15, 2013, 10:06:05 pm
content: mariush, I will use a transformer and a bridge rectifier in another project related to my university, i want to use adapters to keep the circuit as small as possible. your idea opened my mind on using two adapters, the 19V adapter will be used for the 15-12V output. and another 12V adapter for the 9-5V. my final concern is about the dissipation, how large should the heat sink be if the regulator is dissipating 10 Watts.

author: codeboy2k
author_rank: Super Contributor
timestamp: June 15, 2013, 11:04:59 pm
content: If you just want to plug it in and go, i.e. want to power your PSU from an unmodified laptop PSU, then as others have said you will have a lot of trouble with dissipating all that wasted power.If you are willing to tear up that laptop PSU and put it all together inside a new enclosure (I did it this way once before) then you have more options.In the past I've hacked up the output side of a similar 19V 5A laptop PSU. I modified the feedback resistors with a FET and a different resistor string being switched in, to lower the output voltage. So it became a pre-regulator capable of two output voltages. 19V and approx 9V. A comparator on the output of the PSU with hysteresis switched the pre-regulator to one or the other voltage. At 7V output and below it would switch to the 9V output of the laptop PSU. Above 7V it would switch to the 19V mode. Not all switchmode regulators will work outside their design specs, so this may not work for everyone.see attached schematic, sortof like this.. this is not the exact circuit I used, I don't have that anymore because I just scribbled the hack on a scrap paper at the time. I did this schematic today to show the concept.

author: mariush
author_rank: Super Contributor
timestamp: June 15, 2013, 11:22:56 pm
content: QuoteYou'll have to look in the datasheets for that.Ex for LM317 made by TI (datasheet is for both LM117 and LM317):http://www.ti.com/lit/ds/symlink/lm117.pdfGoing to assume you're going to use TO-220 or something similar because that's easiest to heatsink:Page 2: LM317A, LM317-N NDE TO-220 1.5APage 5: LM317A and LM317-N Electrical Characteristics(1)Footprint :IMAX = 1.5A for the NDS (TO-3), NDE (TO-220), and KTT (TO-263) packages.Device power dissipation (PD) is limited by ambient temperature (TA), device maximum junction temperature (TJ), and package thermal resistance (?JA).The maximum allowable power dissipation at any temperature is :PD(MAX) = ((TJ(MAX) - TA)/?JA).All Min. and Max. limits are ensured to TI's Average Outgoing Quality Level (AOQL).On next page, you have :Thermal Resistance, ?JC KTT (TO-263) Package - Junction-to-Case : NDE (TO-220) Package = 4°C/WThermal Resistance, ?JA KTT Junction-to-Ambient (No Heat Sink) : NDE (TO-220) Package = 50°C/WPage 5 has aHeatsink Requirementssection, read that.Basically, the maximum temperature inside the chip can be 125 degrees C. So you have to make sure that with the heatsink keeps the internal temperature of the chip below 125c.So you have to determine how big of a heatsink you have to use so that the temperature difference.At12v @ 1A, your linear regulator will dissipatePD = ((VIN ? VOUT) × IL) + (VIN × IG)VIN x IG can be ignored... soPD = (19v-12v) x 1A = 7 watts.the maximum allowable temperature rise,TR(MAX): = TJ(MAX) - TA(MAX)where TJ(MAX) is the maximum allowable junction temperature (125°C for the LM317A/LM317-N), and TA(MAX) is the maximum ambient temperature which will be encountered in theapplication... let's say 30°C.SoTR(MAX): = TJ(MAX) - TA(MAX)-> TR (max) = 125°C - 30°C = 95°CNow you have to determine the maximum value for junction to ambient resistance :?JA = (TR(MAX) / PD)In your case, Pd is 7 watts, TR max is 95c so your?JA = 95°C/7W = 13.57 °C/WIf you go back at the top, you notice this :?JA KTT Junction-to-Ambient (No Heat Sink) : NDE (TO-220) Package 50 C/WYour 13.57 °C/W value is smaller than 50C/w so that means you need to use a heatsink, and the heatsink "size" can be determined with the formula :?HA <= (?JA - (?CH + ?JC))where?CH is the thermal resistance of the contact area between the device case and the heatsink surface - usually 0.1-0.5 C/w if you use thermal grease/silicon pads?JC is thermal resistance from the junction of the die to surface of the package case - which is the 4C/w mentioned all the way at the beginningThis means your heatsink must have at most :13.57 - (4+0.5) = 13.57 - 4.5 = 9 C/WSo now you can go on sites like Digikey or Newark/Farnell and look at heatsinks that are rated for less than 9C/W and for TO-220 or something compatiblehttp://www.digikey.com/product-search/en/fans-thermal-management/thermal-heat-sinks/1179752http://uk.farnell.com/natural-convectionOn digikey site, you have to look at the "Thermal Resistance @ Natural" column to see the heatsink's rating - natural refers to natural convection, which means heatsink is not cooled in turn by using a fan, it cools just by cold air moving through the fins and over the heatsink surface.The Farnell link is straight for natural convection heatsinksand you get to something like this:http://www.digikey.com/product-detail/en/V2006B/A10761-ND/3476155http://www.digikey.com/product-detail/en/V5629W220/AE10872-ND/3511533http://www.digikey.com/product-detail/en/V7477YC/AE10847-ND/3511479http://www.digikey.com/product-detail/en/V7477ZC/AE10846-ND/3511483http://uk.farnell.com/multicomp/mc33278/heatsink-to220-x-2-7-6-c-w/dp/1710623http://uk.farnell.com/wakefield-solutions/637-10abp/heat-sink-pcb-alum-to-220/dp/1651792http://uk.farnell.com/aavid-thermalloy/6100bg/heat-sink-to-220-202-9-c-w/dp/1213466You can get an idea of how big of a heatsink you need even for just these 7 watts of heat, by looking at length, width, height, how big the fins are (but especially on the Farnell site, check the datasheets because the pictures for each heatsink don't always match the product)You can repeat the math for the 12v down to 5v but basically it's the same heat dissipation of 7 watts so the math above should apply just the same.And again, keep in mind all the above is for 7 watts, not 10 watts like you asked. For 10 watts, you're going to need a better heatsink, with maybe 6-7C/W instead of 9C/W... so that's even larger in size.edit: sigh, this forum hates the O with line in the middle and replaces it with ? ...

author: Asim
author_rank: Regular Contributor
timestamp: June 15, 2013, 11:48:31 pm
content: Alright,Thank you so much for your help. Now I have the information I need to build this.Thanks again

author: Psi
author_rank: Super Contributor
timestamp: June 16, 2013, 12:11:45 am
content: This is unlikely to be an issue, but some laptop adapters have more than two wires and "talk" to the laptop. A few of them don't output anything unless instructed to do so over this communications channel, or just behave weird.

author: Mr Smiley
author_rank: Frequent Contributor
timestamp: June 16, 2013, 06:47:35 pm
content: On lappy psu's i've found that the outer metal contact is 0V, the inner outside metal contact is +Vcc and the centre pin ( which you would think was +Vcc ) is actually a feedback pin from the lappy to the supplyI know for sure, if this centre pin wire is broken, Dell lappys tell you your not using an official power supply and either shut down or limit what the lappy can do

author: c4757p
author_rank: Super Contributor
timestamp: June 16, 2013, 06:52:20 pm
content: Quote from: Mr Smiley on June 16, 2013, 06:47:35 pmI see Dell has gotten significantly shittier since I decided it was too shitty to bother with.

author: niflheimer
author_rank: Contributor
timestamp: June 16, 2013, 07:03:42 pm
content: Most of them use a resistor of a given value to identify the proper charger - though I did encounter one that was using a VOLATILE memory to store the product id and code. Once the backup battery was out , so was the chargerIt's the same with laptop battery bricks these days - and now they even encrypt the EEPROMs in addition to deleting them on power loss

author: mariush
author_rank: Super Contributor
timestamp: June 16, 2013, 07:24:51 pm
content: They use either an eeprom sort of IC or a resistance, to differentiate between 65w and 95-110w adapters.If the laptop is one that normally comes with a 90w+ adapter, then with the 65w adapter, the laptop will run but may not charge (because there's not enough current to guarantee charging at same time with normal operation) or may throttle down the cpu speed to keep the overall usage under 65w.So it's not really the laptop "talking" to the adapter, it's just the laptop "reading" a sort of identification for the adapter to see what kind of adapter it is.Either way, you'd still have around 60 watts to work with.

author: Paul Price
author_rank: Super Contributor
timestamp: June 18, 2013, 12:30:09 pm
content: Just replace the power supply connector, just solder on another of your liking and use this excellent power supply.

author: Strada916
author_rank: Frequent Contributor
timestamp: June 18, 2013, 02:27:29 pm
content: Also remember LM317 has a over temp shut down. Its in the data sheet.