This project is deadly dangerous as it involves working with electricity. By reading this article you are agreeing to hold me and all related people and entities completely harmless of any outcome from reading this article or building the project, including but not limited to property, harm and even life. DO NOT ATTEMPT this unless you know how to handle electricity safely. Always have a fire extinguisher ready and wear eye protection. Never work with electricity alone. Keep in mind that even low voltages can kill and mains (household) power more than qualifies and WILL KILL YOU if not handled properly.
Adjustable Power Supply
I needed a bench top power supply with adjustable output. I wanted it to have connectors to attach my oscilloscope so I can monitor the wave form and some other features. The problem is they are well over $300 for a nice one. So I decided to make one out of some spare components I had and a few cheap parts from my local electronics surplus. This article represents my first attempt and doesn’t yet have all the features I want. However, it will allow me to build on to it.
The first step was to find a transformer that would work. I used a 5:1 ratio transformer capable of stepping 120VAC down to 24VAC. Of course transformers are simple devices where a primary winding induces a charge on a secondary winding. They can even be used in reverse if no components are specifically preventing this. You can find then with center taps, multiple secondary coils and in all kinds of other configurations. I just used a basic step down transformer with a single primary and a single secondary coil.
I took an old computer power cable, cut the end off and stripped the insulation back. That gave me a black wire (hot), a white wire (common) and a green wire (ground). I had a problem though. My transformer did not have the primary and secondary sides marked. The wires were colored black and white on one side (which I was pretty sure was the primary) and blue and grey on the other side. To verify this I checked the impedance of each side by attaching a voltmeter (set to ohms) to both wires on one side of the transformer. Then repeated it on the other side. I knew that the primary side should have 5x the wire that the secondary should have, since this is a step down transformer, so the impedance should be higher. Sure enough the primary side showed 1.4 ohms while the secondary side showed .1 ohms. Of course this won’t give you the ratio but it’s good enough to identify which winding is the primary and which is the secondary.
So once I had the power cable hooked up white to white, black to black and ground to the casing of the transformer I tested the output. Sure enough that gave me about 24VAC output. With my combo meter/oscilloscope I was able to see about 26VAC at a steady 60Hz (since I’m in North America). I also tested the case with the ground unplugged to be sure there were no shorts to the casing that could shock me. The transformer was in perfect working order. Time to move on to the next step.
From here we have a steady sine wave (alternating current or AC) that oscillates above and below reference 60 times per second (60Hz). Think of this like the constant rolling waves of an ocean. My power supply should produce direct current (DC) though. Direct current should have a steady signal (think calm perfectly flat lake) that’s always above reference. Luckily there’s a handy little device that will “flip” the dips in a sine wave that go below reference to above reference. The device is called a bridge rectifier (or diode bridge). Since the signal doesn’t dip below reference anymore we technically have a messy DC signal from an AC source. Of course you can build your own bridge rectifier if you don’t have access to one by using 4 diodes as shown in the “basic operation” heading of the bridge rectifier Wikipedia page. They should be put together in the shape of a square with the bands touching on 2 corners and the non-banded ends touching on two corners.
The diodes will allow voltage above reference to go through two of the diodes and below reference to flow through the other two. This will essentially convert an AC voltage to DC, but it will be a messy wave form. The signal will look like a bunch of little hills one right after the other. This is no good to power sensitive electronics so we will need to clean that up next.
To clean up this signal and steady out the current we will need a large capacitor. In my example I’m using a 1F (Farad) cap. You will take the positive side of the bridge rectifier output and connect it to the positive side of the capacitor (side without the stripe). Then connect the negative side of the rectifier output to the negative side of the capacitor (side with stripe). This will fill the cap with a charge and allow us to draw from it at a steady rate.
To visualize this let’s think of water, which is generally an acceptable analogy for electricity. We need a steady flow of water (electricity), but we are using a hand pump to move the water. Every time we depress the pump handle water comes out but when we pull up on the handle there is no water being delivered. This relates to the wave DC wave form we have where it curves up, but comes back down to reference and then repeats. At reference there is no current (flow). To fix this we need a capacitor. In our analogy this would be a bucket.
We will be pumping water into the bucket, then on the other side we will have a hose coming out. As we keep pumping the amount of water in the bucket will vary, but as long as we don’t take too much out at once the hose will always have a steady flow of water. This effectively gives us a constant, steady flow of water (electricity) from an uneven source. From here we have to consider how much water we want out to determind how big that bucket will need to be. If your capacitor is too small and you’re drawing too much you will get what’s called a sawtooth wave form instead of a straight line. This means your capacitor (bucket) is running low and can’t deliver what you require from it. Think about a smaller bucket and a big hose in our example. The water would run out before more could be delivered giving you a mostly steady flow with a little drop off at the end. As you try to draw more the problem will get worse. There are equations to obtain the correct capacitor size ((5 * Io)/(Vp*f)) where “Io” is the current you’ll draw, “Vp” is the peak voltage and “f” is the frquency. Keep in mind that after the rectifier the frequency is doubled (120Hz).
Once you find the size that’ll work for you, you should have a fairly steady signal. From here we want to guarantee a particular voltage. That is where a voltage regular such as the infamous LM317 comes in. I am using an LM350K for my project. The LM317 voltage regulator will accept an input voltage difference of up to 42V (depending on heat dissipation). This means that if you are sending 60V into the VR then you can go down as low as 18V output as long as you are removing the heat properly. You can also use a fixed output voltage regulator if you wish.
This leads me to the topic of heat dissipation. In order for the VR to reduce the voltage, that energy has to go somewhere. This is the same as with a resistor. The more you try to drop the voltage, the more energy has to be removed from the system. It does this by resisting the flow, converting that electrical energy into heat energy. If you don’t find a way to dissipate that energy it will build up, eventually turning into light energy and then fire as it glows and then burns up. To remove this heat energy faster than it can be produced you have to mount the LM317 to a heat sink. This is an aluminum or copper block, generally with cooling fins to increase surface contact with the surrounding air. The heat energy is then radiated, transferring to the air.
To use this voltage regulator we wire the positive side of the capacitor to the Vin (voltage in) side of the regulator and the Vout (voltage out) pin will produce our regulated voltage. You will notice one more pin (adjust). This will be wired to either a resistor for fixed output or a potentioneter for variable output. Let’s call this second resistor R2. The R1 value will be a resistor that needs to be soldered from the voltage regulator’s Vout pin to the adjust pin. We will use the formula (1.25 * (1 + (R2/R1))) to determine the voltage out. The R1 value should typically be low, generally under 500 ohms. Then calculate the remaining formula to determine R2. If we use an R1 value of 100 ohms this means that the R2 resistor should be 860 ohms to produce 12v output.
So we wire the regulator’s adjust pin to our potentiometer’s wiper or adjust pin. Then the input pin of the potentiometer goes to the negative side of the capacitor. This will allow us to adjust the output voltage of the regulator by turning the potentiometer dial, in effect using the potentiometer as a variable resistor or rheostat.
So now we effectively have a variable output power supply. There are a couple more things we should do though. First we want to add another capacitor to the output. It should be a .01 to 1 uF (microfarad) ceramic, 1uF tantalum or 22 uF electrolytic capacitor. The positive side will be connected to the voltage regulator outout and the negative side will be connected to the same negative terminal that went into the potentiometer, on the larger capacitor side (not on the voltage regulator side). Without going into too much technical detail, this will keep the voltage regulator from becoming an oscilator and will improve transient response.
You’ll also want to add a couple of diodes. The first should be between the voltage regulator’s output and input pins with the band facing the input pin. This will keep the voltage regulator alive if you connect the power supply to a power source such as a battery or capacitor. The second diode should be soldered between the adjust pin and voltage output pin with the band on the voltage output pin.
Some things to keep in mind with this project are to know what your destination voltage and current draw will be. This defines what kind of heat sinks you need on the voltage regulator and possibly bridge rectifier. Know what your voltage regulator is capable of providing and whether it will handle the heat build up and whether you can dissipate enough heat. Look online for formulas to calculate heat dissipation and heat sink size for the LM317.
Keep in mind that the source voltage and current CAN KILL! Take appropriate cautions when working with mains voltage. Even the output of the regulated voltage has enough current to kill even at lower voltages so take precautions! Also capacitors remain charged even when the circuit is dead so be careful. If you don’t understand what you’re dealing with either do not build this project or get an experienced friend to help. Always keep a fire extinguisher handy. Electronics can fry and even catch fire. Components can explode without warning, taking hot or fiery pieces with them so a fire extinguisher is required and eye protection is recommended. Smoke from burning electronic components is unhealthy to breath. By reading this article you are agreeing to take proper precautions and to hold me and any related people or entities harmless of any direct or indirect outcome resulting from this article. You are taking all responsibility into your own hands and are waiving all rights to pursue any form of damages, injury or the like.