## Introduction: Battery Powered Power Supply, Selectable Voltage

This is a battery powered, self contained, power supply switchable between 3.3, 5, 6, and 9 volts. It uses an LM317 variable voltage regulator and a rotary switch to select the voltage. Twelve volts are available directly off the eight double A batteries.

To build this power supply you will need:

* The resistors are all 1/4 Watt 1% Tolerance. I purchased this resistor kit a while back, it had all the resistors I needed. It contains five each of all the common values up to one meg.

## Step 1: Assembling the Circuit Board

Follow the schematic and build the board like in the picture.

Leave the wires running off the board about six inches long, you can cut them to length later.

The red and black wires toward the top right in the diagram are soldered to the back of the board. They go to the battery and on/off switch.

The black and red wires running off the left side of the board are the switchable output.

The five wires soldered to the top side of the board and running off to the right are the wires to switch voltage:

• Yellow = 3V3
• White = 5V
• Green = 6V
• Blue = 9V
• Black = common

The output pin on the LM317 voltage regulator is connected to the heat sink tab and the tab will be attached to the aluminium base to act as a heat sink, so the case must not be used as a ground. The ground is the ground rail on the circuit board.

The voltage supplied by the LM317 voltage regulator is controlled by the resistors and determined by this formula:

Vout=1.25*(1+R2/R1)

In this case the R1 is the 220 Ohm resistor and the combination of resistors switched in is R2.

## Step 2: Drilling the Holes in the Case

Start by drilling 3/32 pilots for all the holes, each hole will be opened up to 1/4 inch unless I indicate differently.

Find the center of the front panel and drill the first pilot hole here. It is hard to drill large holes in thin sheet metal so I like to use a conical reamer like the one shown in the second picture to enlarge the holes.This hole is drilled 1/4 inch and then enlarged to 3/8 inch. I purchased the conical reamer at Ace hardware.

Next drill holes 1 and 1/14 inches each side of the center hole.

Drill holes 1 and 3/4 inches from each side of the center hole.

Drill a hole 7/16 directly below the center hole. Drill this pilot out to 9/64 inches. This hole is for the locating pin on the rotary switch.

Place the speaker terminal in the holes to the left and right, locate and drill the holes for the mounting screws.

Drill a hole in the bottom centered side to side and about 1 and 1/2 inches from the front. Drill this pilot out to 9/64 inches.

With the back panel facing you the hole for the on/off switch will be located centered top to bottom and 3/4 inches from the right side. This pilot will be drilled out to 1/4 inch and then enlarged to 1/2 inch.

Place the battery holder against the back wall of the chassis with the batteries pointing left to right. The connector for the wires should be in the top, back, left corner. Drill two 1/4 inch holes close to the battery holder about 1 and 1/2 inches from the back of the chassis. Do not cover the hole for the rubber foot in the back right corner on the chassis.

Try all the parts and make sure they fit. Pay special attention to the output terminals. the contacts can not short to the chassis. If you need to enlarge some holes to make sure everything clears that is okay. (I had to, my layout was not perfect.)

Deburr all the holes on the inside of the chassis and sand the paint off around the hole in the bottom so the voltage regulator can make good contact to it's heat sink.

## Step 3: Mounting Parts and Wiring

Use a digital multimeter or continuity tester to figure which contacts to use. Pick a center (common) contact and find the four outer contacts in connects to. Turn the knob all the way to the left and remember which one this is. It will be the 3.3 volt contact. Bend the contacts a little bit to mark the contacts you want.

Cut the five wires off to about three inches and solder them to the switch.

• Yellow = 3V3
• White = 5V
• Green = 6V
• Blue = 9V
• Black = common

Mount the switch in the center hole.

Place a little thermal paste around the hole you drilled in the bottom and use a machine screw to attach the voltage regulator to the base.

Mount the two output terminals using the #6-32 machine screws. Make sure the terminals do not touch the chassis.

Solder the red and black wires from the front of the circuit board to the terminal block on the right.

Solder a red and a black wire about 8 inches long to the two terminals on the left terminal block.

The two black wires and the black wire from the battery are soldered to one terminal on the off side of the switch.

The two red wires are soldered to one terminal on the on side of the switch. The red wire from the battery is soldered to the other terminal on the on side of the switch.

Use the wire tie to hold the battery holder in place. Connect the battery wires to the battery holder.

Use the screws supplied to attach the rubber feet and the top cover.

## Step 4: Testing

My first test was to let it run for two hours hooked up to two Attiny85s each with one LED constantly on and another LED blinking, An Arduino with one LED blinking, and an Attiny84 with one LED constantly on and a binary counter program with eight LEDS attached. Nothing was hot to the touch.

My next test was to measure all the voltages. I did my measurements with a 4.7 K load.

3.3 Volts measured 3.3 Volts.

5 Volts measured 5.02 Volts

6 Volts measured 6.06 Volts

9 Volts measured 9.12 Volts

12 Volts measured 11.84 Volts