Electronic Power Supply: Build or Buy?
You can probably purchase a preassembled power adapter that will provide the voltage you need for your electronics project for just a few dollars more than you could build the circuit yourself. A power adapter, also called a wall wart, is a self-contained power supply circuit that plugs into a wall outlet and provides a specified level of AC or DC voltage as its output.
When you purchase a power adapter, you need to check the specifications to make sure you’re purchasing the correct adapter. The specifications are usually printed on the adapter itself. Look for the following important specifications:
AC or DC: Not all power adapters supply direct current; some are made to power low-voltage AC devices. So make sure that you get an adapter that provides direct-current output.
Voltage level: Next, check the output voltage. Some power adapters have a switch that lets you choose from among several output voltages. If you use such an adapter, make sure you set the switch to the correct output level for your circuit.
Current capacity: Most power adapters will have a maximum current rating expressed in milliamps. Smaller adapters can handle a few hundred milliamps, whereas larger adapters may be able to handle an ampere or more. Make sure that the adapter you use can handle the current requirements of your project. (Although some power adapters can handle several, few can handle more than that.)
Polarity: Most power adapters use a barrel connector to plug the power adapter into the circuit. In nearly all modern power adapters, the center connection of the barrel connector is positive, and the outer connection is negative.
However, some power adapters are wired just the opposite, with negative in the center and positive on the outside. The polarity of the connector should be printed on the adapter along with the voltage and current specifications.
Connector size: Unfortunately, there are far too many different sizes and styles of connectors used for power adapters. Once you’ve purchased a power adapter, you can go to a local electronics store such as RadioShack and purchase a jack that is compatible with the connector on the power adapter. Then, you can use the jack to connect the power adapter to your circuit.
Using a power adapter instead of building your own power supply can make your project safer to build and use. That’s because the part of your project that is potentially dangerous — the part that works directly with 120 VAC line voltage — is fully contained inside the preassembled power adapter.
Wall warts convert AC to DC and step down the voltage, but most do not provide power that is very clean (that is, a pure level of DC) or stable (that is, with a predictable voltage). Thus, even if you use a wall wart to power your project, you may still need to add circuitry that will improve the quality of the DC supplied.
If you want to build your own power supply circuit for a project to convert 120 VAC line voltage to a DC voltage that's suitable for your circuit, you’ll have to design a power supply circuit that provides at least three distinct functions:
Voltage transformation: Reduces the 120 VAC line voltage to the voltage your circuit needs.
Rectification: Converts the reduced AC voltage to DC voltage. Note that the DC voltage produced by a rectifier circuit is technically direct current, but it isn’t steady direct current. Instead, a rectifier produces pulsating direct current in which the voltage fluctuates in sync with the 60 Hz alternating current that’s fed into it from the transformation stage.
Filtering: Smoothes out the ripples in the DC voltage produced by the rectification stage.