Author Topic: My Simple bench power supply  (Read 14702 times)

ttyz

  • Newbie
  • *
  • Posts: 18
My Simple bench power supply
« on: August 19, 2013, 04:50:39 PM »
Hello everybody,

I'm just starting in electronics, and there is a bunch of stuff I need to learn. But I don't have a power supply, so I've decided to build one. First I thought the best way is to make a variable power supply form an ATX power supply, as it would keep things as simple as possible. But then I've found this schematic on MAKE:



It uses LM317, and looks simple to me. I've already bought all components and put them together on a breadboard, but I am actually using a constant 12V/1.5A notebook power supply instead of transformer and a bridge rectifier to check the circuit before switching to mains.

It would like to add some features to this device: some meter to monitor voltage and current would be useful. And I am thinking of current limiting, but did not find a way to implement this.

I am still waiting for some parts for this project, and I need to find a 10-turn pot, that seems difficult. But I will share my progress and waiting for support and help if I am doing anything wrong.

Thank you all and thanks Martin for this forum and great vblog, I've learnt a lot
« Last Edit: August 20, 2013, 01:47:52 AM by gentz109 »
Cheers,
Evgeny

mariush

  • Newbie
  • *
  • Posts: 42
Re: My Simple bench power supply
« Reply #1 on: August 19, 2013, 10:04:10 PM »
If you're eventually going to buy a transformer, replace the 2 capacitors with a single 2200-3300 uF capacitor with suitable voltage rating (transformer output rectified + 25%+). 
So for example if you find a 12v transformer,  rectified output would be 12 x 1.414, minus about 1-1.5v would give you about 15.5-16v, +25% = 20v, so use at least a 25v rated capacitor.
If you're going to power it from a notebook power supply, even a 330-470uF capacitor would be more than enough.

With a notebook power supply, you're kinda missing the point of such power supplies.. they're supposed to be as little noisy as possible. The LM317 would not be able to filter all the high frequency noise from the notebook power supply so such "adjustable power supply" won't be quite optimum for use with opamps, audio stuff.. etc.

Check the lm117/lm317 datasheet... depending on how you plan to use it, you might want to add a 10uF capacitor in parallel with the trim pot and an additional diode to protect the adjust pin ...

See http://www.ti.com/lit/ds/symlink/lm117.pdf , page 11 ..  the datasheet is for lm117 AND lm317 but most examples are with lm117, hence why the R1 resistor is 240 ohm in that example ... in your circuit, it's ok to be 100 ohm, LM317 needs a bit lower resistor there (100-120 ohm is good)

ttyz

  • Newbie
  • *
  • Posts: 18
Re: My Simple bench power supply
« Reply #2 on: August 20, 2013, 01:46:30 AM »
Thanks for your reply mariush,

Yes, of course I am going to use transformer eventually. I already have one - it is 24V/0.8A transformer. And I use 50V capacitors.

I have some questions now:

  • Why is transformer output x 1.414? I thought that 24V in my case is the transformer output voltage.
  • I've used 2 1000uF caps as it was in original schematics, is there any particular point for using 1 larger cap instead of 2 in parallel?
  • In datasheet it said that "No protection is needed for output voltages of 25V or less and 10 μF capacitance." I thought this is my case as my output voltage would be less than 24V. Am I right?

Now I need to decide if it is necessary to rearrange the capacitors, as I need more of a universal application.

Thanks for support once again.
Cheers,
Evgeny

Mr Eastwood

  • Sr. Member
  • ****
  • Posts: 274
Re: My Simple bench power supply
« Reply #3 on: August 20, 2013, 05:50:53 AM »
in your circuit, it's ok to be 100 ohm, LM317 needs a bit lower resistor there (100-120 ohm is good)

Hi,  is the value for R1 correct?   surely a 170 ohm with the 5K POT would be a better choice to give nice spread across the maximum voltage range of the regulator?   But if you used the maximum voltage range of the regulator and used the 100 ohm for R1,  according to the online LM317 calculators R2 wouldn't effect the voltage until it was set less than ~2.9K;  so ~5 turns of 10 turn 5K POT would be wasted?   But, I could be wrong :-) as I'm only a beginner in electronics.
Hey! Frisbee! Far out!

iloveelectronics

  • Full Member
  • ***
  • Posts: 227
Re: My Simple bench power supply
« Reply #4 on: August 20, 2013, 06:13:53 AM »
Why is transformer output x 1.414? I thought that 24V in my case is the transformer output voltage. [/li][/list]

Because the spec'ed voltage is the RMS (Root Mean Square) voltage. For sine wave you need to multiply that by the square root of 2, which is 1.414 to find out the peak voltage.
My eBay store: http://www.99centHobbies.com
Email: franky @ 99centHobbies . com

ttyz

  • Newbie
  • *
  • Posts: 18
Re: My Simple bench power supply
« Reply #5 on: August 20, 2013, 06:21:03 AM »
jucole, Thanks for the calculators advise. I have to play with those.


UPD: I've used this calc: http://www.reuk.co.uk/LM317-Voltage-Calculator.htm
I got these results:
If i need Vout = 20V and R2 = 5K (Max of the pot) then R1 should be 330 Ohms.
And I can get Vout = 30V using 220 Ohms resistor, as my Vin = 24V x 1.414 - 1.5V = 32.4V
Am I wrong with my calculations?

 
iloveelectronics, Thank you, yes now this all makes sense.
« Last Edit: August 20, 2013, 09:41:03 AM by ttyz »
Cheers,
Evgeny

MJLorton

  • Administrator
  • Hero Member
  • *****
  • Posts: 817
Re: My Simple bench power supply
« Reply #6 on: August 20, 2013, 10:47:21 AM »
Hello Evgeny and welcome aboard!

Great to see you are getting stuck into your power supply project and learning along the way.

Thanks to everyone for giving a helping hand...makes me realise all the hard work is worth it if the forum works this way.

I'm off  for the next couple of weeks and will continue my power supply project early in September on my return.

Cheers,
Martin.
Play, discover, learn and enjoy! (and don't be scared to make mistakes along the way!)

mariush

  • Newbie
  • *
  • Posts: 42
Re: My Simple bench power supply
« Reply #7 on: August 20, 2013, 11:49:28 AM »
ttyz, the regulator needs a minimum amount of current coming from the output pin to the adjust pin through that R1 resistor. If you increase the resistor more than - let's say probably 150-180 ohm - the current may be too low in some cases and the regulator may not regulate properly.  People have had problems with a 240 ohm resistor, which was fine for LM117 but not good enough for LM317 in all situations.

It's recommended to leave that resistor to 100-120 ohm.

Your voltage will be 24v AC rms x 1.414 = 34v +/- about 5-10% (more at low loads/ less at high loads).  The bridge rectifier will waste about 1.5-2v so you are left with about 32v.
But that's with the rectifier producing a perfect DC, which is not the case.  The capacitors after the bridge rectifier smooth out the output and try to get the DC voltage as ripple free as possible.
The formula to calculate how much capacitance you need there is something like  C =  0.75x current / (2 x f x Vripple)  where Vripple is how much you're willing to let the input voltage vary, f is the ac frequency, current is the maximum current.

So assuming after the bridge rectifier you have a peak voltage of 32v, if you want the voltage to not go down more than 1v at 1A, then you have C = 0.75 x 1A / 2x50Hz x 1v = 0.75 / 100 = 0.0075F = 7500uF 

So at 1A, with 32v peak from bridge rectifier, with about 3300uF capacitance you'll have 30-32v DC. It's not a great idea to put A LOT of capacitance, you'd be "stressing" the transformer. It's common to just accept a small voltage drop of 1-2 volts and use at most about 4700uF  for 1A.

Now, LM317 needs about 1.5-2v ABOVE the output voltage to regulate properly, so the best you're looking at when it comes to output voltage is 1.25v - 28v, maybe a bit more if you add a lot of capacitance.

So I suggest aiming for a maximum of 28v on the potentiometer.... 

The output voltage is calculated with formula  Vout = Vref ( 1 + R2/R1)  = 1.25(1 + ? / 100)  so for 28v = 1.25 (1+ ? / 100)   => ? = (28/1.25 - 1 )  * 100 = 2140 ohm.

So now you can do a trick ...  you can put a resistor in paralel with the potentiometer to reduce the maximum resistance.

1/Rtotal = 1/R1 + 1 / R2 =>Rtotal = r1xr2 / (r1+r2)

So for example, you can put a 3900 ohm resistor in paralel, so the maximum will be 3900x5000 / 8900   = 2191 ohm.

Last... keep in mind that the lm317 can dissipate about 15 watts with a good heatsink.  The power dissipated is calculated with formula  P  = (Vin - Vout) x Current.

With 30v in (after rectification, capacitors etc), if you want 3.3v out ... P  = (30-3.3) x current, so the maximum current you'd be able to get out would be 15/ 26.7 = 0.56A.  For 0.8-1A out, you're looking at a maximum of about 15v difference between input and output, and that's with a BIG heatsink (or a smaller one but with fan blowing on it).

A possible solution would be if the transformer has two secondary windings ( 0 - 12 - 24  or  0 - 12   0 - 12) so that if you want your power supply to output  1.25-12v, you switch to the first winding, and if you want more you join the two windings so that you have higher input voltage.
« Last Edit: August 20, 2013, 11:53:54 AM by mariush »

Adrian

  • Newbie
  • *
  • Posts: 9
Re: My Simple bench power supply
« Reply #8 on: August 20, 2013, 02:19:01 PM »
This is a very good bench power supply for a beginner in electronics because is having an output voltage/current perfect for a op amp(+/GND/-)! 8)

ttyz

  • Newbie
  • *
  • Posts: 18
Re: My Simple bench power supply
« Reply #9 on: August 20, 2013, 03:31:06 PM »
mariush, wow, thanks for this reply, all this calculations are really great help, now i think I have some understanding of what is going on here.
So now I've changed the schematics to this:


I am still not sure about C2 and C4 values and I need to find a new transformer.

And one more question: will the input ripple affect the output voltage or it all would be regulated?

Adrian, Yes, I am thinking of adding a negative output eventually, thanks for the diagram.

P.S.

Here the enclosure I've got for this project:


Martin, And there is a postcard, that I am going to send. I realize that it is already late for the giveaway, but I hope there is some space left on the wall for it ;)
Cheers,
Evgeny

mariush

  • Newbie
  • *
  • Posts: 42
Re: My Simple bench power supply
« Reply #10 on: August 20, 2013, 04:31:20 PM »
C2 should be 0.1uF usually, but up to 0.47uF would probably be OK. 
Pretty much all ICs should have a 0.1uF or thereabouts capacitor for decoupling purposes.

The capacitor should be ceramic (which means it has no polarity so you can put it either way). It should be X7R or X5R... maybe NPO but those are usually too expensive. don't get anything else or something that doesn't specify which type is.

Should be rated for 50v or more, ideally 100v or more... unlike with electrolytic and tantalum capacitors,  capacitance of ceramic capacitors drops as the voltage on capacitor gets close to maximum voltage rating... so for example a 10uF 50v ceramic capacitor may only be able to hold 1uF when you have 20-30v going through it.   

C4 should be a regular electrolytic capacitor, 10-22uF 50-100v rated should be enough. You can go with more but it wouldn't give you any extra benefit.
If you want, you can use tantalum, but it's pointless and they're expensive (1-2$ a piece for 10-22uF/50v)
« Last Edit: August 20, 2013, 04:33:57 PM by mariush »

ttyz

  • Newbie
  • *
  • Posts: 18
Re: My Simple bench power supply
« Reply #11 on: August 21, 2013, 05:08:02 AM »
Now the capacitors are in place and I've added some switches. I was thinking of some kind of automatic switching to higher voltage but I think it is not possible without a microcontroller. This might be the next step in the project :)



The only question left is input voltage ripple. How critical 2V ripple is for the output?

I am just waiting for a new transformer now and a 10-turn pot before I can test it on a breadboard.
Cheers,
Evgeny

dr_p

  • Jr. Member
  • **
  • Posts: 64
Re: My Simple bench power supply
« Reply #12 on: August 21, 2013, 08:15:02 AM »
The only question left is input voltage ripple. How critical 2V ripple is for the output?

The LM317 Datasheet says this about line regulation:



So at above 25C (it's obviously going to run hot), with an input-output differential of at least 3V, line regulation is maximum 0.07%/V which is decent I think.

So 12V RMS is 12 x 1.41 = 16.92 peak, minus 2 V ripple = 14.92, minus 3V input-output differential = 11.92V, so it's only decent for up to 12V regulated output.

IMHO, you can add some input capacitance to keep the input ripple lower and raise the max output voltage. I generally go 2200-3300 per each amp, if space is not a problem.


mariush

  • Newbie
  • *
  • Posts: 42
Re: My Simple bench power supply
« Reply #13 on: August 21, 2013, 11:07:48 AM »
The windings are usually switched using opamps and relays.
For the simple case of a single flip between two windings, it's possible to just use a relay and some passives (resistors,capacitors, npn).

Have a look at the picture below :



Basically, the output of the power supply above goes through a voltage divider formed by those R6, R7, and C4.  When voltage goes high enough (this is from a 18v power supply so I think about 7v) the npn transistor starts passing current through it and relay gets energized, switching from 8 to 9.
The C4 I think it's there as a sort of prevention against having the relay flip constantly between windings when user selects a voltage right at the threshold.

Relays are usually running at 12v, so in this design the input is separate (about 15v in after it goes through the db107 rectifier) and then the 78L12 (12v reg, max 100mA) takes it down to 12v for the relay, but if you can get a 5v relay capable of about 10-16A then you should be able to power it from the winding that's always connected, through a 7805 regulator. 
But the relay will use about 50-100mA when it's energized so you have to keep that in mind.

K1A is the primary winding of the relay, K1B is the secondary, it's a relay that always connects something so it has three terminals at the other end ... i forget now the exact term for it.
« Last Edit: August 21, 2013, 11:18:28 AM by mariush »

ttyz

  • Newbie
  • *
  • Posts: 18
Re: My Simple bench power supply
« Reply #14 on: August 21, 2013, 02:50:28 PM »
dr_p, Thank you, no questions left then :)

mariush Thanks a lot. I think this will be the first improvement after I finish with the simple version with the switch.
Cheers,
Evgeny