If you’ve been working with Arduinos and other electronic devices for even a short while you probably have come up with a method of powering them up on your workbench. USB power bricks and bench power supplies will do the job very nicely. With the Arduino you can simply power the device with a computers USB port. Getting electricity was never so easy!
But after you’ve finished your design you’ll often want to build a more permanent version of your project, and for that you’ll need to consider how to go about providing power to it.
Electronic devices like Arduino’s require “logic level” voltages to function. These “logic level” voltages come in two flavors – the traditional 5 volts DC that is also known as “TTL level” voltage and the power-saving 3.3 volt DC supply that is used in many low-powered devices. In both cases the voltages need to be regulated fairly precisely to avoid damaging components.
A USB power brick can be a simple solution in many cases. It provides a regulated 5 volt DC supply that is suitable for most electronic devices and its fully enclosed design protects you from any chance of electric shock.
But what if you want to power your device using batteries? Getting an exact and consistent 5 or 3.3 volts from a battery is a challenge, especially as the battery discharges.
Today we will look at several low cost options for providing regulated power to your electronic designs.
Common Voltage Requirements
There are several standard voltage levels that your design might require, some designs will need more than one of them. A few of them are as follows:
- 3.3 Volts DC – This is a common voltage used in low-powered digital devices.
- 5 Volts DC – This is the standard TTL (Transistor Transistor Logic) voltage used by digital devices.
- 6 Volts DC – Often used for DC and servo motors.
- 12 Volts DC – Also used with DC motors as well as many stepper motors.
- 48 Volts DC – Used in professional audio gear as a “phantom supply” for microphones.
All of the above voltage levels are positive in reference to ground. Some older designs also required negative voltages, for example -12 Volts DC was used in the RS-232 serial connection that used to be standard on all computers and modems. Audio amplifiers often require both positive and negative supplies.
Logic level voltages need to be very precisely regulated. For example for TTL logic to function correctly the supply voltage needs to be between 4.75 and 5.25 volts, any lower will cause the logic components to stop working correctly and any higher can literally destroy them.
Some supply voltage requirements are less stringent. Power supplied to motors, LEDS and other display and electromechanical components does not need to be regulated as as strictly as it does for logic supply voltages. These power supplies are often not regulated to save cost in the final design.
Voltage regulation for line powered devices is not that difficult as the input voltage to the regulator circuitry is fairly constant. However battery powered designs provide a much greater challenge as battery voltage levels will fluctuate as the battery discharges.
Devices that can be powered by both line voltages and batteries often have additional circuitry for charging the batteries when the device is being line powered. Depending upon the battery technology employed in the design this can range from a simple to very complex charging circuit.
The power supply voltage level is not the only specification that must be taken into account when designing a power supply for your project. Just as important is to determine the current requirements of the project.
Unlike voltage requirements the current that a project consumes is not always a static value. Motors, LED and other displays, speakers and other transducers can cause the current draw to fluctuate and you need to design your power supply to accommodate the “worst case” situation where every motor, indicator and sounder is being operated at full capacity.
Once again current requirements can be a challenge in a battery powered design. As a battery discharges its current capabilities are diminished, trying to exceed these current capabilities can cause the battery to discharge rapidly.
Another important aspect of voltage regulator design is efficiency. The regulator or voltage convertor itself will consume some electricity that could otherwise have been used to power up your project.
Efficiency goes hand in hand with heat production, an inefficient regulator design will dissipate its excess energy as heat. Unless you’re deliberately trying to heat up your circuitry this is not a good thing! Heat is one of the greatest enemies of electronic components and if your regulator gives off a lot of heat you’ll need to workout ventilation and perhaps heat sinking into your design.
No design is 100% efficient so some heat production is to be expected. By overrating the components in your design you can keep this minimized.
Power Supply Basics
The function of a power supply is, of course, to supply power at the correct voltage and current levels to meet the requirements of your project. The energy to run the power supply can come from a number of sources – batteries, solar cells, AC power and others.
The voltages we need for our little electronic devices is generally DC or Direct Current. Batteries also produce DC but line voltages are AC or Alternating Current. So in addition to providing the correct voltage(s ) an AC power supply also has to convert its AC input to a DC output.
If the above subtitle makes you think of Australian rockers wearing short pants then you are reading the wrong article!
The power that is run into your home is always AC. Alternating Current can be sent over very long distances and stepped up and down using transformers.
The frequency of the AC varies depending upon your location. In North America we use 60 Hz whereas Europe, Australia, New Zealand and many Asian and African countries use 50 Hz. The voltage levels also are different, North American homes have line voltages around 110 – 120 volts AC while other locations in the world use a higher 220 – 240 volts AC.
If you are building or buying a power supply for a device that you hope to export commercially you’ll need to consider the different line voltages and frequencies around the world. There are also different standards for the type of connectors or plugs used in different countries.
As our electronic devices require DC current at much lower voltages you’ll need to do two things before you can employ the power from your wall outlet:
- Reduce the voltage to a lower level.
- Convert it from AC to DC.
Interestingly the above can be done in either order.
In a conventional linear power supply the AC voltage is first passed through a transformer which lowers it substantially, it is then converted to DC.
In a modern switching power supply (like the one in your desktop computer) AC voltage is directly converted to high-voltage DC and this is used to drive a high-frequency oscillator. The high-frequency AC produced by this oscillator is then passed through a small transformer and the low voltage output from that is converted to DC.
Either way at one point we need to convert the AC into DC. That’s actually pretty simple.
Rectifiers and Bridges
The term “rectifier” dates back to the days of vacuum tubes, it’s really just another name for a high-current diode. A diode, as I’m sure you already know, is a basic electronic component that will only allow current to pass in one direction.
If you stick a rectifier or diode in series with an AC voltage source you’ll prevent either the positive or negative portions of the AC signal from passing, depending upon which way you orient the diode.
This is a step to producing DC voltage from AC, but the resulting output isn’t exactly smooth as illustrated below.
An electrolytic capacitor can be used on the output in an attempt to smooth out the voltage and produce a reasonably steady DC voltage. It’s a simple way of converting AC to DC with a couple of drawbacks.
- The output voltage will be reduced. It will be the AC input voltage multiplied by 0.7072.
- You are essentially “wasting” half of every AC cycle, so it’s not terribly efficient.
A better method is to use four diodes to create what is referred to as a “bridge rectifier”. You can see the results in the following diagram. Again we will use an electrolytic capacitor to smooth out the resulting DC voltage.
This method has several advantages over the single diode method:
- The output voltage is greater. It will be the AC input voltage multiplied by 1.414.
- You are using both the positive and negative parts of the AC cycle, which is much more efficient.
You can either build this circuit with four individual diodes or you can buy a bridge rectifier that is prewired.
By the way, the output voltages I quoted earlier are not quite accurate, you also need to factor in the voltage drop for the diode(s). Generally this is about 0.7 volts.
These circuits will convert AC into DC voltage, however they do nothing to regulate the voltage. If the AC voltage should rise or drop then the corresponding DC voltage output will change by the same magnitude.
Regulators and Converters
Regardless as to whether your DC voltage was derived from AC or whether it is from a battery chances are that it won’t be the correct voltage for your application. You’ll need to change the voltage to the desired level (i.e. 5 volts) and you need to ensure it stays at that level even if the input voltage changes.
We can do this a few ways using either regulators or convertors.
Linear Voltage Regulators
A linear voltage regulator takes a DC voltage input and produces a regulated output at a lower voltage.
An excellent example of a voltage regulator in use is on the Arduino Uno board. The Arduino Uno has a 5-volt linear voltage regulator on its circuit board, allowing you to use its coaxial power connector to connect a power supply of 8 to 20 volts DC. The regulator reduces this to the 5 volt DC level that the Arduino uses.
Linear voltage regulators have been available since the mid 1970’s and they are still valuable components today. They are very easy to use and are available with different current ratings. They are generally packaged in the same form factor as transistors and power transistors.
Linear voltage regulators typically require an input voltage at least 2.2 volts higher than the desired output voltage. While they can generally withstand a wide range of input voltages you need to aware that the higher the input voltage the more energy the regulator will need to dissipate as heat.
Linear voltage regulators are inexpensive and ideal for line powered devices. They are also used in audio equipment as they don’t create the electrical noise that voltage converters do. While you can certainly use them with battery powered designs they are generally not the best choice for this application as you’ll end up wasting a lot of energy in the form of heat. This isn’t always true however as there is now a new generation of low voltage drop regulators, we wil be looking at a few of these in a moment.
A better way to regulate voltage(s) in battery powered devices is to use a voltage converter.
There are actually three types of voltage convertors that you can make use of in your projects:
- Buck Converters
- Boost Converters
- Buck Boost Converters
Let’s take a quick look at what the differences are between them.
Buck Converters work using something called a “flywheel circuit”. In operation a transistor is switched on and off and its output is fed through an inductor (coil) and then to a capacitor. As the transistor is switched on and off the capacitor charges and discharges the energy that is stored in the coil. The period or frequency that the switching occurs at determines the output voltage.
Like a linear regulator a buck converter is used in situations where the desired output voltage is lower than the input voltage.
A Boost Converter works in a similar fashion to a buck converter, the difference being in the arrangement of the coil, diode and capacitor that form the flywheel circuit. Boost converters are also referred to as “switched mode power supplies”.
As its name might imply the output voltage from a boost converter is actually higher than the input voltage.
Buck Boost Converter
Almost the best of both worlds, a Buck Boost Converter uses a pair of transistor-controlled flyback circuits to either boost or reduce the incoming voltage.
This type of voltage converter is especially useful for battery powered devices. For example, let’s take a circuit that requires 5 volts and that we wish to use a 7.2 volt battery with. When the battery is fully charged the converter acts like a buck converter, reducing the output voltage to 5 volts. When the battery discharges itself below the 5 volt level the circuit acts like a boost converter, raising the output to 5 volts.
We will be looking at all three types of converters.
Popular Regulators and Converters
Now that we have discussed power supplies, regulators and convertors it’s time to put what we have learned into practice.
I’ve gathered together several examples of these devices to show you. All of these are simple and inexpensive methods of providing voltage for your project.
Linear Regulator – 78XX and 79XX Series
Our first linear regulator is a component that has been around for over 40 years. Actually it’s a family of components whose members have different voltage outputs and current capabilities.
The 78XX voltage regulators are 3-pin devices available in a number of different packages, from large power transistor packages (T220) to tiny surface mount devices. These are positive voltage regulators, the most common type. The 79XX series are the equivalent negative voltage regulators.
The numbering system for these components is pretty simple, the XX in the part number indicates the output voltage. So, for example, a 7805 is a positive 5 volt regulator, a 7812 is a positive 12 volt regulator and a 7915 is a negative 15 volt regulator. Both the positive and negative series are available in several common voltages.
These voltage regulators are pretty easy to use. Other than the regulator itself the only additional components you’ll require are a couple of electrolytic capacitors across the input and output. The values are not critical, generally a 2.2uf or greater capacitor can be used on the input and a 100uf or greater one on the output.
Note that although you use both the positive and negative regulators in the same way the pinouts are different:
The 78XX (positive) regulators use the following pinout:
- REFERENCE (GROUND)
The 79XX (negative) regulators use the following pinout:
- REFERENCE (GROUND)
One thing to note about the TO-220 case version of these voltage regulators is that the case is electrically connected to the center pin (pin 2). On the 78XX series that means the case is grounded but please note that on the 79XX (negative regulator) series pin 2 is the input, not ground. This means you need to use caution when connecting a heatsink to the device, which you will need to do if you plan on drawing a lot of current. If necessary you can use a mica insulator on the heatsink to keep it from electrically contacting pin 2.
Despite their age these regulators are still very much in use today and are good for line-powered designs. They are not as efficient as modern regulators however so for battery powered devices you’ll want to look at some of the other solutions presented here.
Linear Regulator – LM317 Variable Regulator
The LM317 is a positive linear voltage regulator with a variable output. This is also a classic electronic component and its variable output makes it very useful in situations where you need a “non-standard” voltage. It has also been popular with hobbyists for use in simple variable workbench power supplies.
As with the 78XX series or regulators the LM317 is a three pin device. The wiring however is a slight bit different, as illustrated here.
The main thing to note about the LM317 hookup is the two resistors that provide a reference voltage to the regulator, this reference voltage determines the output voltage. You may calculate these resistor values as follows:
The recommended value for R1 Is 240 ohms but it can actually be any value from 100 to 1000 ohms.
Of course you can also substitute a potentiometer for the two resistors to make a variable linear voltage regulator. You would probably want to put a 100 ohm resistor in series with the potentiometer to be sure that R1 never goes down to zero ohms.
As with the 78XX series of regulators the LM317 is still in use today but again there are more efficient regulators now available. Still it would be a good choice for a line powered power supply that needs an “oddball” voltage.
Linear Regulator – PSM-165 12v to 3.3v Linear Step Down Regulator
The PSM-165 is a small breakout board that contains a 3.3 volt regulator. This tiny board will take an input of 4.5 to 12 volts and convert it to 3.3 volts for low powered logic circuitry.
The chip used on the PSM-165 is the same one used on most Arduino Uno boards to supply a 3.3 volt output. It has a maximum current capability of 800 mA.
The board is interesting in that it has multiple connections for both input and output, this provides a lot of flexibility when designing a PCB that uses this module as a “daughterboard”.
As you can see the hookup for this module is very easy, no external components are required.
Linear Regulator – AMS1117-5 Linear 5v Regulator Module
The AMS1117 series of three pin voltage regulators operate a lot like the 78XX series. They are available in several different voltages and are pin compatible with the 78XX series.
These are more modern devices than the 78XX series and feature a lower voltage drop, making them useful for both line-powered and battery-powered supplies.
The AMS1117-5 is a 5 volt regulator. It’s available by itself or on a popular breakout board. The breakout board makes it very simple to incorporate into your project.
As with the PSM-165 hookup of the AMS1117-5 module is a breeze. The breakout board has the filtering capacitors on it so no external components are required. Just hook up your input voltage and draw power from the output – it’s that easy!
Linear Regulator – L4931CZ33-AP 3.3v Very Low Drop Regulator
The final linear voltage regulator that we will look at today is the L4931CZ33-AP. As with the PSM-165 this regulator provides 3.3 volts to power low-powered logic circuitry.
This regulator has an extremely low voltage drop, a mere 0.4 volts to be exact. This makes it an ideal regulator to use in low-current battery powered devices. It’s also extremely tiny, available in a TO-92 transistor package as well as in several surface mount packages.
The L4931CZ33-AP is actually a member of a family of low voltage drop regulators, there are also 3.5, 5 and 12 volt models with similar characteristics. The only additional component required when using this device is a small 2.2 uF electrolytic capacitor.
The hookup of the L4931CZ33-AP is a lot like that of the 78XX series. The 2.2uf capacitor I mentioned is used on the output, you can also place an optional ceramic capacitor on the input.
Buck Converter – MINI-360 DC-DC Step Down Buck Converter
Now let’s look at a buck converter. The MINI-360 is a super tiny, super efficient buck converter that can accept inputs of up to 23 volts and deliver an output that can be adjusted down to as low as 1 volt and as high as 17 volts.
The device is on a very tiny breakout board that has a potentiometer for setting the output voltage. With an efficiency of around 95% very little energy is wasted as heat, making this device an ideal choice for battery-powered designs.
As shown in the diagram the hookup of the MINI-360 is very simple, just hook up your input voltage and it’s ready to use. It would be a good idea to adjust the potentiometer and set the output level before you connect any load to it, especially if you plan on using it for a low voltage.
Boost Converter – PSM-205 Step Up 5v USB DC-DC Converter
The first boost converter that we will look at is a unique device in that it has a USB jack integrated on the breakout board. This is very convenient when building a supply for a USB powered device.
This inexpensive module will boost a voltage as low as 0.9 volts to 5 volts at up to 600 mA. Obviously this is ideal for projects powered by batteries, a single AA or AAA cell can now be used to power your 5 volt logic devices.
Again the module makes for a very easy hookup, you literally connect a source of 0.9 to 5 volts to the input and plug your USB powered device into the USB connector.
As you may have already guessed this boost converter is often used in USB power banks.
Boost Converter – MT3608 DC to DC Step Up Converter
Another tiny boost converter, the MT3608 can take an input as low as 2 volts and raise it to as much as 28 volts. It includes under-voltage lockout, thermal limiting and over-current protection.
The MT3608 is packaged on a tiny breakout board with a trimpot for setting voltage levels. While it might look tiny this device can source an impressive 2 amperes of current. The MT3608 has an efficiency rating of 93%.
With only four clearly labeled pins the MT3608 is very simple to use. As it is capable of outputs of up to 28 volts it is a good idea to use the trimpot to set the output voltage before connecting the device to your circuit.
Buck Boost Converter – S9V11F5 Step Up/Step Down Regulator
Now we move onto a device that is my personal favorite for battery powered devices – the S9V11F5 Step Up/Step Down Regulator.
Made by Pololu this little wonder can produce 5 volts with an input ranging from 2 volts to 16 volts. One thing to note is that the voltage needs to be at least 3 volts to get the converter started but once it’s running the input voltage can drop to 2 volts before it stops working.
This board is very small and has only three connections. It is packaged with both straight and right-angled male headers, allowing you to use it in the same place as a traditional 3-pin linear regulator.
The S9V11F5 is a member of a family of breakout boards, some with fixed output voltages and some that are variable.
The S9V11F5 does not require any external capacitors or other components to get it to work. It’s super small size and relatively high output current capability makes it ideal for many designs.
One thing to be aware of however is that the S9V11F5 can get quite hot, especially when used at full current capacity. Keep that in mind when you lay out your circuit board and don’t touch the converter when it is in use, you could burn yourself!
Breadboard Power Supply
Before we finish I want to mention one more method of powering up your projects.
The Breadboard Power Supply is a common component that is designed for, you guessed it, powering solderless breadboards. These inexpensive units have two linear regulators onboard to provide a steady 5 and/or 3.3 volts from a 9 – 15 volt dc input. They are designed to snap into the power rails of a standard solderless breadboard. The unit also features a 2.1 mm coaxial power input, power LED indicators, a USB power output and an on/off switch.
While these devices are obviously meant for use on the workbench with solderless breadboards they can also make a fine power supply for a permanent project. A they use linear regulators they are probably more suited to line-powered designs although they can be powered with a 9 volt battery.
I’d recommend having a few of these around your workshop, if only for experimenting.
Providing a good source of power is an essential part of designing electronic devices. As you have seen there are many methods you can use to provide a source of power for your electronics projects.
If you intend to use line (AC) power to provide electricity for your device you need to be sure to take the proper safety precautions to prevent any chance of electric shock. The best method of doing this is to use a commercial AC adapter or “wall wart” to provide a safe source of DC power, which you can then regulate using one of the methods described above if necessary. Using a commercial adapter that has been certified for use in your country (i.e UL approval, CAS approval etc.) will also satisfy insurance requirements, a very important factor especially if you intend to mass-produce your design.
For battery powered designs the use of an efficient voltage converter can extend the running time of your project by squeezing every last drop of energy from your batteries before require recharging or replacement.
No matter what your requirements are you’re sure to find a converter or regulator to suit your needs.
Now let’s get powered up!
78XX Family Spec Sheet – Datasheet for the 78XX family of linear voltage regulators.
LM317 Spec Sheet – Datasheet from Texas Instruments for the LM317 linear variable voltage regulator.
AMS1117 Spec Sheet – Datasheet for the AMS1117 linear voltage regulator.
Si9172 PSM Buck Converter – Spec sheet for the integrated circuit in the PSM-165
MP2307 Step-Down Converter – Datasheet for the integrated circuit in the MINI-360 Buck Converter.
Low Dropout Linear Regulators – The design behind the L4931CZ33-AP and other regulators in its family.
MT3608 Spec Sheet – Datasheet for the integrated circuit in the MT3806 boost converter module