
From time to time we’ll be posting shortcuts and hacks we use around the workshop that make a task easier and less expensive.
Here’s one example: a variable voltage regulator. We wanted to adjust the output from a 12 Volt solar cell to power projects needing lower voltages. The solution: construct a variable voltage regulator using an LM317, a fixed resistor and a potentiometer.

The LM317 is designed to provide output voltages of between 1.2 and 37 volts at 1.5 A. Depending on your project’s current needs, be sure to use resistors of a sufficient wattage.
Easy resistor/voltage calculations can be made using any of the online calculators such as this one from Reuk.co.uk.
The actual formula used to calculate values is:

Using the values show in the above schematic (1.2K fixed and a 20K pot) results in an output voltage range of between approximately 1.2 and 22 volts.
If you want to add filtering to this project, see the data sheet for info on adding capacitors and protection diodes.
We packaged this project inside an old medicine container since it was the right size and shape to accommodate these few components, and made it easy to mount the pot on the top. Once you’ve calibrated the potentiometer vs voltage adjustments, you may want to mark the values you often need (1.8, 3.3, 5.0 V) for easy adjustment later.
This is a quick and easy build with a minimum of components providing a gadget that you’ll use often and wonder how you did without. Could even qualify as a Dangerous Prototype if you were to try to carry it onto an airliner…

“Depending on your project’s current needs, be sure to use resistors of a sufficient wattage.”
Wait, I thought the ADJ pin was high impedance. Shouldn’t the wattage of the resistors only be a function of the output voltage?
@Kenneth: That’s what I thought. I just finished making a Velleman kit from Radio Shack that uses the LM317 and when I was trying to determine the resistors I needed to use to get the voltage I wanted, the online calculator I used said that the resistors were only passing about 9mA, which I verified when it was all breadboarded.
I’m still questioning the resistors I’m using, but it works for the purpose I had intended. (Stair LED lights were WAY to bright at 12v. Had to drop the voltage to 8v so my neighbor wasnt getting blinded at night.)
Great case!
The LM317 looks like a constant current source to R2 with a programmed current of Vref/R1. The standard R1 is 240 ohms, which leads to a ~5 milliamp current. The power dissipated in R1 will then be that times the voltage drop: Vout – Vref. To reach .25 watt you would need a 50 volt output. Even with a 1/10 watt resistor you would need an output voltage of 20 volts to exceed the rating. Running a resistor at maximum power is not recommended if you need accuracy as the resistance will change with temperature, but still: ordinarily the power rating of the resistors is not important.
The standard feedback resistor value is actually chosen for a reason: the LM317 has a minimum output current which, if not met, will cause loss of regulation and the output voltage will rise above the setpoint. The 240 ohm R1 meets this minimum requirement. For many applications this results in an annoyingly small potentiometer. If you increase R1 you may need an extra load resistor to guarantee the minimum load current is met.
Cool hack! Only needs some vent holes and a way to anchor it in the work area (added weight in the empty space?)