EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: PotatoBox on August 24, 2016, 04:25:22 am

Title: Lab Bench PSU
Post by: PotatoBox on August 24, 2016, 04:25:22 am
Hello everyone,

I have a 300w atx psu I salvaged from an old computer and I want to convert it into a variable bench power supply. Now, I wanted to use an LM317 to adjust the voltage on the 12v rail from the psu. In the texas instruments datasheet on page 10 shows the suggested schematic. Now, which resistors do I use for R1 and R2? it shows a 240ohm resistor for R1 but Ive seen people use different resistors for R1.

http://www.ti.com/lit/ds/symlink/lm317.pdf (http://www.ti.com/lit/ds/symlink/lm317.pdf)
Title: Re: Lab Bench PSU
Post by: gigabyte091 on August 24, 2016, 04:53:39 am
I usually use 10k pot with LM317, if you have -12 or -5V on PSU you could use it and have output voltage adjustable from 0V instead of 1.25V.
Title: Re: Lab Bench PSU
Post by: Mechatrommer on August 24, 2016, 12:01:28 pm
there!...

(https://www.eevblog.com/forum/beginners/lab-bench-psu/?action=dlattach;attach=250162;image)

R2 = [(Vo / 1.25) - 1] * R1
ignore Iadj * R2 as starting point...
Title: Re: Lab Bench PSU
Post by: newbrain on August 24, 2016, 02:59:22 pm
Hello everyone,

I have a 300w atx psu I salvaged from an old computer and I want to convert it into a variable bench power supply. Now, I wanted to use an LM317 to adjust the voltage on the 12v rail from the psu. In the texas instruments datasheet on page 10 shows the suggested schematic. Now, which resistors do I use for R1 and R2? it shows a 240ohm resistor for R1 but Ive seen people use different resistors for R1.

http://www.ti.com/lit/ds/symlink/lm317.pdf (http://www.ti.com/lit/ds/symlink/lm317.pdf)
A couple of thoughts:
* About the resistor: the LM317 datasheet specifies the minimum load current with a typical value of 3.5mA and a maximum of 10mA. This means that in the general case 240ohms are enough, but to be safe 120ohms should be used. LM117, OTOH, with its 5mA as maximum is guaranteed to work with 240ohms.
* Remember that the negative terminal of your supply (and the PSU chassis) is connected to earth ground, so your power supply will not be floating. This has both safety and practical implications. And no, cutting the ground connection is not a good idea.
Title: Re: Lab Bench PSU
Post by: PotatoBox on August 24, 2016, 04:15:20 pm
Sooo the resistor values are all dependant on the the maximun voltage I want in the circuit? But what if I wanted to have my psu output more than 10ma? Would I just use a higher resistor for R1?
Title: Re: Lab Bench PSU
Post by: macboy on August 24, 2016, 04:56:05 pm
Sooo the resistor values are all dependant on the the maximun voltage I want in the circuit? But what if I wanted to have my psu output more than 10ma? Would I just use a higher resistor for R1?
No, resistor R1 provides a minimum load when nothing is connected to the output. Notice that there is always 1.25 V across R1 (this is the reference voltage) so 1.25 / 240 ohm = 5.2 mA. That amount of current always flows through R1 (and R2) regardless of the output voltage setting or the connected load.

Any load you connect will simply add to this load. So if you connect some load that draws 100 mA, the LM317 will be required to supply 105 mA total.
Title: Re: Lab Bench PSU
Post by: buffoon on August 25, 2016, 12:36:34 am
Sooo the resistor values are all dependant on the the maximun voltage I want in the circuit? But what if I wanted to have my psu output more than 10ma? Would I just use a higher resistor for R1?
A few things:
1) Keep R1 constant around 240ohm. The 5mA calculated by newbrain goes into the feedback loop. Use the equation mechatrommer posted above to choose R2 depending on your output needs (or use a pot to make a variable PSU).

2) What will be your output voltage and current? Keep in mind that the voltage doesn't just disappear. The power dissipated as heat will be (Vin - Vout) * current
Title: Re: Lab Bench PSU
Post by: PotatoBox on August 25, 2016, 01:51:16 am
Sooo the resistor values are all dependant on the the maximun voltage I want in the circuit? But what if I wanted to have my psu output more than 10ma? Would I just use a higher resistor for R1?
A few things:
1) Keep R1 constant around 240ohm. The 5mA calculated by newbrain goes into the feedback loop. Use the equation mechatrommer posted above to choose R2 depending on your output needs (or use a pot to make a variable PSU).

2) What will be your output voltage and current? Keep in mind that the voltage doesn't just disappear. The power dissipated as heat will be (Vin - Vout) * current

Well I want to have a variable output voltage between 1.5-12 volts.
Title: Re: Lab Bench PSU
Post by: newbrain on August 25, 2016, 09:41:32 pm
Well I want to have a variable output voltage between 1.5-12 volts.
Take into consideration that the LM317 will not work correctly with Vout-Vin smaller than about 2.5÷3V.
So the maximum regulated voltage you can expect to obtain is ~9V; of course you can get the 12V directly from the ATX PSU
Title: Re: Lab Bench PSU
Post by: PotatoBox on August 27, 2016, 01:14:42 am
Should I try to use an LM2576 instead?
Title: Re: Lab Bench PSU
Post by: newbrain on August 27, 2016, 08:50:44 am
Should I try to use an LM2576 instead?
Using a LM2576 will reduce the drop out voltage, according to the datasheet (http://www.ti.com/lit/ds/symlink/lm2576.pdf), Figure 3, it will be about 1V for a 1A load at 50°C. $\Omega$
But:
I think the LM317 idea is good, for a beginner's project, my initial warnings were for a couple a things that might go unnoticed (everybody uses 240\$\Omega\$ with the LM317, but that's not guaranteed to work with very small loads).
When you need 12V just get them straight from the ATX PSU...
Another alternative: there are buck-boost modules for sale on eBay (http://www.ebay.com/sch/i.html?_from=R40&_trksid=p2050601.m570.l1313.TR0.TRC0.H0.Xbuck-boost.TRS0&_nkw=buck-boost&_sacat=0) o AliExpress (http://www.aliexpress.com/wholesale?catId=200215223&initiative_id=AS_20160827004316&SearchText=buck-boost).
They usually work almost (http://nerdralph.blogspot.se/2015/08/dc-converter-modules-using-fake-lm2596.html) as advertised, but the learning value of just connecting a couple of wires is next to zero...

The next step for LM317: thermal design!
How much current do you need? Do you need that maximum current at the minimum voltage?
Title: Re: Lab Bench PSU
Post by: PotatoBox on August 28, 2016, 04:58:17 am
Should I try to use an LM2576 instead?
Using a LM2576 will reduce the drop out voltage, according to the datasheet (http://www.ti.com/lit/ds/symlink/lm2576.pdf), Figure 3, it will be about 1V for a 1A load at 50°C. $\Omega$
But:
  • This is a switching regulator: PCB layout is very important and the design process is more complex, see the chapters 8.2 and 9 in the DS.
  • It still won't get you 12V. You would need a buck-boost type of switching regulator.
I think the LM317 idea is good, for a beginner's project, my initial warnings were for a couple a things that might go unnoticed (everybody uses 240\$\Omega\$ with the LM317, but that's not guaranteed to work with very small loads).
When you need 12V just get them straight from the ATX PSU...
Another alternative: there are buck-boost modules for sale on eBay (http://www.ebay.com/sch/i.html?_from=R40&_trksid=p2050601.m570.l1313.TR0.TRC0.H0.Xbuck-boost.TRS0&_nkw=buck-boost&_sacat=0) o AliExpress (http://www.aliexpress.com/wholesale?catId=200215223&initiative_id=AS_20160827004316&SearchText=buck-boost).
They usually work almost (http://nerdralph.blogspot.se/2015/08/dc-converter-modules-using-fake-lm2596.html) as advertised, but the learning value of just connecting a couple of wires is next to zero...

The next step for LM317: thermal design!
How much current do you need? Do you need that maximum current at the minimum voltage?

So, are you saying I should go with the lm317 over the lm2576? Arent the lm2576 used in those buck converters?
Title: Re: Lab Bench PSU
Post by: spacedementia87 on August 28, 2016, 10:10:15 am
I have seen posts on this forum before telling people not to use ATX supplies as a bench supply.

Safety, accuracy all come out as reasons, but not here.

Why not?

Sent from my ONE A2003 using Tapatalk

Title: Re: Lab Bench PSU
Post by: newbrain on August 28, 2016, 01:04:42 pm
So, are you saying I should go with the lm317 over the lm2576? Arent the lm2576 used in those buck converters?
It's up to you and the confidence you have in your skills. Since you started simple, and this is the beginner section I imagined you were after a simple starter project.
Yes, they are used in buck (==down) converters, that means the output voltage will be lower than the input one.

I have seen posts on this forum before telling people not to use ATX supplies as a bench supply.

Safety, accuracy all come out as reasons, but not here.

Why not?
If using an ATX PSU involves modification of the internals (holes and wiring changes) and removal of the ground connection (as seen in some horror video on YT), I'm all against it.

If the supply is simply used as the input source for a regulator stage as seems to be the case here, I do not see major problems, when done carefully.

One of the things that might be overlooked is that all the output voltage are referenced to earth ground, that's why I pointed it out in my first answer.

Another point is that an ATX supply can provide a lot of current, especially on the 12V rail, though good ones have protections (don't know about the OP one).
The post regulator (LM317) section should at least be fused appropriately.
Title: Re: Lab Bench PSU
Post by: PotatoBox on August 28, 2016, 05:52:34 pm
Well, what I might actually do is scrap the atx psu idea and just make a power supply from scratch with a transformer and such. Get a better learning experience out of that.
Title: Re: Lab Bench PSU
Post by: newbrain on August 28, 2016, 07:50:35 pm
Well, what I might actually do is scrap the atx psu idea and just make a power supply from scratch with a transformer and such. Get a better learning experience out of that.
:-+ I definitely agree.
A small linear PSU is a typical initial project, a good learning value and a useful tool (I still have mine, it might be 30 yo, and still goes strong...).
Title: Re: Lab Bench PSU
Post by: PotatoBox on August 29, 2016, 02:06:12 am
Well, what I might actually do is scrap the atx psu idea and just make a power supply from scratch with a transformer and such. Get a better learning experience out of that.
:-+ I definitely agree.
A small linear PSU is a typical initial project, a good learning value and a useful tool (I still have mine, it might be 30 yo, and still goes strong...).

The good thing is, I could just salavge most of the parts from the atx psu i already have!
Title: Re: Lab Bench PSU
Post by: Mechatrommer on August 29, 2016, 03:17:53 am
The good thing is, I could just salavge most of the parts from the atx psu i already have!
for linear? not really, not even the transformer. been there... well there are some you can salvage, like some misc resistors, wires, and the metal case (if that suits your taste)..
Title: Re: Lab Bench PSU
Post by: PotatoBox on August 29, 2016, 05:20:45 am
The good thing is, I could just salavge most of the parts from the atx psu i already have!
for linear? not really, not even the transformer. been there... well there are some you can salvage, like some misc resistors, wires, and the metal case (if that suits your taste)..

Linear... What does that mean?
Title: Re: Lab Bench PSU
Post by: Jay_Diddy_B on August 29, 2016, 08:30:34 am
Linear... What does that mean?

In this context it means:

Using a LDO style regulator, like a LM317 or similar part. The alternative is to use a switching power supply design. The construction of a switching supply is more difficult, especially for a beginner.

A little bit of metal work is required, linear supplies need a heatsink for the main power device.

Using a 60 Hz transformer, instead of an off-line switching power supply. This is much safer. There is less exposed high voltage.

I am sure that many members of the forum built these supplies as one of their first projects. When I started electronics, (shortly after electricity was invented  ^-^ ), the low cost bench power supplies, we find today, were not available and there were relatively few surplus power supplies (hp, lambda etc.) and these were expensive.

Regards,

Jay_Diddy_B
Title: Re: Lab Bench PSU
Post by: setq on August 29, 2016, 05:01:30 pm
If you're going to do this, please wear safety glasses. ATX supplies can quite happily dump 200W into your load suddenly on one rail. I really wouldn't use one myself. A little TO220 regulator is going to spread its guts across the room pretty sharpish as are your probes, solder joints and anything conductive that temporarily acts as the load by accident. All it takes is one little mistake.
Title: Re: Lab Bench PSU
Post by: janoc on August 29, 2016, 07:35:23 pm
If you're going to do this, please wear safety glasses. ATX supplies can quite happily dump 200W into your load suddenly on one rail. I really wouldn't use one myself. A little TO220 regulator is going to spread its guts across the room pretty sharpish as are your probes, solder joints and anything conductive that temporarily acts as the load by accident. All it takes is one little mistake.

Yeah, ATX supply without some additional current limiting is a disaster waiting to happen, even though they are protected against short circuit. However, 20A on a 5V rail, no problem! And the same or more on the 12V rail - that's getting into the arc welder territory already.

They also produce a rather dirty output, with a lot of switching noise and not great regulation. For PCs it is good enough, because it is assumed that pretty much everything has local regulation and filtering, but good luck testing some noise sensitive circuits with it ...

I have one, but I am using it only to power high current things like motors or my fume extractor fan, not as a regular bench supply.
Title: Re: Lab Bench PSU
Post by: Mechatrommer on August 30, 2016, 03:16:47 am
The good thing is, I could just salavge most of the parts from the atx psu i already have!
for linear? not really, not even the transformer. been there... well there are some you can salvage, like some misc resistors, wires, and the metal case (if that suits your taste)..
Linear... What does that mean?
i mean... if you want to salvage ATX PSU parts to make a linear regulating bench power supply.
Title: Re: Lab Bench PSU
Post by: Brumby on August 30, 2016, 06:14:06 am
The good thing is, I could just salavge most of the parts from the atx psu i already have!
for linear? not really, not even the transformer. been there... well there are some you can salvage, like some misc resistors, wires, and the metal case (if that suits your taste)..

Linear... What does that mean?

There are two basic common designs for power supplies: Switch mode and linear.

In general:

With switch mode, the incoming power is turned into DC which powers an oscillator.  Sounds like going in a circle, doesn't it?  But the oscillator runs at a much higher frequency like 50 kHz to 1 MHz (pick a number).  This higher frequency allows for the use of a much smaller transformer.  The design also can handle a wide variety of input voltages ... and frequency is hardly relevant.  Small and light, this type of supply is usually cheap and easy to make and tends to not waste a lot of power.  It does have a down side, though ... and that is, because of the high frequency and switching mechanism, you can get a lot of interference.  For some things, this doesn't matter, for others, it does.

Linear design has the absolute benefit of the lowest levels of interference possible - but it requires a (sometimes big and hefty) transformer designed to operate at the nominated supply voltage and frequency and capable of delivering the current required.  Voltage and current control is done by 'linear' circuitry - that is, continuous and smooth changes, much like adjusting the flow of water from a tap.  These control mechanisms often have a significant issue with power dissipation, so heatsinks become another necessity - and expense ... but there's no beating a linear power supply for quality of the power it can deliver.
Title: Re: Lab Bench PSU
Post by: PotatoBox on August 31, 2016, 02:29:31 am
Could I just rip a transformer from an alarm clock?
Title: Re: Lab Bench PSU
Post by: jeroen79 on August 31, 2016, 03:05:55 am
If that transformer meets your voltage and current requirements: yes
Title: Re: Lab Bench PSU
Post by: Brumby on August 31, 2016, 04:25:54 am
Could I just rip a transformer from an alarm clock?

If that transformer meets your voltage and current requirements: yes
With that qualification, yes, indeed.

The only thing here is ... an alarm clock does not require much power at all and the transformer will be built accordingly.  You are not going to get much voltage out of it - maybe 6-12V or a bit more if you are lucky - and you certainly aren't going to get much current capability ... a couple of hundred mA or something in that range.

If you want to cannabilise a piece of gear for a transformer, your best bet might be an audio amplifier that pushes out at least 50W RMS per channel.

(The RMS rating is very important.  This gives you the real power.  Don't think any other so-called 'power ratings' like PMPO have any real meaning.  They are just ridiculous numbers that marketing departments cook up so they look good in brochures.  There may be some mathematical process used to get those numbers, but it's more in the realm of fantasy than anything else.)
Title: Re: Lab Bench PSU
Post by: Muxr on August 31, 2016, 05:11:53 am
If you're going to do this, please wear safety glasses. ATX supplies can quite happily dump 200W into your load suddenly on one rail. I really wouldn't use one myself. A little TO220 regulator is going to spread its guts across the room pretty sharpish as are your probes, solder joints and anything conductive that temporarily acts as the load by accident. All it takes is one little mistake.

Yeah, ATX supply without some additional current limiting is a disaster waiting to happen, even though they are protected against short circuit. However, 20A on a 5V rail, no problem! And the same or more on the 12V rail - that's getting into the arc welder territory already.

They also produce a rather dirty output, with a lot of switching noise and not great regulation. For PCs it is good enough, because it is assumed that pretty much everything has local regulation and filtering, but good luck testing some noise sensitive circuits with it ...

I have one, but I am using it only to power high current things like motors or my fume extractor fan, not as a regular bench supply.
Yup.. one of the most useful things about bench power supplies is their current limiting capability. This can not also help you protect your circuits under test (current limiting can often save your accidentally shorted components from letting the magic smoke out), but it's also a safer way to go. It's so easy to miswire a lead on a breadboard or similar.

So if you're rolling your own PSU look at current limiting, or at least include some sort of a fuse/polyfuse.
Title: Re: Lab Bench PSU
Post by: PotatoBox on August 31, 2016, 05:41:21 am
Could I just rip a transformer from an alarm clock?

If that transformer meets your voltage and current requirements: yes
With that qualification, yes, indeed.

The only thing here is ... an alarm clock does not require much power at all and the transformer will be built accordingly.  You are not going to get much voltage out of it - maybe 6-12V or a bit more if you are lucky - and you certainly aren't going to get much current capability ... a couple of hundred mA or something in that range.

If you want to cannabilise a piece of gear for a transformer, your best bet might be an audio amplifier that pushes out at least 50W RMS per channel.

(The RMS rating is very important.  This gives you the real power.  Don't think any other so-called 'power ratings' like PMPO have any real meaning.  They are just ridiculous numbers that marketing departments cook up so they look good in brochures.  There may be some mathematical process used to get those numbers, but it's more in the realm of fantasy than anything else.)

How am I going to know if the transformer is meant to be used for a linear psu?
Title: Re: Lab Bench PSU
Post by: Brumby on August 31, 2016, 09:13:39 am
When cannabilising from other gear, this can be a little bit of a challenge.

The first step is to check that it does, in fact, connect directly to the mains.  This will confirm the primary is designed to handle the voltage.  As such, it will be suitable for a linear power supply - but whether it will be suitable for the power supply you want, is another matter.

Getting the secondary (or secondaries) voltage is not too difficult - just wire it up and measure the voltages.  Finding the current capabilities is a little less straightforward.  If you can get the specifications for the transformer, then these questions are immediately answered.

Usually, there is a correlation between physical size and weight with voltage and current capabilities - the bigger they are, the more grunt they can deliver.  The trick is to have the right voltage(s) on the secondaries, with current capability being equal to or more than you need.

Buying a transformer new makes this trivial.


As always, when working with mains power .... SAFETY FIRST.
Title: Re: Lab Bench PSU
Post by: Dave on August 31, 2016, 03:04:29 pm
If you want to cannabilise a piece of gear for a transformer, your best bet might be an audio amplifier that pushes out at least 50W RMS per channel.

(The RMS rating is very important.  This gives you the real power.  Don't think any other so-called 'power ratings' like PMPO have any real meaning.  They are just ridiculous numbers that marketing departments cook up so they look good in brochures.  There may be some mathematical process used to get those numbers, but it's more in the realm of fantasy than anything else.)
Well, RMS power is marketing wankery of its own. There is RMS voltage and RMS current, but there is just mean power.
Title: Re: Lab Bench PSU
Post by: Gyro on August 31, 2016, 05:48:28 pm
Not sure about 'marketing wankery'  ???  Surely RMS Power is just RMS Voltage * RMS current into a defined load impedance. In the same way as other power measurements, eg. dBm into (edit) 50R.

Edit: The term at least has some reliable meaning. 'Mean Power' could be manipulated by a marketing department to mean more or less anything.
Title: Re: Lab Bench PSU
Post by: Dave on August 31, 2016, 06:15:44 pm
Nope. Have you ever wondered why we do the RMS calculations? We do it to find the equivalent DC voltage/current that would produce the same amount of power on a purely resistive load. You don't calculate the RMS value of power, because it makes zero sense (and the calculation would be absolutely pointless).

Mean power couldn't be manipulated in any way, there is no way to make it look bigger on paper than it actually is.
Title: Re: Lab Bench PSU
Post by: Brumby on September 01, 2016, 02:59:55 am
OK - Now we're just getting a bit picky.  Remember, this is the beginners section and the OP is not going to appreciate the subtleties just yet.

The key point here is that - whatever marketing influence has been expressed, the RMS value has some relevance to the discussion at hand.  Things like PMPO are just completely useless.
Title: Re: Lab Bench PSU
Post by: PotatoBox on September 02, 2016, 06:31:54 am
Just wondering but why aren't transformers as readily available as some other components? I don't have a problem salvaging parts but for example, I can go onto aliexpress and search for resistors, they're a dime a dozen. But when I look for transformers, all that comes up are wall warts and other power supplies. Why is that?
Title: Re: Lab Bench PSU
Post by: Brumby on September 02, 2016, 07:39:24 am
Because some sellers are advertising power supplies as transformers.

It's annoying, but not mysterious and boils down to 'common usage'.  Consumers often do not differentiate between the two.  As an example, when I was younger, I had an HO gauge train set, which was powered by my 'train transformer'.  In reality it was a stepdown transformer with a rectifier and a rheostat.  (Dave did a teardown of the very same unit not that long ago.)

There is no such 'common usage' for resistors or MOSFETs, so it's not a problem with those searches.  (I was going to add transistor ... except in the early days of solid state radio receivers, the transistor(ised) radio was often referred to as a 'transistor'.)

Maybe you could try a search term that includes some of the parameters you are seeking.


Oh good grief.....

Just tried doing a search on "toroidal transformer"    :palm:
Title: Re: Lab Bench PSU
Post by: MosherIV on September 02, 2016, 09:22:00 am
Quote
Just wondering but why aren't transformers as readily available as some other components?
2 main reasons :
1. they are heavy and note worth much so it is not economical to sell them, the postal costs out weigh the item costs when posting from China
2. they are not used much now, most PSU are switcher, so China based sellers do not have much access to cheap transformers
Title: Re: Lab Bench PSU
Post by: setq on September 02, 2016, 01:38:03 pm
I'm always buying transformers. Not sure why people think they not available. Perhaps from Chinese shit shifters they aren't but mainstream suppliers, no problems at all.