The first part of any electronics project, is a power supply. Some projects use the USB port on your computer; others use a cheap wall adapter. Some are battery powered, and others are solar. With all these different options, how does one power their electronics project? Let us show you!
It’s pretty simple really; first, I want to explain what a power supply does, and then I will show you how to build one. We will start with a battery, and work our way up to a wall adapter. A power supply is responsible for providing a circuit with all the power it will need during normal operation. It provides the circuit with a certain voltage and current. The best way to think of this would be to imagine a hose with water running through it. The pressure of the water at the end of the hose is the voltage, and the amount of water going through the hose is the current. Most electronics need a certain amount of voltage and current to function.
For the sake of this tutorial, lets make that about 5 volts and let's save the current for later. For proper operation, we need to find a way to convert the voltage of our main supply (battery or wall adapter) down to 5 volts. This is where a regulator comes in. A regulator is a device that will convert the unregulated voltage to a stable 5 volts that we need to power our project. It's job is to maintain a steady 5 volts regardless of what the our battery is doing. The only caveat of a standard voltage regulator is that the main supply has to be slightly higher then what we want to achieve. So if we want 5 volts, we need at least 7 volts to maintain the steady 5 volts that we want. This power supply will not be able to convert from lower volts to 5. So once our battery is dead, our project will be too.
For this tutorial, we will use a LM7805 (a linear voltage regulator) for our power supply.
Step 1: LEDs and Capacitors
What we are going to do, is build this power supply, with a couple of simple changes. This regulator needs a 0.33 uF capacitor on the input side, and a 0.1 uF capacitor on the output side. The capacitors help filter the input and output from noise created by the power supply, and/or the load (i.e your project). We will add larger capacitors on both sides, to help keep our power supply clean, and noise free. Secondly, there is no way of knowing if our power supply is working, so we will add a little LED as our power indicator.
Step 2: Revised Circuit
Here is our revised circuit; we have 4 capacitors instead of 2, and have added our power indicating red LED with a current limiting resistor, which is required for the LED, so it doesn't burn up. If your are wondering where the magic 330 ohm resistor value came from, it's a simple application of the V = IR equation. First we get the voltage drop and current requirements for our LED here. It has a voltage drop of about 3 volts, and draws 20 mA at maximum brightness.
Step 3: 330 Ohm Resistor
With the quick calculation above, you can see that for maximum brightness of our red LED, we need a resistor of 100 ohm. Since I don't really care about maximum brightness, I'd rather have a dimmer LED and save my battery; so I decided to use a 330 ohm resistor instead, which will still give me plenty of brightness and increase my battery life.
Step 4: What You'll Need
So now that we have that down, lets get to building! Here are all the parts we will use for this tutorial. In the picture you can see the LM7805 3 pin voltage regulator, two black 10 uF capacitors, two blue 0.1uf capacitors, one LED (clear lens with two legs), one 330 resistor (the part with the orange colored rings), and a breadboard (the white board with holes). Finally we have a 9 volt battery, and a connector. I have soldered some headers to the end, to make it easy to insert into a breadboard.
If you'd like to purchase the above products for this tutorial, please visit our website.
Step 5: Breadboard
Let's start with the breadboard. A breadboard is a great little tool to help you prototype a circuit before ever having to make a PCB. It has pre-connected rows and columns which allow you to push electronic components into them to create your circuit. The next image shows which of the pins are usually connected together (not all breadboards are exactly the same!)
Step 6: Breadboard Cont.
Insides the breadboard are specially made metal bars and rails. When a component is placed on a breadboard, these bars hold the component in place and also allow you to electrically connect any other component to it using the same bar. Still not sure what to do with it? Lets start by placing the battery connector and regulator on the breadboard.
Step 7: Wiring
Now it's time to add some wiring. We will use some of our pre-cut jumper wires to start making the circuit on breadboard. From the datasheet, we know that the pin on the far left of the regulator is the input, and the far right is the output. The middle is the 0 volts of our battery (we will call it ground for this tutorial). So to connect the input of the regulator to the battery, we will place a wire between pin 1 and 5, and one between 2 and 6.
Step 8: Rails
Next we will connect the rails to the output of the regulator. This will allow us to later connect 5 volts to any part we would like.
Step 9: Filtering Capacitors
The main connections are complete. Now we'll add the filtering capacitors. Some capacitors are polarized and some are not. The 10 uF caps we are using are so we will need to be careful and place them in the circuit with the proper direction. The white stripe on our capacitors shows the negative side of the capacitors and needs to be connected to the negative parts of the circuit.
Step 10: Capacitors
The next two pictures show both capacitors being added to the circuit. I had to trim the length of one of the pins for it to fit into the breadboard. Usually one pin is always longer than the other to show polarity. The input capacitors is on the top, and the output capacitors is on the bottom.
The second picture shows the output capacitors again, note the white stripe being connect to the ground line. I am using the blue rail as the negative side of my battery.
Step 11: 0.1 UF Capacitors
Next are two 0.1 uF capacitors (tiny blue ones in the picture). These are not polarized so we can put them anyway we would like.
The second picture is a close up for clarity.
Step 12: Complete Regulator Circuit
And there we have it. The regulator circuit is pretty much complete. Now let's add the power LED so we know when it's turned on.
Step 13: Power Light
For a power light, we simply need to power the LED with the 5 volts being regulated by our circuit. Here we have to connect Pin 21 to 5 volts and Pin 22 to ground. Now we just need to add the LED and the resistor to protect the LED. LEDs do have a polarity.
The LED has an anode and cathode. The anode is connected to the + side and the cathode is connected to the - side. If the LED is placed in reverse, it will not turn on.
Step 14: 5mm Red LED
The picture above is of our standard 5mm red LED. You can see in the picture that one leg of the LED is longer than the other. This is our anode and should be connected to the positive side of the power supply. The short pin is the cathode and should be connected to the negative side.
Step 15: Connected LEDs
Here we have connected the LEDs cathode to the negative side of the battery. All that's left is the resistor from the anode to the positive 5 volt rail to turn the LED on.
And that's it! Lets plug in the battery and see if our LED turns on.
Step 16: WA-LA!
And there you have it, it works! I know, you can hardly see the red LED... That's because of our camera flash, trust me, it's on and pretty bright. But wait a minute, just because the LED is on doesn't mean we are getting our desired 5 volts right? Well ya, it would be a wise decision to hook up a multi-meter and check the output before you connect anything to this supply. How do we do that? Let us start by checking the battery voltage.
Step 17: Connecting the Multimeter
To measure voltage with a multimeter, you need to connect the multimeter in parallel with the circuit. So what we did above is added a pair of jumper wires to the breadboard. The red one is connected to pin 1 which is the same pin as our positive side of the battery. The second one is connected to our blue rail which is connected to the negative side of the battery. Now we can connect a multimeter set to voltage mode to our jumper wires and measure the voltage of the fresh 9 volt battery.
Step 18: Battery Voltage
And here is the Multimeter reading the battery voltage. Be sure your multimeter is set to DC voltage mode and the red probe is connected to the correct terminal.
There you go, our brand new 9 volt battery is providing our circuit with 9.37 volts! This would likely go down to being closer to 9.0 volts once we apply some real load on the circuit.
Step 19: Measuring the Output
Next let's measure the output of our regulator. We will move the red jumper wire to the red rail which is connected to the output of the regulator.
And finally, here is the output of the circuit:
Step 20: YAY!
We are getting 4.96 volts! This is well within the specs of our regulator, our circuit is working great. There you have it now we are ready to power our project with up to 750 mA of power!
The regulator will happily power your project up to 750 mA but be careful. The metal tab of the regulator is meant to be connect to a heat sink. If you plan on using this circuit or any other voltage regulator circuit to its max current specs, be sure to use a heat sink and a fan to cool down the component. I hope you have enjoyed this lesson. Let us know if you have any questions on our forum or you can get in touch with us using the contact us page.