Ultimate DIY Breadboard Power Supply

80K820131

Intro: Ultimate DIY Breadboard Power Supply

For prototyping, nothing beats a breadboard! But how to provide power to the little black and red rails that fuel our designs? There are a couple of conventional options:

A bench/lab variable power supply. A must-have to be sure, but expensive, big and (arguably) overkill for low power circuit design and general hobbyists.

Jumping power from an Arduino.Useful for testing, but it adds to the jumper clutter. Also, it can be useful to save those 5V / 3.3V rails for powering something else, rather than just feeding a breadboard.

Batteries. Nothing kills maker-mojo faster than battery anxiety!

So I decided to design something that could do one job - power any breadboard - and do it really well, with enough options to make it indispensable for small prototyping projects.


Design Goals:

Save breadboard space

Removing chunky components like DC jacks, switches and voltage regulators from the breadboard frees up precious space for the actual project, along with fewer messy jumpers and wires.

Be ridiculously cheap

Rock solid power in all the commonly used voltages... but without shelling out for a variable bench power supply.

Be accurate

Having precise, stable voltages within +/- 0.05V means less troubleshooting of power related issues and ensures components are happy and healthy!

Make me want to experiment!

It should be simple, small, laughably easy to use, and let me get straight to melting capacitors and burning out LEDs.

...

I drew up the schematic for this project and then subsequently stumbled on kernsy's Radioshack, Adjustable Breadboard PSU. This instructable was a big inspiration for me in terms of laying out the protoboard, so consider mine a remix of his excellent work. Credit to kersny - cheers!

STEP 1: Regulator... Mount Up! the LM317

Right, so there are only a handful of voltages that I find consistently useful in small applications:

  • 1.5V
  • 3V
  • 3.3V
  • 5V
  • 6V
  • 9V
  • 12V

There are a couple of options to achieve these outputs using small, off-the-shelf components. The first one that came to mind was the LM78XX (datasheet), typically in its 5 volt (7805), 9V (7809) and 12V (7812) flavours. You could have a circuitboard lining up a bunch of these, and a switch to direct current through one of them at a time. This would give rock-solid output, but only for a small number of voltage settings and at the cost of massive amounts of real estate. Pfft.

The next option is the venerable LM317 (datasheet). Using only a small number of components this bad boy can output anything from 1.5V - 37V at 1.5A. The chip has 3 terminals - input, output and adjustment. The idea is you feed power to the input, and a regulated (lower) voltage spews forth from the output. You need to feed it with at least 3V more than the amount you're looking to receive - so for 9V output, you've got to give it 12V. This lower voltage is ideally determined using a couple of resistors - one bridging the adjustment and output pins (which typically remains a static value) and another from the adjustment pin to GND.

The LM317 can therefore be used to make a variable power supply if you used a potentiometer as your second resistor, but I want to be able to flick a switch and have a stable, preset output in one of my desired voltages without fiddling with a tiny knob (chuckle).

So, the trick is to work out what resistors are needed in advance, and direct current through them one at a time.

STEP 2: You Can't Resistor

Now, there is a highly nerd-approved way of calculating the resistors needed to convince the LM317 to output a given voltage. They supply the following formula in the datasheet:

Vout = 1.25 * ( 1 + R2/R1 )

If you assume that resistor R1 - between the adjustment and output pins - remains constant (the datasheet uses 120Ω and 240Ω) then you can quite easily determine the resistance value for R2 given some mathematical fiddling. Using a value of 240Ω for R1 means the formula for R2 is:

R2 = 240 * (( Vout - 1.25 ) / 1.25 )

So for instance, if we wanted a voltage of 5V we'd need:

R2 = 240Ω * (( 5V - 1.25 ) / 1.25 ) = 720Ω
OR...

...you can just head over here for a handy LM317 resistor calculator! Using this, I got the following resistor values needed for my target voltages. In addition, by using multiple resistors in series you can get a value that's more accurate - in my case, I always used 2 resistors for a compromise between accuracy and sexiness on the final protoboard. This awesome tool calculates the best combinations of resistors to match a given value.

R1:

  • 240Ω

R2:

  • 1.5V: 48Ω using 18Ω and 30Ω (perfect)
  • 3V: 336Ω using 36Ω and 300Ω (perfect)
  • 3.3V: 394Ω using 3.9Ω and 390Ω (0.025% difference)
  • 5V: 720Ω using 100Ω and 620Ω (perfect)
  • 6V: 912Ω using 2Ω and 910Ω (perfect)
  • 9V: 1488Ω using 390Ω and 1100Ω (0.134% difference)
  • 12V: to be passed through (see the schematic and description in the next step)

If you can, and assuming they're not much more expensive, use 1/4W metal film resistors rated at 1% for better accuracy. Fortunately, I have a fairly well stocked local electronics shop that could supply these odd value resistors, but use the resistor calculator to get as close as you can.

Lastly, I went anal retentive big time with regards to accuracy: My electronics shop only sells resistors in packs of 10, so... I tested them. All of them, on a breadboard, hooked up to my LM317 and the 240Ω resistor. I connected a self-powered voltmeter and started swapping resistor pairs in and out until I nailed the desired value to within 0.05V, and then grouped the winners together. Ouch. Definitely optional. (If you do this, make sure to use the same LM317 and 240Ω resistor you used during testing!)

STEP 3: Design & Schematic

Okay, so here's the idea:

A simple, pluggable PSU that slots into the power rails at one end of a standard breadboard. Referring on the schematic:

Power source: almost any standard DC power brick ("wall wart") with a barrel jack, providing at least 12V should do the trick. These can be salvaged from old routers, set-top boxes and similar devices.

SW Power: A simple on/off power switch to save me from having to yank out the cable every time.

SW 12V: This switch basically turns the LM317 on or off. Position 1 provides the full 12V (or whatever you're providing) to the breadboard, while position 2 sends the current to the LM317 to be regulated down. This prevents the LM317 from having to regulate down to 12V, which would have meant providing at least 15V.

Dip switch: A 6 position DIP switch is connected between the adjustment pin of the LM317 and GND, each path leading down to my series of preselected resistors to achieve the desired voltage. Position 1 is 1.5V, right up to 9V at position 6.

Vcc OUT: Each of these outputs (left & right) refer to the breadboard rails we're supplying power and GND to.

SW Dual Output: This switch toggles between only the left rail on the breadboard receiving power, or both the left and right. This saves on jumper mess, while also making it super quick and simple if both sides of the board need juice.

LEDs: These LEDs indicate which rails are receiving power. Also, they dim/brighten depending on which output voltage is selected - the full 12V passthrough makes them the brightest, while the 1.5V gives them barely enough food for a dim illumination. This is a small visual clue as to which output voltage has been selected, while also an indication that the PSU is actually on.

Capacitors: Lastly, three smoothing capacitors help keep a nice, stable output voltage.

STEP 4: Parts List

Check out the images for more detail, but the parts we'll need are:

...

☐ A minimum 12V DC power brick/wall wart with a DC barrel jack.

☐ A cheap, standard size 26 x 19 hole protoboard. Single sided is perfect.

☐ A DC barrel jack to match the one on your power brick (5.5mm is typical)

☐ The LM317T voltage regulator

[Optional]Heatsink (with mica, top-hat, bolt and nut, and thermal paste if you're feeling anxious)

[Optional] ☐ Diode (14N00X) - entirely optional, can be placed just after the power input to help prevent house fires. I left it out :)

☐ 3 x smoothing capacitors: 100uf, 10uf and 1uf.

Switch: on/off (SPST)

Switch: SPDT, 3 pin

Switch: DPDT, 6 pin

☐ 6 position DIP switch

☐ 2 x 2-pin male SIL headers

Resistor: 240Ω (for "R1")

Resistors: each of the calculated resistor pairs (for "R2"). If you're using my design, you'll need:
2 ... 3.9 ...18 ... 30 ... 36 ... 100 ... 300 ... 2 x 390 ... 620 ... 910 ... 1100

Resistors: 2 x 360Ω (for the LEDs)

☐ 2 x 3mm LEDs

4 screws and standoffs

...

Total cost for all the components was R92.72 (South African Rand). This is about +/- $6 USD. Aww yeah.

STEP 5: Board Layout & Preparation

I fired up the ole' Inkscape, mapped out my board and placed each component to make sure I'd have enough space to lay them all out. My layout in the image above, and assuming you're using the same components as me, is hole-perfect.

1. I highly recommend doing a "dry fit", adding each component to the board before soldering to double check you have enough room. I wanted this to be as compact as possible, so you may have better luck starting with a bigger board. The standard 26 x 19 hole board is literally just enough space. Use some helping hands to make this easier - those component leads can get fussy.

2. The DC barrel jack has oversized tabs instead of pins, so there is some drilling to do: Mark the holes that need expanding and drill them large enough to fit the jack. While you're at it, drill the mounting holes larger as well, and space for the heatsink screw if you're using one.

3. Speaking of the heatsink, apply a thin layer of thermal compound to both sides of the mica. Then line it up on the heatsink, add the LM317, and secure with a top-hat, bolt and nut. The LM317 can be mounted vertically or placed flat - I preferred to lay it flat to minimise the vertical height of the final board, which meant bending the pins 90 degrees down.

STEP 6: Solder Time!

Starting with the smallest components (the resistors, diode, capacitors) and working your way up to the biggest (switches, IC, DC jack) and start soldering it together!

1. Another source of inspiration from kersny's post was the use of masking tape to hold the smaller components in place before flipping and soldering. Again, a good set of helping hands works like a charm here - attach components, secure, flip, solder. Repeat, repeat, repeat!

2. After each batch of components, do yourself a favour and use a multimeter to perform some continuity tests on your joins, just to make 100% sure you don't have any cold solders.

3. Don't be too quick to trim the component leads - keep them around to make interconnecting easier. I try to avoid making solder-bridges where possible, preferring to use the leads themselves. For larger bridges, I used colour coded solid core wire ("scooby doo wire") to keep things visually distinguishable.

STEP 7: The Completed Board

STEP 8: Testing - Mounting to a Breadboard!

The two sets of pins simply slot into the first row of power rails on either side of the board. When the DC jack is plugged in, the LEDs indicate which side of the board has power. Easy!

STEP 9: Testing All the Options

1. Flipping the dual-rail switch provides power to the other rail on the breadboard.

2. With the 12V passthrough switch enabled, we get the full 12V DC fed through.

3. Disabling the 12V passthrough switch means we're feeding the LM317. Together with varying positions on the DIP switches, we get some rock-solid DC voltages on the breadboard. Simple!

113 Comments

Another way is to replace the dip-switch with a jumper block with one connector.
hello i need ur help plsss i have a project like that

while a very good idea, this definitely is low on safeguards. not only lack of amperage regulation (the LM317 itself appears to be the best safeguard here) but i consider the dip switch a fatal flaw. while errors (more than one open) would not be fatal in and of themselves, the unexpected voltage could be just as big a pain as the "first noob question" every repairman should ask (is it plugged in). l suggest that neither beginners nor complacent pros be allowed near the final project. . . . .

i understand the dip switch (a 6x1P1T) is used for its compactness but a 1T6P slide switch would make selection idiot proof as not only would just one be on but also the larger size gives space for labeling (traditionally dip packages are unlabeled due to lack of extra space) printing that would fit a dip would need a magnifying glass to read. On the other-hand, it does create a problem, 1T6T switches are hard to find in retail,,,,,, but they are available wholesale (i found alibaba selling them for 10¢ but in 2000 lots) and scrap recovery. . . .

I would like to see you make a 2.0 version addressing its short-comings and definitely look for a contest to enter them in..... concept is not only practical but cool too.

bit late i know but I am going to use 6 button interlocked piano type
Thankyou very much for this post, it's been incredible helpful and insightful for someone who is a relative novice.

I wonder if you could elaborate a bit further on how you specified the size of the capacitors you chose? I've got a basic understanding of their operation, use and the governing equations for their behaviour, but I'm not sure how to go about selecting specific values for this type of application... it would be very helpful.

Wow great job! I couldn't help but wonder though, if you have seen the $3 version of the same thing.

How does that $3 version change the voltage output? From looking at the pic it seems like its the pot at the top of the board opposite side of the display. Abzza's intent was to remove the need for using a pot and having to find the right spot for each voltage. Just flip the proper dip switch and done. I can't argue with $3 though. It doesn't plug directly into the breadboard but cheap is always good :D

I agree. I also have one of those small buck converters, but you have to manually turn the dial. Mine doesn't have a display so I have to find the right voltage with my multimeter. Having the right voltages with a flip of a switch is great.
I forgot to ask. What apps do you use to create those nice schematics and layout diagrams? I use Eagle/Fusion but not always that great. Fritzing also nice, but doesn't always have the components I need, and I got side tracked yet again with trying to learn how to create SVGs for my custom components, so much so that I completely forgot what I was actually trying to do on Fritzing. Some call it ADHD. I just call it curiosity.
Wow. Great project and great explanation. Very thorough with pics and all. And....I was was pleasantly surprised to see that you paid in ZAR which means you are not far away.

Would you consider building me one? Perhaps version 2.0 could be mine :)

I want to try this out myself, but I always get side tracked from my actual projects by these kinds of things. I was searching for a quick way of modifying my 3.3/5V breadboard power supply to tap out 12V and came across this. Now I want it real bad, but I first need to finish my other projects. Parts are piling up and I just don't have enough time for everything.
excited to try on this project, but there's one thing i dont fully understand.. is the dual output switch on-off-on? if so, why is this needed instead of an on-off switch? isn't the first rail getting powered either way?

Love the guide, easy to read and understand. I do have a question though, where did you get your switches? You mentioned a total price of ~$6 USD, but I'm spending that much for the switches alone. Thanks!

HI Abzza, Great Instructable. Very well written and detailed. Excellent job! I had have a question and read through the comments searching to see if it had been asked but did not find it so forgive me if I overlooked it. Have you considered a version of this with dual output? Basically a dual mode device where you can feed same voltage to both sides or one voltage for one side and another for the other side (if needed). Situations like this don't always come up but I recently had a project needing 24v and 12v so that project came to mind while reading your Instructable.

I made one change to make it idiot proof - I used a rotary switch to
select the resistive dividers. There was too much of a chance of having
more than one switch on at a time. I also added a third LED and
resistor combination across the input power.

Can you provide more details on what rotary switch you used and any photos how this affected the layout of components? Really curious and I want to do this as well!. Thanks!

Beautiful, elegant solution!

Please can you tell me what software do you use to prototype the board layout?

Hey, excellent instructable!! I had a small question though. Say, if I were to modify the design so as to obtain different output voltages on the two power rails, I would need a second LM317 to regulate the voltage, right? Can you suggest any other way to achieve this?

cannot wait to start this project... just one thing tho.... I don't understand the switches. SPDT, DPDT? Looking around there are loads of what look like the switches but I don't want to order the wrong item. Can you give me more information please? If someone could point me in the right direction?

I'm in the uk. Perhaps a link to a site where I can order them?

Any help would but appreciated. Thank you

More Comments