Circuit 3D

Power supplies

A power supply turns 120 V or 230 V mains, or a battery, into the steady DC voltage a circuit needs. A linear supply uses a heavy transformer and burns off the extra as heat; a switch mode power supply switches at high frequency, so it is small and about 90% efficient.

P = V × I

where V is the supply’s voltage and I the current the circuit draws: 12 V at 2 A is 24 W, so choose a 12 V supply rated 2.5 A or more.

What is a power supply?

A power supply is a device that turns the electricity you have, from the mains or a battery, into the steady DC voltage a circuit needs, such as 5 V for a microcontroller or 12 V for a motor.

Figure 1 shows the stages inside the two kinds.

Mains 120/230 V AC Rectifier 170/325 V DC Switch about 100 kHz Transformer small, light Rectifier and filter Output 5 V DC feedback

Switching: the mains is rectified first, to about 170 V DC from 120 V or 325 V from 230 V, then switched through a small transformer and rectified again. Feedback adjusts the switching to hold 5 V. Light, and about 80 to 95% efficient.

Figure 1. The stages inside two 5 V supplies, read left to right and down. The highlighted stage controls the output.

How does a power supply work?

A power supply works in stages: it lowers the mains voltage, rectifies the AC into DC, smooths it with a capacitor, and regulates it so the output stays steady whatever the load draws.

Mains is 120 V at 60 Hz in North America and 230 V at 50 Hz in most other countries. A bridge rectifier does the rectifying, and a regulator or switching controller holds the output.

What is a linear power supply?

A linear power supply steps the mains down with a transformer working at 50 or 60 Hz, rectifies and smooths it, then drops the extra voltage across a regulator as heat.

It is simple and electrically quiet, but its transformer is heavy, and it is often 50% efficient or less.

How does a switch mode power supply work?

A switch mode power supply, or SMPS, rectifies the mains first, then switches that DC on and off tens or hundreds of thousands of times a second through a small transformer, and rectifies the result.

Feedback, usually through an optocoupler, sets how long the switch stays on to hold the output steady. Without the transformer, the same idea makes buck and boost converters.

SMPS vs linear power supply: which should you use?

Use a switch mode supply for almost every project: it is smaller, lighter, cheaper and about 80 to 95% efficient, against 50% or less for a linear one.

A linear supply still wins for sensitive audio or radio work, because it has no switching noise.

What are 5 V and 12 V power supplies used for?

A 5 V supply, usually a USB charger, powers microcontrollers, Raspberry Pis and most sensors, while a 12 V wall adapter powers LED strips, fans and small motors.

Most 12 V adapters have a 5.5 × 2.1 mm barrel plug, center pin positive; check the label. A 5 m LED strip at 14.4 W a meter draws 72 W, 6 A at 12 V, so it needs a 12 V supply of 8 A or more and wire of 18 AWG, 0.82 mm², or thicker.

What is USB-C Power Delivery?

USB-C Power Delivery is a standard that lets a charger and a device agree on a voltage above USB’s 5 V, up to 20 V, for up to 100 W through one cable.

The charger gives more than 5 V only when asked, so a project can use a small PD trigger board to request 9, 15 or 20 V, as Figure 2 shows. Newer chargers add 28, 36 and 48 V, up to 240 W.

5 V 15 W 9 V 27 W 15 V 45 W 20 V 60 W 20 V, 5 A 100 W

20 V at up to 3 A: 20 V × 3 A = 60 W, for laptops, from any charger of 60 W or more.

Figure 2. The fixed voltages of USB-C Power Delivery and the most power each gives. A charger offers only the levels its rating covers.

What is a bench power supply?

A bench power supply is a variable power supply for testing circuits: you dial in a voltage, often 0 to 30 V, and a current limit, often up to 3 or 5 A.

If the circuit tries to draw more than the limit, the supply lowers its voltage to hold that current, so a wiring mistake gets warm instead of burning out.

How do you power an Arduino?

Power an Arduino Uno from its USB port at 5 V, from a 7 to 12 V supply on its barrel jack or VIN pin, or from a regulated 5 V supply on its 5V pin, which bypasses its regulator.

USB gives about 500 mA. Above 12 V on the jack, its regulator runs hot. See what is Arduino for its pins.

How do you choose a power supply?

To choose a power supply, match its voltage exactly to your circuit, add up the current every part draws, and pick a supply rated at least 20 to 25% above that total.

More amps than you need is safe: the circuit takes only what it draws. Check the plug, its polarity and a safety mark too.

Power supply calculator

24 W load 2.5 A supply, at least 30 W supply rating

The load is 12 V × 2 A = 24 W. With 25% to spare, choose a 12 V supply rated at least 2 A × 1.25 = 2.5 A, 30 W. At full load it draws about 24 W ÷ 0.85 ≈ 28.2 W from 120 V or 230 V mains.

Figure 3. A first sizing for a DC supply, taking a typical adapter as 85% efficient.

How do you work out the voltages inside a power supply?

Multiply an AC voltage by √2 for its peak, then subtract the rectifier’s 1.4 V drop for the DC a smoothing capacitor holds.

Example 1: the DC from a linear supply

A transformer’s 12 V AC winding feeds a bridge rectifier and a capacitor. What DC voltage does the capacitor hold?

Given
a 12 V AC winding, a bridge rectifier dropping 1.4 V, and a smoothing capacitor
Find
the DC on the capacitor with no load
Solution
Vpeak = 12 V × √2 ≈ 17 VVDC = 17 V − 1.4 V = 15.6 V
Answer
about 15.6 V, sagging a little under load: enough for a 5 V regulator, which needs about 7 V

Example 2: the DC inside a switching supply

A phone charger is plugged into 120 V mains. What DC voltage sits on its input capacitor?

Given
a switching supply on 120 V mains, rectified straight onto its input capacitor
Find
the DC on that capacitor
Solution
VDC = 120 V × √2 ≈ 170 V
Answer
about 170 V DC: enough to kill, and it can stay on the capacitor after unplugging, so never open a mains supply

Summary

Key equations

  • P = V × I power a load draws
  • Vpeak = Vrms × √2 an AC winding’s peak
  • Pin = Pout ÷ efficiency power from the wall

Key terms

SMPS
A switch mode power supply.
Linear supply
Transformer, rectifier, regulator.
Power Delivery
USB-C’s higher voltages.
Current limit
A bench supply’s maximum amps.

Practice problems

  1. A circuit needs 12 V at 1.5 A. Which supply suits it?

  2. Why is a switch mode power supply lighter than a linear one?

  3. What is the peak of a 12 V AC winding?

  4. Which voltage range does an Arduino Uno’s barrel jack recommend?

  5. How much power can USB-C Power Delivery give at 20 V and 3 A?

FAQ

Can I use a higher-voltage power supply?

Not directly; too high a voltage can destroy a circuit. Use one that matches, or a buck converter.

Is it safe to open a power supply?

No. Its capacitors can hold a lethal charge after unplugging; use a sealed, certified adapter instead.