Step #1: MaterialsPrevNext
- LM317 Adjustable Voltage Regulator,
0.1 µF Capacitor,
1 µF Capacitor,
220 ohm Resistor,
7 x 270 ohm Resistor (preferably 1/8 watt),
8-Position DIP Switch,
9V Battery Connector,
2 x Alligator Clip Wires,
- Note: All these parts are available at Radio Shack. I highly recommend using 1/8 watt resistor because they take up less space on the board which makes it easier to fit everything into a smaller space. Unfortunately I only had five 1/8 watt resistor so, I had to use two 1/4 watt resistors.
Step #2: The CircuitPrevNext
- The standard LM317 regulator circuit uses two resistors to set the output voltage according to this formula:
Vout = 1.25V x (1 + (R2/R1)) + (Iadj x R2).
Since Iadj is small (about 0.1 mA), the formula can be simplified to Vout = 1.25V x (1 + (R2/R1)) as long as R1 is also relatively small. Because of this, R1 is generally kept to about 240 ohms. R2 is then selected to get the desired output voltage. Often a a variable resistor is used for R2 to make the circuit adjustable.
- The circuit for this project has one major modification to it. The variable resistor R2 is replaced by an array of resistors and switches. This allows the output to be adjusted in discrete increments. I did this to more easily simulate individual batteries. Each switch effectively represents a battery being connected or disconnected.
- Turing on switch 1 turns on the circuit and brings the output up to 1.25V. Then with switches 2 through 8, turning the switches off in order will each increase the output voltage by about 1.53 volts. Example: Initially switch 1 is off and switches 2 through 8 are on. Turning on switch 1 gives an output of 1.25V. Then turning off switch 2 gives an output of 2.80V. Then turning off switch 3 gives an output of 4.33 and so on.
- The circuit can use either a 9V battery or a 12V battery pack as a supply voltage. The output will max out at about 1.5V below the supply voltage (7.5V for a 9V battery or 10.5 for a 12V battery pack.) But this isn't a problem because if you need the full supply voltage of the battery, then you can just hook the battery up to the circuit directly.