Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Newbie needs help with power supply

Status
Not open for further replies.

packet_loss

New Member
Hi guys, first time post here. I've recently decided to try again to learn a little more about electronics. This was started by finding a Velleman kit (K8006) in the clearance bin at my local electronics store. I finished the kit and did a damn good job, imo. I also built a small fm transmitter that doesnt work, atleast I have been able to get anything out of it.

I have tinkered with electronics for years (I'm 36 years old), so I'm not a total newbie, but there are some basics I don't fully understand. I have a nice breadboard and a decent selection of components and I'm ready to tinker! Currently I am trying to convert an atx power supply into a bench lab type supply. I removed the guts from the metal enclosure and mounted then in a cigar box. Today I will mount the terminals, trim the unused wires, install a power switch and an indicator led. I would like to install two analog readouts for voltage and amperage for one set of terminals as I would like for these to be adjustable, I will definitely need help with doing that right. At the moment I have a few things I need help with first, though. First, my power supply did not have any white (-5V) wires, can I do anything to create a -5V terminal? Can I take one of the extra +5V leads and somehow reverse it's polarity? My other thing is I have need for a 24VAC supply in order to run my Velleman project I built. I will also need to build a module before I can test it but getting a 24VAC power supply is my first goal. How should I build this? Can I get that from my atx supply by combining two 12V leads and converting that to AC? I don't even know if that's possible. I am at your mercy, guys.

Thanks for any help and I look forward to bein' skooled! Below are some pics of my first real soldering jobs.
**broken link removed**
**broken link removed**
**broken link removed**
**broken link removed**

My power supply
**broken link removed**
**broken link removed**
 
Last edited:
Nice work! Just one question/suggestion... are you going to put a fan or at least some vents on the power supply cigar box?
 
I am not sure about the -5V thing. Some (lots) of computer power supplies are made overseas and don't necessarily follow the wire coloring conventions of... well, anywhere. So you might go through with your multimeter and probe all the output wires to see if one of them is -5V. However, some of the lines are signal lines (like "standby" and "power OK") and can't supply much current. You also might just find another power supply, they are cheap and often free, and they all work the same way so taking it apart wouldn't be hard. Another way to get -5V is to just hook your project up to the +5V rail backwards.. but of course, then you can't use any of the other voltage rails for that project (so no positive supply).

As far as the 24VAC: you could try probing the output side of the transformer with your multimeter in AC mode... You might get lucky and find a 24V tap that you can just bring out. Otherwise you might have to go on ebay and purchase a mains transformer that outputs 24V. (is that 24Vrms you want or 24Vpeak?)

Can anyone weigh in on the wooden box thing? I know ATX power supplies have an earth ground connected to their metal enclosure since they have 110Vac. In a wooden box you would have no such protection. I am only wary because I blew an ATX supply up in my face one time by disconnecting the earth ground (was trying to hook two up in series to get 24V out, so I had to float the ground on one) ... I figure its probably okay since wood is an insulator.
 
I have an ATX power supply modified for the bench, holes drilled and screw terminals installed but I don't use it anymore, kinda a hassle. I've started using PS's from laptops or printers and i've got several. I had a laptop die but i kept the PS, it's 24V at 6 amps! One of my favorites came out of a old DVD player, compact board, half a dozen taps of various regulated power, no need for a 7805 on the breadboard.
 
I am not sure about the -5V thing. Some (lots) of computer power supplies are made overseas and don't necessarily follow the wire coloring conventions of... well, anywhere. So you might go through with your multimeter and probe all the output wires to see if one of them is -5V. However, some of the lines are signal lines (like "standby" and "power OK") and can't supply much current. You also might just find another power supply, they are cheap and often free, and they all work the same way so taking it apart wouldn't be hard. Another way to get -5V is to just hook your project up to the +5V rail backwards.. but of course, then you can't use any of the other voltage rails for that project (so no positive supply).

As far as the 24VAC: you could try probing the output side of the transformer with your multimeter in AC mode... You might get lucky and find a 24V tap that you can just bring out. Otherwise you might have to go on ebay and purchase a mains transformer that outputs 24V. (is that 24Vrms you want or 24Vpeak?)

Can anyone weigh in on the wooden box thing? I know ATX power supplies have an earth ground connected to their metal enclosure since they have 110Vac. In a wooden box you would have no such protection. I am only wary because I blew an ATX supply up in my face one time by disconnecting the earth ground (was trying to hook two up in series to get 24V out, so I had to float the ground on one) ... I figure its probably okay since wood is an insulator.
Good suggestions, thanks! I'm not sure if you can see in the pic but I took three of the black wires and soldered them to the ground post on the plug where my power comes in. Will that be good enough? It didn't work at all until I did that. Grounding is something that has always been a bit confusing for me, I don't know why it just has been. Here's a pic of where the plug is mounted on my cigar box. Sorry, it's not the best angle for seeing how I have the bundle of wires soldered to the plug.
**broken link removed**

I have an ATX power supply modified for the bench, holes drilled and screw terminals installed but I don't use it anymore, kinda a hassle. I've started using PS's from laptops or printers and i've got several. I had a laptop die but i kept the PS, it's 24V at 6 amps! One of my favorites came out of a old DVD player, compact board, half a dozen taps of various regulated power, no need for a 7805 on the breadboard.
I guess what attracts me to using the atx unit is having several different voltages to choose from. Am I missing something with laptop ps or what? What do you do if you need + and - 5v for logic and 12 for a motor or something at the same time? I know there is a reason as you know way more about this than I do, but I'm confused.

Here are some more pics of where I am with my cigar box ps. I am busy as hell with a few different things, so I don't get to spend a whole lot of time with it which makes it slow going. I think with you guys teaching me some basics though I'll end up with something I'm not only proud of but that I can use.

I just removed the 120/240 switch to de-clutter the inside of the box as much as possible.
**broken link removed**

**broken link removed**
Well, I seem to be getting what I'm supposed to be getting.
**broken link removed**

I am having one other issue, the indicator led on my switch isn't working. The package the switch came in didn't have any info about how to hook it up. I used my meter and found which two were for the switch and I assume the third one is to supply the led. I'm afraid I might cook the light so I've been afraid to hook anything up to it. I seriously need to learn how to use resistors and such. I have a very basic understanding of Ohm's law but I mean basic in the truest sense of the word. One of the things that I've never really understood is whether resistors change voltage. For instance, if I have a 12 volt supply and I need 9v at .5a how do I get it? With the right combo of resistors only or do I need a transformer? That right there is one of my biggest stumbling blocks to better luck when it comes to electronics. Who knows, maybe I someone is about to explain it in such a way that I finally get it and I will slaughter a thousand cows in that person's honor.
 
Good suggestions, thanks! I'm not sure if you can see in the pic but I took three of the black wires and soldered them to the ground post on the plug where my power comes in. Will that be good enough? It didn't work at all until I did that. Grounding is something that has always been a bit confusing for me, I don't know why it just has been. Here's a pic of where the plug is mounted on my cigar box. Sorry, it's not the best angle for seeing how I have the bundle of wires soldered to the plug.

I was merely concerned with electrical safety. I am not very experienced with it since I don't do much high-voltage stuff (high voltage being AC mains). But from some of the reading I did... the 3-pronged plugs have Hot, Neutral, and Earth (ground). For an appliance, your electrical power comes from the voltage difference between Hot and Neutral. The Earth connection is a safety connection which also provides a safe 0V reference point. Basically, if you have an electrical appliance with a metal chassis, you NEVER want the metal chassis to be at a high voltage if something inside it fails - otherwise someone would come along, touch it, and die, or get seriously injured. So what is done is the Earth prong is always connected straight to the chassis of the device. This way, if something happens, and for example the Hot lead frays or the insulation melts, and it touches the chassis, it will get shorted right to ground and blow the circuit breaker in your house. If the Earth connection was not there, the chassis would be at the same voltage as Hot and your house fuse would not blow. That is, until a person or object touched it and became the conductor to ground... but then its too late.

I think since you have a wooden box, though, that this would not be an issue. If something inside touches the wood, the box does not assume that voltage because it is an insulator.

Then the Neutral just gets connected straight to Earth, like I think you did, to give things a 0V reference compared with other household appliances.

Now, those 3 black wires. Were they from the OUTPUT side of your ATX supply? i.e., are they the black wires that used to be in the motherboard plug and molex connectors?
While it is SAFE to make the connection between your black 0V output wires to EARTH (its not safe to connect them to Neutral or Hot), I am not sure why this caused everything to work. Usually these outputs are floating.

It is possible that your particular ATX power supply was designed so that something on the output side referenced Earth though. If this is the case, the connection was probably made by a screw through the PCB connecting to the metal chassis (which was connected to earth) to some trace on the PCB that the screw also went through. If so, when you removed the metal chassis, you broke this connection and caused something not to work. By completing the connection by connecting those 3 black wires, everything is back to how it was designed. This is what seems likely to me, but without a full schematic of the ATX supply its impossible to know what the designers did for sure.

I guess what attracts me to using the atx unit is having several different voltages to choose from. Am I missing something with laptop ps or what? What do you do if you need + and - 5v for logic and 12 for a motor or something at the same time? I know there is a reason as you know way more about this than I do, but I'm confused.

I think what he did was have several different supplies if he needs more than one voltage rail. If you need different voltage values and you don't have the right supply, there are circuits you can build that will change it to what you need. One such circuit involves an IC he mentioned, the LM7805. It is a linear voltage regulator, that will output a pretty solid 5V even if the input is 24V. You can also make them adjustable, to output any voltage you want between 0 and about 22V, given a 24V input.

I am having one other issue, the indicator led on my switch isn't working. The package the switch came in didn't have any info about how to hook it up. I used my meter and found which two were for the switch and I assume the third one is to supply the led. I'm afraid I might cook the light so I've been afraid to hook anything up to it.

Do you have a part number and manufacturer for the swithc, or a link to the page you bought it from? Even some info from the name of the part, like "common anode LED," whether the LED is red or blue or white or whatever, things like that. Cant really tell from your pics, is it something like this?
SPST 10A 12VDC Illuminated Push Button Switch with Red LED - RadioShack.com

I seriously need to learn how to use resistors and such. I have a very basic understanding of Ohm's law but I mean basic in the truest sense of the word. One of the things that I've never really understood is whether resistors change voltage. For instance, if I have a 12 volt supply and I need 9v at .5a how do I get it? With the right combo of resistors only or do I need a transformer? That right there is one of my biggest stumbling blocks to better luck when it comes to electronics. Who knows, maybe I someone is about to explain it in such a way that I finally get it and I will slaughter a thousand cows in that person's honor.

Changing 12V to 9V with a max output current of 0.5A is a little more complicated than using resistors. And if the voltages are DC, you can't use a transformer either!

You CAN "change" voltage with resistors (for instructional purposes, I dont like to use the word "change" since the original 12V is still there - it's the "input" and the 9V is what you want at the "output"). The circuit is called a Voltage Divider, and you might google that term, but you don't want to use that circuit for building power supplies. A voltage divider will only give you the right voltage output if you are drawing a very small amount of current from it. As you draw more current, the voltage will change, which isn't very useful. This is the concept of Loading in electronics, and its important, especially for power supplies.

By the way, please stop me if I'm being too basic. I don't want to insult anyone but I don't want to leave out crucial fundamentals either.

You might know what series and parallel combinations of resistors are. If not, here's a primer. So basically if you have two 10Ω resistors in series, you can just call it one 20Ω, which makes life easier. Similarly, if you have two 10Ω in parallel, you can call it a 5Ω. Three 10Ω in parallel gives 3.33Ω, and so forth.

(again, sorry for being basic but its a crucial idea to the discussion and I don't know what you know, so excuse me)

If you work out the equations of a voltage divider (which is a SERIES connection of resistors, with a point at the middle you can take your output from), you will find that the voltage at that output point is dependent on the value of the top and bottom resistors. From that wikipedia page, Vout = (R_bottom / (R_top + R_bottom) ) * Vin

You have Vin = 12 and you want Vout = 9. You can pick just about any combination of resistors that gives you the right ratio, but let's say you chose 3Ω for the top and 9Ω for the bottom. Thus, you have 12V * (9Ω / (9Ω + 3Ω)) which will give you 9V. Alright, so we have 9V, now why don't we want to use it for a power supply?

ANY circuit you hook up to this 9V will have what is called an "input impedance." (we will call it input RESISTANCE since we are only doing DC calculations). This basically means that, as far as the power supply is concerned, any circuit you hook up to it just looks like (can be modeled as) a single resistor to ground. Your multimeter won't show this if you measure the circuit by itself. The reason you can model any circuit this way, FROM THE POWER SUPPLY'S PERSPECTIVE, is that every circuit draws some amount of current when it is in use. You know Ohm's law - V = I*R. So lets say you have some big complicated circuit (perhaps an IC) that you know requires a 9V supply and draws 1A of DC current when operating. What is its "input resistance" from the power supply's perspective? Just use Ohm's law. V = IR --> R = V/I. R = 9Ω. So if you hook this IC up to your power supply, it is (almost) just like hooking a 9Ω resistor up. If your supply can't deliver 1A, you have a problem! The voltage from your supply will sag.

How does this affect the voltage divider circuit?

You have R_top as 3Ω and R_bottom as 9Ω, right? Well, lets say you want to use this 9V supply you have created to power the above circuit that draws 1A at a 9V supply. We calculated that it's input resistance is 9Ω. The circuits would look like:

Voltage Divider

The one on the left is the voltage divider circuit before attaching the load. On the right is what it looks like after. Remember that R_top is 3Ω and R_bottom is 9Ω. Well, R_load is now 9Ω. So, remembering back to Parallel resistor combinations, we can now write the parallel combination of R_bottom and R_load as one resistor... it comes out at 4.5Ω. If we re-calculate the voltage output of our divider, using the NEW R_bottom, it is:

12V * (4.5 / (4.5 + 3) ) = 7.2V

The output has sagged almost two volts. In the case of a sensitive IC, this will not suffice. Keep in mind that this is a very simplified exercise. In reality, an IC would probably start to draw less and less current as the supply voltage sagged, and you might end up with something like 8V when the two effects equalized. But 8V is still not 9V, so this exercise serves to illustrate the idea of input resistance at least in concept. This is exactly what you would see if your "complicated circuit" was simply a 9Ω resistor.

You might be thinking that you will just use smaller resistors on the voltage divider - say you used 0.3Ω and 0.9Ω. This would still give a 9V output. And if you are using the 9Ω input resistance circuit still, you can calculate what the equivalent new R_bottom would be:

using the quick formula for two resistors in parallel, R_bottom_new = (.9 * 9) / (.9 + 9) = 0.818Ω

The new R_bottom is now much closer to its original value, even after the load has been added. So the new Vout becomes:

12V * (0.818 / (0.818 + 0.3)) = 8.77V

8.77V is much closer to 9V. So this might be an acceptable solution if you reduced R_top and R_bottom even more, maybe to 0.03 and 0.09. And it would be - even for loads that require lots of current.

But, when you do this, you start to dissipate a LOT of power in the voltage divider. Even with R_bottom = 9Ω and R_top = 3Ω , the divider uses 1A just by itself (with no load). You can see this because R_top and R_bottom make a series connection for a total of 12Ω, and by ohms law, 12V / 12Ω = 1A. If you change the resistors to 0.3 and 0.9, you will draw 10A, and 0.03 and 0.09 will draw 100A! from a power perspective, this means you would be drawing 1.2W, 120W, or 1200W, continuously, all the time that your power supply is on. This isn't very efficient.

So you can see that a voltage divider will do the trick for very very low current loads, but not for much else. And they are not efficient at all. There are other circuits that will let you connect much higher current loads without needing to draw 1200W all of the time. Such circuits are known as Linear Voltage regulators. They are easy to build and you can make an adjustable voltage source out of them that is good to about 0.5A, or even more if you heatsink the chip. Chips like the LM317, LM7805, LM7812 will give you adjustable, 5V, and 12V outputs, respectively. And they are cheap and much more efficient than voltage dividers. If you want to try one they are really useful and theres thousands of tutorials online for it. Just type in "LM317 circuit" or something like that.

For more efficient DC conversion, there are also switching power supplies, but their operation is a little more complicated. They can achieve really high efficiency though. Your ATX power supply is actually a really big switching power supply (which is why they are so efficient), but they also make small chips you can buy that do switching power regulation with maybe one external inductor and capacitor - both the ATX supply and the chip operate on the same principle though.


Hopefully this helped out a little bit and gave you some examples of how to use Ohm's law and some useful insight and intuition into how circuits work. Sorry for being long winded, I consider it practice for when I start teaching this stuff. Good luck in your future circuit work, I am always happy to try and make another convert.


EDIT: accidentally put lm314 instead of the correct LM317. post has been corrected.
 
Last edited:
Here is the switch I have. I see now under the 'Tech Specs' tab it needs 12V, so I guess I need to hook up one of my extra 12V lines to it.

Man, please don't worry about being too basic for me, I needed to hear all of that. What an awesome reply! Thanks man, I really appreciate you taking the time. I'm about to read it all again so I can put together any questions I have and I'm sure I'll have a couple. Thanks again!
 
Well I just hope it helps with the understanding. Any questions you have I would be happy to answer.

As far as the switch, I'm not sure. They really should post datasheets. Sighhh....
What, exactly, are you using this switch for? Because it is only rated for 12V, DC. If you have this cutting the circuit on the side that plugs into the wall you might get a surprise when you hook it up, since then it will be blocking 120V, AC instead of 12V, DC. If you are just controlling the outputs ("project" side) of your power supply it will be OK.

You said you had used a multimeter to test which two contacts were the switch leads and which contact was for the LED, correct?
If your multimeter has a Diode Tester you might try using that between each of the two pairs of leads that connect to the LED to determine which direction the LED points (whether the third lead of the switch is its anode or its cathode). Another test might be to take a 9V battery and a 100ohm resistor. hook one end of the battery to one of the switch contacts and the other end of the battery to the resistor. Then touch other switch contacts with the free end of the resistor to see what makes the LED light up. Might take a few tries, and you will have to make sure that it lights up correctly in the switch positions you want, but seeing as you don't have a datasheet for the switch its the only way to find out.

The switch might have an internal resistor for the LED so if the LED barely lights up when you test it, or doesnt at all, try a smaller resistor.

My guess is that the LED cathode is wired to the switch "output" lead, so that when you flip the switch the LED gets a positive supply and can light up. Thus, whatever lead you have determined to be the LED lead, you probably want to connect to a resistor and then to ground.

[....................[SW]
IN__________/ __________OUT
[.......................|
[....................[LED]
[.......................|
[...............[RESISTOR]
[.......................|
[.....................GND

sorry for the ascii art but I dont have my schematic software on this computer and I have to get going. Good luck!
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top