## AC-DC Power Supplies - Using Wall Warts

AC-DC Power Supplies - Using Wall Warts | General Electronics  One thing all of our projects need is a power supply.  Sometimes batteries are the best answer, but often a AC line-power - DC supply is the right answer.  Linear power supplies are easy to build but a "wall wart" is usually cheaper and easier to use.  Wall warts come in a confusing array of shapes and sizes.  This article will cover some power supply basics and provide guidance for selecting and using these useful power supplies.

### Background

In order to select an appropriate power supply, several factors must be considered.

The first consideration in selecting a power supply is whether the board you're powering has a voltage regulator.  If you designed the board, you should know :)  If you're working with a dev board, the acceptable supply voltage should be specified in the documentation.  Using mrbasher's board as an example, if the board has a regulator, it will usually be located near the power connector and look something like the photo below.  Not all voltage regulators use this TO-220 package shown but it is quite common.

The next consideration is what voltage the parts on the board actually need.  Many PIC circuits require 5 volts but 3.3 volts is becoming common too.  If the board does not have an on-board regulator (the TAP-28 board is a prime example), we'll need a regulated power supply of the correct voltage.  If there is a regulator on the board, the power supply will have to supply a voltage higher than the regulator voltage + the regulator dropout voltage.  Some details follow.

The next consideration is how much current the board draws.  This is the current to power the chips, light the LEDs, power  anything attached to the board and to support any pull-up or pull-down resistors on the board.  LEDs and other things attached to the board are probably the biggest draw.  Still using mrbasher's board as an example, the resistors look to be 270 ohms, and a typical green LED has a voltage drop of 2.1 volts, so

$I_L_E_D = \frac{(V_S_u_p_p_l_y - V_f_ _L_E_D)}{R} = \frac{(5v - 2.1v)}{270\Omega} = 10.7 mA$

We'll call it 11 mA per LED x 8 LEDs = 88 mA when all the LEDs are illuminated.  The current for the PIC and the 74HC595 shift register won't add much, so our power budget is around 100 mA.

Our power supply has to supply at least 100 mA, but more current is ok..  The circuit draws only the current it needs to operate.  If the power supply is rated for say 1000 mA, it's going to be perfectly happy loafing along  supplying 100 mA or less.

Back to the question of what voltage is needed.  Assume the voltage regulator is an LM7805.  The dropout voltage for a LM7805 is 2 volts.  Think of this as the overhead it needs to work.  The maximum voltage an LM7805 can handle is 35 volts.  So any voltage between 7 volts (Vreg + Vdropout) and 35 volts (the maximum voltage) will provide a 5 volt output from the regulator.  Piece of cake.... Unfortunately, it's not quite this simple.  LDOs (low dropout) regulators are available that reduce the needed overhead voltage.

The LM7805 is a linear regulator (the following applies to all linear regulators).  The current into the regulator is the same as the current out of the regulator.  Our circuit uses about 500 mW maximum (5 volts x 100 mA = 500 mW).  If we supply 35 volts to the regulator, a total of 30 volts is dropped or lost across the regulator.  30 volts x 100 mA = 3 watts.  Where does this energy go?  Heat.  Have you ever burned your finger on a night light bulb?  They draw 4 watts.  Our regulator isn't going to be too happy dissipating this much power.

The voltage supplied to the regulator should be close to the voltage it needs to work to minimize power dissipation.  What happens if we supply it with 9 volts?  The drop  across the regulator is 4 volts, so the power is 400 mW.  This change drops the power dissipation by a factor of 10 and now our regulator is happy.  How high a voltage level is acceptable depends on the current draw of the circuit.  If the current draw is high, the voltage should be close to the voltage needed by the regulator.  If the current draw is low, there's more latitude.  The maximum allowable voltage depends on the actual regulator used.  The equation below is the power dissipated by the regulator:

$P_r_e_g_u_l_a_t_o_r = (V_s_u_p_p_l_y - V_r_e_g_u_l_a_t_o_r)I_l_o_a_d$

##### Summarizing:

Current must be greater than the maximum draw of the circuit being powered but anything larger is ok

Voltage for a board without a regulator must be regulated at the voltage required

Voltage for a board with a regulator must be greater than Vreg + Vdropout but not too much higher

Posted: 6 years 7 months ago
At long last, here is my article on using wall wart power supplies. The article covers some of the basics of power supplies, compares the characteristics of linear & switching supplies and gives some guidelines for using them.

I hope you'll find this article useful and gain some understanding of how to select a good supply for your application.

Consider using these well designed and engineered supplies that can be had for a couple bucks at the local thrift store or computer recycler.
Posted: 6 years 7 months ago by Jon G
This is really awesome info and well written. I've told Jon this already but it really does a nice job explaining what is really going on with the supplies. Because of this it really helps someone like myself understand what I am hooking up to my precious little experiments and gives me ideas for future ones as well.

Posted: 6 years 7 months ago
Thanks

I did learn something about power supplies during my testing. I was under the mistaken impression that higher-quality linear supplies included regulation but supplies like the "universal AC supply" like RadioShack used to supply (with the cable with 6 different tips sticking out) didn't. Turns out that regulation in a linear wall wart is almost non-existent.
Posted: 6 years 7 months ago
This is really awesome info and well written. I've told Jon this already but it really does a nice job explaining what is really going on with the supplies. Because of this it really helps someone like myself understand what I am hooking up to my precious little experiments and gives me ideas for future ones as well.

+1 from me Jon

Outstanding write up on the theory and application of AC-DC power supplies! This article will no doubt be a handy reference for many in the future.
Posted: 6 years 7 months ago
Here's a short addition to the article regarding dropout voltage of a linear regulator.

National Semiconductor's data sheet for the LM78xx-C series of regulators is specified as 2 volts. This is the overhead the regulator needs to function. For an LM7805, 7 volts would be required to ensure a 5 volt output from the regulator.

I set up a quick test using a generic LM7812C regulator to examine what happens if the input voltage is too low. This first plot shows data taken with a load of 100 mA as the input voltage was decreased.

The blue line is the input voltage and the red line is the output voltage. This particular regulator, at a slightly cool room temperature, is supplying 11.7 volts. This output voltage was maintained until the input voltage fell below 13.5 volts. Below 13.5 volts, the output voltage is 1.38 volts less than the input voltage. The voltage drop across the regulator is 1.38 volts but the data sheet specified 2 volts.

When the input voltage dropped below the operating voltage of the regulator (Vreg + Vdropout), the output voltage was 1.38 volts lower than the input voltage. The regulator did not shut down or stop the out-of-spec voltage from being supplied.

The data sheet specifies the dropout voltage as 2 volts, yet I only measured 1.38 volts. Let's look a little more closely at this. The next plot shows the dropout voltage vs. load.

This graph shows that the dropout voltage is a function of load. As the load neared 1000 mA, the dropout voltage increased to 1.5 volts. Not shown in this graph is the dropout voltage is also a function of temperature. The 50 mA reading followed the 800 mA reading and was initially quite a bit greater. After operating with a 800 mA load, the regulator was hot to the touch. As the regulator cooled back to a cool room temperature, the dropout voltage returned to 1.38. I was not able to test at higher currents because of the arrangement of my constant current load. At full rated load and temperature, I believe the dropout voltage would be as high as the 2 volts specified.

We can see from these quick measurements that if the input voltage is too low, the output voltage will fall below the regulated value. *(see below) Also, the value for dropout voltage in the data sheet is the worst case - if we supply more than Vreg + Vdropout, the regulator will function correctly under all operating conditions.

*Note: Some linear regulators provide a "power good" signal that can be used to shutoff loads if the voltage falls too low. Devices may not work properly or even be damaged if the voltage drops below a specified value.

So you should now have enough knowledge to answer the homework question of the day. If the output from a 12V RMS wall wart containing only a bridge rectifier and no filter caps is used to supply an LM7812 regulator, what will the output waveform look like? A sketch is the preferred answer. Valuable prices may be awarded for a correct answer...or maybe some brain cells will live a little longer.
Posted: 6 years 7 months ago by jmessina
Great job, Jon.

Will you be handing out degrees to "Chandler University"?
Posted: 6 years 7 months ago
Thanks Jerry. Degrees are only available with the a drawing of a dog and the matchbook cover.

(I wonder how many people that will loose?)

Where is the audience participation????
Posted: 6 years 7 months ago by Jon G
I'll give it a shot... wait... Is it a full-wave rectifier or is that the same thing as a bridge rectifier? Well, my drawing is for a full-wave one.
Posted: 6 years 7 months ago by Jon G
Is this right for say, a 14v supply?
Posted: 6 years 7 months ago
Well, almost

On your first drawing, a 12 volt RMS transformer will actually put out ~ 17 volts peak, A bridge rectifier will provide full-wave rectification, so you get both halves of the sine wave like you're shown.

So your third drawing is about right. You'd actually get the rectified sine wave, with the peaks cut off at 12 volts.

Your circuit sure wouldn't be too happy with the result! But it's easy fixed - add a big filter capacitor prior to the voltage regulator, where big is defined as several hundred uF or more.

Thanks for joining in the audience participation portion!