Introduction: USB Variable Voltage Power Supply

I've had an idea for a USB powered variable power supply for some time. As I designed it, I made it a bit more versatile allowing for not just USB input, but anything from 3 VDC to 8 VDC via a USB plug or via banana plug jacks. The output uses the type of jack you would see in a wall wart and two banana plug jacks. If you feed 5 volts into it, you can vary the output from 1.3 Volts to 20 Volts lightly loaded with lower voltages up to 200 mA. The front features a digital display that displays the volts and current going to the load. In the picture above, I'm supplying a mini oscilloscope with 9 volts at 120mA from the 5 volt USB supply from a laptop USB terminal.

Supplies

Parts

(1) 240 ohm resistor, 1/4 watt

(1) 67 k resistor, 1/4 watt

(2) 4.7 k resistors 1/4 watt

(3) 1 k resistors, 1/4 watt

(3) 2N3904 transistors

(1) IRF520 Mosfet or equivalent

(2) 1N914 switching diodes

(1) 1N4007 diode

(2) .01 uF ceramic capacitors (the schematic says 8 nF or .008 uF but .01 uF is easier to obtain)

(2) 10 uF electrolytic capacitors, 50 volt

(1) 470 uF electrolytic capacitor 50 volt

(1) 56 uH inductor (Can be wound on a small toroid if desired)

(1) 100k trim pot

(1) 5k 1/2 watt potentiometer, linear taper

(1) LM317 IC voltage regulator IC chip

(4) banana jacks (male)

(1) standard size USB jack (male)

(1) digital voltmeter ammeter module https://www.ebay.com/str/satisfyelectronics

(1) Housing https://www.alliedelec.com/product/pactec/cm69-24...

(1) Perf or prototyping board

(1) black knob with screw tightener

Heat shrink tubing

Various colors of hookup wire

Spade connectors (various sizes)

Heat sink and silicon compound for LM317

Tools

Soldering Iron, Solder, Hot melt Glue, Drill with drill bits, assorted screwdrivers, different types of small pliers, multimeter and oscilloscope

Step 1: Obtaining Parts

I intentionally used parts that are easy to find and can be salvaged off scrap electronic boards. The LM317 IC is very common and the 2N3904 transistors are general purpose and many different types can be substituted. The Mosfet is also very common and other types can be used as a substitute as long as the substitute is an N-channel Mosfet and has similar ratings. The inductor isn't critical and many in the range of 50 to 200 nH can be used. For this purpose, I salvage them from spent CFL bulb driver boards. Any type of project box can be used. I had this one on hand but a cheaper black one is perfectly suitable. As for using perf board, it's my personal choice for the ease at which modifications can be made.

Step 2: Theory Behind the Circuit

The above waveform photos show the progression of the waveform. The first one shows the waveform at the output of the astable multivibrator at the top of the right hand 1N914 diode. The second one shows the waveform at the gate of the IRF520 and the last one shows the waveform at the source of the IRF520.

The circuit uses a two transistor astable multivibrator running at 18 kHz. The square wave output is taken from the top of one of the two 1N914 diodes. The transistors are common 2N3904's. The low voltage square wave is boosted by another 2N3904 transistor which is biased class C. The transistor boosts the input square wave by a factor of about 10 where is passes through an electrolytic capacitor and 100k potentiometer before being applied to the gate of an IRF520 Mosfet. The Mosfet is wired as a step-up chopper with the source terminal having a 56 uH choke returning to the 5 volt supply. As the Mosfet is turned on and then abruptly turned off, the magnetic field in the inductor is formed and then collapses producing a back EMF. This back EMF voltage is allowed to flow through the 1N4007 diode and is in series with the source voltage. This charges up to the addition of the two voltages across the 470 uF electrolytic Ahead of the capacitor is an LM317 voltage regulator chip configured as an adjustable power supply which is adjusted by the 5k potentiometer. The unloaded voltage is adjustable from between 1.3 volts and 20 volts. A digital voltmeter and ammeter is wired into the circuit to give the proper voltage and current readings on the front panel.

Step 3: Build the Astable Multivibrator and See If It Works

Put the Astable Multivibrator together as in the picture. Power up with 5 volts and the waveform at the collector of the second transistor should look like the sawtooth in the second photo with the frequency being approximately 18 kHz.

Step 4: Add Buffer/amplifier and Boost Converter Sections

Once it has been determined that the astable multivibrator is working, you can add the buffer transistor section. The 100 K trim pot is added to set the level of the signal input to the Mosfet. After mounting the Mosfet, while taking anti-static precautions, install the diode and electrolytic capacitor. Before you install these parts you might want to experiment with putting them on an experimenter's board while trying various values of inductor. I took apart a bunch of CFL's and found the inductors to be perfect for this purpose, except that they got hot with any more than 100 mA going through them. I found this inductor to be perfect as it uses thicker wire. You can use inductors from 50 to 200 uH and you will get good results at this frequency. I would recommend driving the Mosfet from a function generator while experimenting. Go from .5 volt peak to peak up to 5 volts peak to peak. Put a voltmeter across the 470 uF capacitor and watch the voltage build up across the capacitor to many times the input voltage. Unloaded, mine went up to an excess of 30 volts. Make sure your 470 uF electrolytic is rated at least 50 volts.

CFL-Compact Fluorescent Light

Step 5: Add the LM317 Circuit

Once you're satisfied with the performance of the Mosfet boost converter section you can install the LM317 and it's heat sink. I found that the LM317 got hot, needing a heat sink but not the Mosfet. If the coil gets hot, you can make a heatsink from aluminum foil and some glue. I used a small piece of sheet metal bent around the coil loosely and glued in place with hot-melt glue.

Step 6: Drill Holes in Case, Attach Banana Jacks and Mount Digital Display on Front

Drill holes in front panel for potentiometer (1), (4) holes for banana jacks and (2) for USB cable and adapter type plug. Mount circuit board in position shown in picture and wire everything together. I found that the banana plugs that I used worked better with spade connectors connected to them. Some brands have solder connectors on the rear so it depends on the type of connector you use.

I secured the board on the base of the case with a bit of hot melt glue for easy removal if I want to make modifications to the circuit. The front piece of black plastic was cut to accommodate the meter panel face. It was secured with hot melt glue. Once all the jacks were in place in the rear, the panel was also held in place with hot melt glue.

Step 7: Final Assembly and Testing

The final item to wire into the device is the voltage/current module. The module comes with a black wire and a white wire, these go to the input voltage supply. The orange wire goes to sense the output positive voltage. There are two thick black and red wires, these go to the current shunt. These go in series with the output load to let you know how much current is being drawn by your load. The meters do not register if you put the polarity in reverse. I found that for some reason the current wasn't reading accurately for me so I had to experiment with different wire thicknesses and types. Once I got proper current readings, I soldered the wires directly to the terminals on the module, getting rid of the connections provided. This might have been a problem with just the module I was using.

This device will start working around 3 VDC input and at this voltage will give you up to 7 volts output at 60 mA. With 5 volts input, it will give you maximum 11 volts out at 120 mA continuously, without overheating any of the components. Better heat sinking will give you higher currents. This was well within the range that I wanted to use it for.