One of the most popular articles on this website is the tutorial on how to build a 5V power supply on a breadboard. Following up on that, today we’re going to build a power supply that can output both 3.3V and 5V at the same time. This is particularly useful for circuits where both voltages are needed. We will solder the components on a small protoboard, which will conveniently plug directly into the power rails of our breadboard.
Bill of material
We’ll need the following components to build the power supply:
- A small protoboard to solder everything on. I use this board from Newark, which has some pre-made traces, but any protoboard or stripboard will work; you’ll just have to adapt the layout a little bit.
- A 5V voltage regulator (LM7805)
- A 3.3V voltage regulator (I use a LD1117V33 in this article, but you can also use a LM7833; be aware that the pinout on the LD1117V3 and the LM78** are different!!)
- 3 breadboard switches, such as those.
- Ceramic capacitors for the voltage regulators:
- 1 x 0.33uF
- 2 x 0.1uF
- 1 x 10uF
- 2 headers (both 2 pins)
- 1 wall power supply (output should be at least 7V). This power supply from Amazon will work fine.
- 1 barrel jack connector to plug the wall power supply (this one from Adafruit is perfect)
- 1 fuse to protect the circuit and power supply from any potential short circuits. I use a 1A fuse, but feel free to use a different value depending on your circuit.
- 2 LEDs that will indicate the status of the 3.3V and 5V lines. I’ll use a different color for each (red for 5V, yellow for 3.3V).
- 2 resistors to protect the LEDs. I will use 3.3KΩ for the yellow LED and 10KΩ for the red one. I chose high values for the resistors to minimize the current they’ll draw; we don’t need them to be bright, just to show us that the circuit is working correctly.
There are many ways to wire this circuit. I chose to make a board that plugs on both sides of the breadboard, so that it can provide 2 different voltages. The breadboard type I’m using is shown below (830 points). You can easily adapt the board layout to plug in a different board size if you use a different one.
To implement the voltage selection, I’ve decided to use switches as follows:
- one master switch to turn ON/OFF the whole circuit (useful to quickly turn the power OFF while working on the breadboard without having to unplug/re-plug the wall adapter)
- on each power rail (left and right of the breadboard), a switch to select between 3.3V and 5V
This makes it possible to use any of those 4 combinations:
It should be noted however, that this kind of switches is only suited for low currents, and shouldn’t be used for circuits that will draw more than 200mA. Always read the datasheet of any component to know how much current they can handle. A good alternative to switches could be to use 3-pin headers with shunts to select which pins are connected; this solution would handle more current.
The schematics of the circuit I came up with is the following:
Template for the protoboard
There is not easy way to layout a board to follow the structure of a protoboard. Fritzing does support laying out on a stripboard, but I personally find it awful to use and extremely limited for any kind of serious design.
I generally use Eagle PCB to design schematics and PCB layouts. The free version is limited to 2 layers and 80cm2 (12.4in2), but this is more than enough for hobby projects.
Creating a template for the protoboard is kind of a pain, but you can do it once and re-use it for future designs. The idea is simply to use a 0.1in grid spacing, and draw the traces as they are on the actual board. You can save this board template and then copy/paste it to other PCB projects that use it. There is no need to be 100% complete, the main idea is to give enough guidance to quickly know which holes are connected to which. For example, with the board I’m using from Newark, this is the template I created; as you can see I only represented the holes connected to other ones:
Of course, there is also the option of laying out the board on paper, or going straight to placing and soldering the components; I personally like to prepare everything on my computer first.
Power supply layout
Here is the layout I created for the power supply. The main thing to consider is the position of the pin headers JP1 and JP2. They must plug into each side of the breadboard, so it is important that they are placed correctly.
I routed the connections that I’ll need to make on the top layer (red traces), and the connections that are already done by the protoboard are on the bottom layer (blue). This makes it easy to see which connections I need to add when I’m soldering everything together. As you can see, there’s quite a bit of wiring to do, but the pre-made traces are extremely useful and considerably reduce the additional wiring work. This is the reason why I prefer this kind of prototyping board to the ones with only individual holes.
Solder the board
There are many ways to go about creating the physical board. It’s best to start soldering the small components first, such as the capacitors, resistors and switches. Basically, start with the smaller components and work you way up to the biggest. This is because it’s easier to place and solder a big component in the middle of small ones, than the other way around.
As much as possible, try to create connections (red traces) using the leads of components that you bend and solder to the leads of other components. For example, you can bend the lead of the resistor R2 (top right corner) to connect it to the pin of JP2.
I like to make connections with wires on the top side of the board, and use colors to easily know which one is which. For example, black wires are usually GND, and red ones Vcc. You can overlap insulated wires on top of each other if needed, but be careful not to have any bare wires touching (unless they’re the same net). I use 24AWG solid core, but it is also possible to use stranded wire (I just don’t have any currently!). If your power supply is gonna feed circuits that need a lot of current, make sure to use an appropriate wire gauge.
Steps of the build
I first soldered the pin headers that plug into the breadboard to make sure the spacing was correct. It turns out that I had to move the right headers one hole further to the right. The headers don’t perfectly line with the power rails on the breadboard, but this layout is close enough. I also used 3-pin headers to make the connections with the breadboard stronger.
Then I soldered the LEDs, resistors and voltage regulators.
As you can see on the bottom of the board, I used the lead of the resistor (right side of the picture below) to connect the resistor and the LED, which is easier and cleaner than making the connection with a wire.
Next I soldered the capacitors:
Here also, I used the leads of some capacitors to create connections, as shown on the picture below. It’s best to wait until the end to cut the leads on the bottom side of the board, as they can be useful to make connections with components you haven’t placed yet.
This is the final board after soldering all the components and wiring everything together. Two labels were added to easily know which side of the switches corresponds to 3.3V or 5V, and ON or OFF.
I mounted the fuse on a female header, so that I can easily replace it if it blows. I also glued the pin headers with hot glue, because on one of them the copper pads got damaged during soldering and wasn’t staying in place. With the extra fixation from the glue I can be confident that the headers will handle being plugged in and removed from the breadboard without breaking.
Test the voltages
Let’s measure the voltages for both switch positions (3.3V and 5V) on each side, to make sure that the circuit is working properly.
Lastly, the current draw in idle state (nothing plugged to the pin headers) is about 10mA, which is perfectly reasonable considering the quiescent currents of the voltage regulators and the current drawn by the LEDs. For reference, the typical quiescent current of the LM7805 is 4.3mA, and the LD1117V33 is 5mA.
In this article we created a circuit capable of outputting 3.3V or 5V on each side of a breadboard. The board has a convenient format that can plug directly into the power rails of a breadboard. The circuit is made of cheap components that most electronics hobbyist have available, making it an ideal alternative to pre-made breadboard power supplies. This is a fun, easy and useful project to get familiar with building prototypes on a PCB board.