Step 8: Moment of Truth

Step 9: Possible Improvements and Modifications

This circuit is highly adaptable. You can adjust the values of R1 and R2 to suit whatever components you have on hand. I actually designed my person...

A key component of any electronics project is the electricity. You could use endless amounts of batteries, or use a simple, compact power supply to power all of your electronic projects. This is a great beginners electronics project for those just getting into electronics, or a fun project for those who haven't wanted to drop the cash for a commercial model. This circuit is capable of supplying a variable voltage output from 1.5 volts to 12 volts.

Step 1: The Parts

All of the following components can be found at your local RadioShack. You can also scavenge most all of these parts fairly easily from old electronics.

1 LM317T Adjustable Voltage Regulator - 276-1778This is the adjustable voltage regulator. It takes input from two resistors (R1 and R2) and then ratchets the voltage down accordingly. I recommend you take a look at the datasheet if you want to learn more about this part.

1 0-5K Linear Potentiometer - 271-1714This is R2, and will allow us to control the voltage output.

1 560 Ohm Resistor - 271-1116This is R1.

2 1N4001 Diodes - 276-1101There are two diodes to protect against short circuits. D1 will protect the regulator from the capacitors discharging if the input power is short circuited. D2 will protect the regulator from the capacitors discharging if the output power is short circuited.

1 .1 uf Capacitor - 272-135This capacitor (C1) acts as a smoothing capacitor. It should be only a ceramic disk capacitor.

1 10 uf Capacitor - 272-1013'This capacitor (C2) improves the transient response of the regulator. It should be electrolytic.

1 PCB mount SPST switch - 275-645Allows you to turn the power on and off without unplugging the wall-wart.

1 PCB mount terminal strip - 276-1388This is mounted directly to the PC board and is an easy way to connect your power supply to many different circuits and components.

1 12v Wall-WartProvides the power to the circuit. RadioShack has a nice selection, but I recommend salvaging your own as I did. Anything will work as long as the output current is no more than an amp. I choose one that has an 800mA output, but anything over 500mA should cover most basic electronics projects.

1 Small Perfboard - 276-148This particular board is the perfect size for this circuit, and my layout is based on it. This is a perfboard, but if you wanted to make your own PCB, feel free to use the attached EagleCAD schematic to generate your own layout.

1 Heat Sink - 276-1368A good precaution. The regulator has built in protection to prevent it from burning itself up, but it does that by limiting current. If you didn't have a heat sink, you might find that you have less current output than you expected. Any piece of metal will work as long as you can attach it metal-to-metal on the tab. Even a large alligator clip will provide decent heat dissipation.

Potentially... You just wire up an old/cheap voltage meter/multimeter in parallel with the output, then have a seperate fixed voltage from the 'power in' connected to the battery terminals of your meter, obviously at the corect voltage. Oh, then stick it all in a box :)

Never mind. I think I figured it out. Using the formula from the LM317 datasheet and plugging in the total resistance of my pot (which actually measures at around 420ohm), I played around with the numbers and got 47ohms for R1.

i don't understand if it's for AC or DC or both? i looked through the regulator's datasheet with no conclusion... does your "wall wart" have a diode bridge to convert to DC or is it just a transformer in a plastic casing?

i want to use a 200/9V transformer, but i don't know if i need to convert it before or after the rectifier??

It should say on the adapter/wall wart input ~120v input, which is ac, and output if its ac would have a tilda, like ~24v, or dc is ---24v, but thats if it doesn't specifically say ac/dc. All adapters, plugs, chargers etc have this information printed or stamped on them so just take a look at it and see.

If it doesn't by some chance have it, you can test the voltage with a multimeter, ac voltage has an average voltage of zero, so if it tests zero on the dc range of the multimeter then its ac voltage.

well yeah, that's common sense, but does the LM314 work with AC or DC? or both? the transformer i'm gonna use will put out around 9V AC. so my question is do i need to convert it to DC before it goes into the regulator, or after it?

I have to ask, but why wouldnt you just hook up a multistage voltage multiplier from a small transformer and regulate that voltage? Seems to me to be much easier than building a power supply, so Im thinking there must be a good reason. Better quality power?

Some folks at National Semiconductor agree with you and they have circuits with break away resistors in their applications guides. I've even made this circuit with radial switches connected to banks of resistors myself. DIP switches is another way to go but then you'd have to make sure you only had one switch, or possibly the correct combination of switches closed for the voltage you wanted. Confusing and prone to human error to say the least!

You can even connect this device up to digital control and those circuits are common and schematics are obtainable.

In the end a potentiometer and a meter is the simplest and most flexible configuration so I tend to use it the most. Anything else is much higher parts count and more work to build, while netting less fine control.

But yeah the uses the LM317 has been put to are virtually endless. The circuit here is excellent.

Several other instructables refer to this same project. it is indeed a pity that, as another reader already remarked , the pinout doesn't correspond with the schematic. I did it as it appears there and all i got was 40 mah max, using the pot between pin 2 and ground. I reversed it , all is fine now. Pity i burned the only good 50k pot i had. before noticing it should go to pin 1.(All for the sake of learning)

BEWARE!! CORRECT PINOUT IS : 1 ADJ, 2 VOUT ,3VIN .

I strongly suggest you fix your instructable, which otherwise is great.

ha ha that reminds me of one time I built a power supply and used the data on the back of a Radio Shack blister pack and it was wrong. What was funny was I got all done with it at like 2:30 in the morning and I was all excited and I just had to power it up before I went to sleep and blammo! One of my voltage regulators blew up like an M-80! It was a multi regulator power supply the whole thing was pretty complex.

Bear in mind I was a little kid and in my bedroom doing this at 2:30 in the morning. The device completely exploded all that remained was the center leg that is attached to the back tab sticking out of the board I had it soldered to. The rest completely vaporized.

The one that let go on me was a 7812 or some other fixed regulator. This is going back a number of years now so I cannot remember exactly. What I do remember is that thing was loud! I kept on waiting for my Mom to come into my room to see why I was lighting off fireworks in there but thankfully she must have slept through it or something I don't know.

I was pretty peeved too because I checked my work and it was "right" as per the data I used for the device. Just that information was wrong. So yeah it does happen. Even from sources you don't expect it to!