Sunday, April 19, 2015

Regulated 5V Power Supply


Taking a break from the book experiments, I decided to make my own 5V regulated power supply, since we've been including it in many experiments.

This took WAY longer than it should have. I though it would take an hour--instead it took most of two afternoons, including 2 trips to Radio Shack.  The first day was setting it up on a breadboard so I could replicated it on a PCB.  I made a bunch of stupid mistakes...finally took it all apart and re-did it and it worked.

The second day was taking the model and putting it on a PCB.  I wanted it on perfboard, and I wanted header pins to plug into a standard breadboard.  Plain perfboard does not facilitate soldering. I had a one sided PCB, and I got the header pins on, but that made soldering connections on the bottom side difficult.  First trip to Radio Shack: unsuccessful, no double-sided PCBs. I have several Adafruit perma-proto boards in 1/2, 1/4, and 1/8 sizes.  They don't fit the breadboard, but I made due with the 1/4 size.  After a bunch of wiring errors, I got it working.

Parts:
Adafruit barrel jack
Adafruit 1/4 size perma-proto board
LM7805 Voltage Regulator
PCB mount toggle switch
22 Gauge Hook-up wire
Tinned Copper Bus Wire
10uf electrolytic capacitor
.1uf electrolytic capacitor (I ran out of the mylar versions)
LED
330 Ohm resistor
standoffs and screws

The barrel jack takes 6-12V in.  The power from the jack connects to pin 1 (power in) of the LM7805 and ground to pin 2 (ground).  the 10uf cap goes between LM7805 pins 1 and 2, and the .1uf between pins 2 and 3 (power out) Since both capacitors are electrolytic, the negative side for both goes to pin 2.  Pin 3 goes to the PCB power rail, and Pin 2 to the ground rail.  Hookup wire connects the rails from side to side of the PVB.  Pin 3 also goes to one side of the toggle switch, and the other side of the switch goes to ground (WRONG!--see "Update" below). The LED goes from power to the 330 Ohm resistor to ground.

Since I could not plug this into a breadboard, I added hook-up wire (22-gauge, solid core) soldered to the power and ground rails.

Here's the video.

Update: see my comments, below.  The voltage regulator overheated when the device was turned off with the toggle switch.  Dumb mistake: I should have put the switch between 9V in from the barrel jack and the 9V side of the LN7805.  I fixed that. Here's  an annotated photo of the bottom of the PCB. I know it's messy--I haven't trimmed the wires yet.
DIY 5V Power Supply Wired Correctly (bottom view)