before I build this LM317/337 power supply, a few questions? - Page 1
Forum section: electronics / projects

author: dentaku
author_rank: Frequent Contributor
timestamp: March 14, 2014, 07:44:47 pm
content: I'd like to build a power supply like this and I'm wondering if it looks OK? I've taken some of the advice from other posts on this forum and this is the result.It looks like it can go up to about +/- 20V (I also did some breadboard tests by building the positive side of the circuit) but I doubt I'll ever need more than +/- 18V. I probably won't ever need anything below 5V either.Questions:Are the small capacitors on the input and output of the lm317 and 337 reasonable? I know people don't use tantalums anymore like all the datasheets recommend.Can the huge caps be mounted on the back of the circuit board laying flat? This would mean that the leads will be a bit longer than normal. Is this bad?How much heatsinking is need on the regulators?Is the 3N257 any better than just using four 1N400X diodes other than the obvious space saving?I'm thinking of using rotary switches with resistors soldered directly to it like I always see on old electronics instead of R1 and R3 for coarse adjustment and a small value pots around 200ohms for fine adjustment.Does it matter if the pot goes BEFORE the rotary switch or AFTER it?

author: Unknown
author_rank: Unknown
timestamp: March 14, 2014, 11:11:01 pm
content: Quote from: dentaku on March 14, 2014, 07:44:47 pmThey're more likely to help than hurt. Remember to lay them out as close a physically possible to the regulators.edit: I misread them as 0.1uF rather than the 1uF you've chosen. Probably doesn't make much difference if they're ceramics.edit2: No, theyare0.1uF. That's an example of why you should always include the leading zero for fractional values e.g. 0.1uF, not .1uF - the decimal point was impossible to see on my phone, and is just as easy to overlook when building the circuit...Quote from: dentaku on March 14, 2014, 07:44:47 pmNot bad - but watch out for other physical issues e.g. solder joints on the board piercing the plastic insulation on the capacitors & shorting to the metal case, etc.Q: Why the 2 high value caps in parallel? Is this just what you have on hand? Otherwise you'd be better off space-wise with a single higher-value cap for each rail.Quote from: dentaku on March 14, 2014, 07:44:47 pmThe short answer is "enough". Have you ever tried doing the thermal calculations? It's not much harder than Ohm's Law, and is definitely a worthwhile skill to learn.They'll certainly need some, especially a low output voltage / higher currents, and unless you do the calculations your best bet is to make the heatsinking as big as possible. Better cooler than hotter...Quote from: dentaku on March 14, 2014, 07:44:47 pmSix of one / half-dozen of the other. 4 diodes may run cooler, if only because you're spreading the heat across 4 widely-spaced packages - but, on the other hand, it's easier to heatsink a bridge.Quote from: dentaku on March 14, 2014, 07:44:47 pmA typical switch goes open-circuit when switching between positions. What happens to your output voltage then?Hint: you'll probably want to use a make-before-break / K contact switch.Without doing the numbers, 200 ohms sounds a bit low. Think about what your highest switched resistor value needs to be, consider the available standard E-values & worse-case tolerances, double the difference, then round up to the next standard pot value. My guess is you'll end up more in the area of 500ohm - 1k.edit: Just did the numbers; 200 ohms looks OK. Remember to include the pot's centre value when selecting the resistors e.g. for 15v out you need ~1.3k between adj & gnd, less the 100ohm from the pot at mid-range, so you want a 1.2k resistor. For 5v out you want 360 ohm - (100 ohm from pot) = 260 ohms.It doesn't really matter which side of the switch you put the pot.Apart from that, it looks fine to me!

author: Unknown
author_rank: Unknown
timestamp: March 14, 2014, 11:58:52 pm
content: Quote from: tree on March 14, 2014, 11:22:14 pmHuh? That makes no sense. In either case current flows from the "high side" (adj pin), through the wiper, to ground.If wired as per the OP's circuit, it has the additional benefit of giving a measure of protection from intermittent dropouts/discontinuities/HR/noise from the pot - the output voltage can only ever go as high as that set by the overall pot value (+ resistor, in the case of his in-text suggestion). If wired as you suggest, and the pot wiper bounces or goes HR, you get (nearly) the full input voltage at the output...

author: dentaku
author_rank: Frequent Contributor
timestamp: March 15, 2014, 12:07:23 am
content: Quote from: Tac Eht Xilef on March 14, 2014, 11:11:01 pmI was actually asking if the values where reasonable, not if it was reasonable to use them at allQuote from: Tac Eht Xilef on March 14, 2014, 11:11:01 pmIt's just what I happen to have.Quote from: Tac Eht Xilef on March 14, 2014, 11:11:01 pmAh. I didn't think of that. You're right, the switch will go open between clicks.Oh well, I've found that a 2K pot gives the best results but I don't have any of that size.I like my idea (not that it's a new idea) of using a second small value pot for fine tuning since I don't have any fancy multi-turn pots.

author: dentaku
author_rank: Frequent Contributor
timestamp: March 15, 2014, 12:12:04 am
content: Quote from: Tac Eht Xilef on March 14, 2014, 11:58:52 pmYup, it's the way I've seen it in multiple examples online and I've read that it's for extra protection as you say.

author: Unknown
author_rank: Unknown
timestamp: March 15, 2014, 12:16:07 am
content: Quote from: dentaku on March 15, 2014, 12:07:23 amIt's definitely worth doing from a point of tracking too - tolerance variations between regulators & resistors can result in the 2 outputs not tracking terribly well (e.g. as an extreme case, one might be +12.3v while the other -11.7v). A little adjustment in there allows you to correct those sorts of errors.

author: mariush
author_rank: Super Contributor
timestamp: March 15, 2014, 12:23:35 am
content: Here's a page that should help you figure out what heatsinks to use:http://www.ef-uk.net/data/heatsinking.htmUse the calculator or understand the formulas at bottom of the page and use the numbers in the datasheet of the part you buy.

author: dentaku
author_rank: Frequent Contributor
timestamp: March 15, 2014, 01:35:49 am
content: I was going to use one of these classic Mallory rotary switches.http://www.ebay.com/itm/2-Mallory-3229J-Rotary-Switches-/321272191778?nma=true&si=z6lIdNEUZwQ4ogCJVIrp7c9bA%252Bo%253D&orig_cvip=true&rt=nc&_trksid=p2047675.l2557I just tested it with two LEDs and as expected, if you turn it slowly, in the space between the clicks the switch goes open and none of the LEDs are lit.Even if it WAS amake-before-breakrotary switch wouldn't that mean that I would be adding two resistances together in that tiny instant before thebreak?Hmm. I wonder if there's any way around this? The other rotary switches I have are even cruder old things.edit - later...I just looked through my bins and found a 5 position rotary switch that if I connect it to two LEDs, there's a point where both are lit if I turn it very slowly so it seems to be ashortingormake-before-breakswitch. I can even see the mechanism and they definitely are both connected at one point during the turn.But like I said, doesn't this also cause a problem with both resistances being connected together for an instant while turning the switch?I guess just using a slightly too large pot for coarse and a small one for fine will be easier.

author: dentaku
author_rank: Frequent Contributor
timestamp: March 15, 2014, 01:49:42 am
content: Quote from: mariush on March 15, 2014, 12:23:35 amLuckily I've got enough room for rather large heatsinks so I have no reason to be cheap with them

author: Unknown
author_rank: Unknown
timestamp: March 15, 2014, 03:36:39 am
content: Quote from: dentaku on March 15, 2014, 01:35:49 amThat's true, except it'll be paralleling rather than adding (so the value of your adj-gnd resistor will momentarily decrease). The result is a dip in output V as you change ranges - which is preferable to the output V spiking upwards to the supply rail.Quote from: dentaku on March 15, 2014, 01:35:49 amThat's what I'd do.Oh, and while you're still thinking your design through, put a switch on the output to disconnect the load - it's handy to haveActually, if I were a complete beginner again and still unsure of what direction my interests would take, I'd build a supply with individual fixed +3.3, +5, +9, +-12, and maybe +- 15 or 18v outputs, as well as an adjustable +- 0-20v dual-rail output. The little stuff is good for micros & such, the 9v is simply handy to have, the +-12 (& optional +-15 & +-18) is handy for both general use and op-amps, an adjustable dual-rail supply is just all-round handy to have, and it'sreallyhandy to have them all available at once. But that's getting overly complex

author: old gregg
author_rank: Regular Contributor
timestamp: March 15, 2014, 12:01:01 pm
content: Why not using a large resistor value in // of the rotary switch ? it won't let the connection open when the switching occurs I think. Once the switching done, the resistor in // will reduce the value of the big one. But the math for the resistors will be changed. Besides, no idea of the behavior of the regulator with such large value.I had a similar idea few months ago (never built) and I had the same idea of rotary switching with multi-tour trimmers for a precise output voltage. But it lacked some serious current monotoring and short-circuit protection.Besides, It's amazing how that kind of desing can become bulky and annoying. I've quicky made the thermal calculations and the Heatsink should be huge !

author: deth502
author_rank: Frequent Contributor
timestamp: March 15, 2014, 03:02:42 pm
content: Quote from: old gregg on March 15, 2014, 12:01:01 pmyes, this will prevent and voltage spike during adjustment from being large enough to damage the power supply, but will it suppress it enough to prevent damage to any connected circuit that is being powered? likely not.

author: dentaku
author_rank: Frequent Contributor
timestamp: March 15, 2014, 03:08:26 pm
content: Quote from: Tac Eht Xilef on March 15, 2014, 03:36:39 amYou're right!. One end of both resistors is connected to the ADJ of the regulator and the other end of both resistors is connected to ground so they ARE parallel.In the gap between 3.3V and 5V, for example, it would drop to around 2.6V for an instant because...R1 = 120ohmR2 = 196 and 360 in parallel = 127ohm (I know, there's no such thing as a 196ohm resistor)So output voltage = 2.57VThat doesn't seem so bad at those low voltages but the drop is more dramatic between 5V and 9V, for example.Hmmm...I might look into the way it's done in Fig. 2 herehttp://sound.westhost.com/project44.htmThis way I can use regular 10K pots, which is something I already have, unlike these magical 2K to 2.5K linear pots

author: deth502
author_rank: Frequent Contributor
timestamp: March 15, 2014, 03:09:35 pm
content: Quote from: Tac Eht Xilef on March 14, 2014, 11:11:01 pmthis is something ive been pondering lately, but i havent put too much thought of actual calculations into it, so it may sound a bit rough.normally, both large and small caps are used, as he has in this design. theory being that the large cap, in addition to doing its obvious job, blocks any high frequency noise, while the .1uf stops any low frequency noise.so, in essence, each cap is acting as a srt of bandpass filter. in this case, wouldnt it actually be better to parallel multiple caps? you would still get the needed capacitance as you would with one large cap, but you would have the benefit of blocking more noise and harmonics from getting through to the output?

author: dentaku
author_rank: Frequent Contributor
timestamp: March 15, 2014, 09:14:49 pm
content: Now that I found what seems to be a make-before-break rotary switch in my bins of stuff I drew this up.It looks like it should work.I know it's not the most important part of the power supply but it's an interesting little exercise.In this image I'm not showing thefine adjust200ohm pot I'm planning to use before the switch.

author: Unknown
author_rank: Unknown
timestamp: March 16, 2014, 12:44:55 am
content: Quote from: dentaku on March 15, 2014, 09:14:49 pmAh, Iknewthere was a way of getting around the "parallel resistors = voltage dip" issue when using a K-contact switch, but I couldn't think of it because Saturday morning.Well done

author: I_may_be_drunk_right_now
author_rank: Contributor
timestamp: March 16, 2014, 01:19:21 am
content: 1) Wouldn't it be fun to have outputs that go to zero volts?2) How about voltage reading? eBay is your friend with ultra cheap LED readout modules.3) You can do current readout too!

author: dentaku
author_rank: Frequent Contributor
timestamp: March 16, 2014, 02:07:39 pm
content: Quote from: Tac Eht Xilef on March 16, 2014, 12:44:55 amI'm not really sure what type of switch this is but I just did a test with my meter and connecting it to two adjacent wires make my meter beep between clicks so it'smakingbeforebreakingwhen the curved wiper goes into the gap between the contacts.It's unfortunate I don't have two of them.

author: dentaku
author_rank: Frequent Contributor
timestamp: March 16, 2014, 02:11:28 pm
content: Quote from: I_may_be_drunk_right_now on March 16, 2014, 01:19:21 amFunny you should mention thatI got these for a few dollars from China.I like the look of the analog meter but it takes up quite allot of space.

author: I_may_be_drunk_right_now
author_rank: Contributor
timestamp: March 17, 2014, 12:55:11 am
content: Quote from: dentaku on March 16, 2014, 02:11:28 pmCould you also explain the purpose of a full wave bridge with a CT transformer? It's baffling to me.

author: dentaku
author_rank: Frequent Contributor
timestamp: March 17, 2014, 01:14:38 am
content: Quote from: I_may_be_drunk_right_now on March 17, 2014, 12:55:11 amIt's just the way most circuits I've found work.If you're asking why full-wave as opposed to half-wave, as a total beginner I would assume it's because it's allot easier to smooth out 120Hz AC than 60Hz because it doesn't have big gaps at each cycle.http://en.wikipedia.org/wiki/Rectifier#Half-wave_rectificationAre you suggesting another method?

author: dentaku
author_rank: Frequent Contributor
timestamp: March 17, 2014, 02:14:39 am
content: Quote from: Tac Eht Xilef on March 16, 2014, 12:44:55 amSoI plugged a bunch of resistors in series into a small breadboard and connected my rotary switch to the intersection of all of them.I tested it out with my meter and every click gives me a greater resistance, like I expected.BUT... It only works for the first and second switch positions when connected to the LM317 circuit. The rest of the clicks don't seem to have any effect on the regulator. I guess my experimental setup just isn't suitable connected to the ADJ pin of an M317?Oh well, it was an interesting experiment.

author: I_may_be_drunk_right_now
author_rank: Contributor
timestamp: March 17, 2014, 02:32:02 am
content: Quote from: dentaku on March 17, 2014, 01:14:38 amI don't think you've found too many power supplies that use a full-wave rectifier with a center-tapped transformer. Study it out, only two diodes are ever working here, and your output ripple is 60Hz, or 50Hz ... The other two diodes are just reverse biased all the time.I mean if you're using that part because it's all you have, great, but you should understand what is going on here.Perhaps you are referring to the classic voltage doubler/rectifier circuit that feeds two stacked capacitors on the input of old switching supplies?Or maybe two separate windings with each its own full-wave rectifier?

author: edavid
author_rank: Super Contributor
timestamp: March 17, 2014, 02:51:13 am
content: Quote from: I_may_be_drunk_right_now on March 17, 2014, 02:32:02 amI do think you're drunkIt's two separate full wave rectifier circuits, with a common ground. Perfectly OK for the OP's needs.

author: dentaku
author_rank: Frequent Contributor
timestamp: March 17, 2014, 01:40:23 pm
content: Quote from: I_may_be_drunk_right_now on March 16, 2014, 01:19:21 amWhat I've basically built is a slight variation of various other designs.Like thishttp://cdn.head-fi.org/e/e4/900x900px-LL-e431d7c1_317_337Schematic.pngOr this... (but with a purpose built bridge rectifier instead of four individual diodes)http://cdn.head-fi.org/0/08/900x900px-LL-08345efb_SP-2-LMSCH.jpegor thishttp://sound.westhost.com/p44-fig1.gifIt seems to work fine. I've checked the outputs of the + and - pins of the rectifier with my scope (before adding the smoothing caps) and it looks exactly like the examples I've found.The + pin gives me exactly what this attachment looks like and the - pin is just the mirror image.

author: I_may_be_drunk_right_now
author_rank: Contributor
timestamp: March 17, 2014, 04:19:10 pm
content: Quote from: edavid on March 17, 2014, 02:51:13 amPlease show me what happens here. It's a simple half wave circuit with extra useless diodes. Draw out the currents and voltages on each half cycle of the CT output.Show me where I'm wrong, please.

author: I_may_be_drunk_right_now
author_rank: Contributor
timestamp: March 17, 2014, 04:21:11 pm
content: Quote from: dentaku on March 17, 2014, 01:40:23 pmOf course it would, but at what frequency? Or is your schematic wrong?You're just copying stuff. There is only two diodes ever working here.

author: I_may_be_drunk_right_now
author_rank: Contributor
timestamp: March 17, 2014, 04:42:58 pm
content: Quote from: I_may_be_drunk_right_now on March 17, 2014, 04:21:11 pmhttp://physics.stackexchange.com/questions/55698/what-is-the-role-of-center-tapping-in-a-full-wave-rectifierIt's very simple. A CT with two diodes pointing the same way to one load is a full-wave bridge.Turn one of the diodes around and add another cap, you have a "voltage doubler" (compared to the same full wave CT configuration) with a tap halfway. You can add all the diodes you want, they'll be reversed biased.Unless you actually have a transformer with two *separate* windings, each with a full-wave bridge, with the common *AFTER* the bridges.Two wildly different configurations.

author: edavid
author_rank: Super Contributor
timestamp: March 17, 2014, 04:45:45 pm
content: Drunk, you are just confusing yourself. It is not a half wave circuit or a doubler. It is 2 full wave circuits. All the diodes conduct, and the ripple is 120Hz. Fire up LTspice and see for yourself.

author: dentaku
author_rank: Frequent Contributor
timestamp: March 18, 2014, 01:08:48 am
content: edavid is right.I've done it in real life and in simulations and it works.Just like this.