Power Supplies and Voltage Regulators
Turn a raw source into clean, stable power: rectifier and smoothing, ripple, linear regulators and their heat, dropout voltage, switching (buck and boost) converters and efficiency, input protection, thermal calculations, decoupling, and choosing between a linear and a switching regulator.
1. The power chain
Most electronics run on a stable voltage such as 5 V or 3.3 V, but the source is often something else: a 12 V adapter, a battery that droops as it discharges, or rectified mains. A typical chain is:
2. Rectifier and smoothing
Mains (or a transformer’s AC secondary) is converted to DC by diodes. A bridge rectifier uses four diodes so both half-cycles are used; the output is pulsating DC at twice the mains frequency (100 Hz on 50 Hz mains). A reservoir capacitor smooths it.
- Peak DC voltage ≈ V_secondary(RMS) × 1.414 − 1.4 V (two diode drops in the bridge). A 12 V RMS transformer gives about 12 × 1.414 − 1.4 = 15.6 V.
- Ripple is the leftover AC on the DC: ΔV ≈ I / (f × C), with f the ripple frequency (100 Hz). 100 mA with 1,000 µF at 100 Hz: 0.1 / (100 × 0.001) = 1 V of ripple. A larger capacitor or lower current gives less; a regulator removes most of the rest.
- Use a capacitor with a voltage rating well above the peak, and fuse the primary side.
Only use certified, enclosed mains adapters while you are learning. Building mains-powered supplies is for trained people.
3. Linear regulators
A linear regulator such as the LM7805 (fixed 5 V) or an LDO like the AMS1117-3.3 keeps the output steady by acting as a variable resistor in series, burning off the excess voltage as heat:
P_heat = (Vin − Vout) × I_load
- 12 V in, 5 V out, 0.5 A: P = 7 × 0.5 = 3.5 W, which is a lot of heat for a small package.
- Dropout voltage: the minimum Vin − Vout for regulation. A 7805 needs about 2 V (so at least 7 V in for 5 V out); an LDO needs maybe 0.3 V. At low battery voltage, the dropout decides when the output collapses.
- Efficiency ≈ Vout / Vin (ignoring the small quiescent current): 5 / 12 = 42 percent.
- Capacitors: follow the datasheet for input and output capacitors; some LDOs are unstable with the wrong type.
- Advantages: very low noise, simple, cheap. Good for small loads, quiet analog circuits, and when Vin is close to Vout.
Thermal check. Junction temperature: T_j = T_ambient + P × θ, where θ (°C per watt) comes from the datasheet. With θ_JA = 50 °C/W and 3.5 W at 25 °C ambient, T_j = 25 + 175 = 200 °C, beyond the usual 125 to 150 °C limit. The regulator would shut down or fail. Reduce the voltage drop, add a heat sink, or use a switching regulator.
4. Switching regulators
A switching regulator turns a transistor on and off very fast (tens or hundreds of kilohertz) and uses an inductor and capacitor to smooth the result, so little power is wasted as heat.
| Type | Output vs input | Ideal relation |
|---|---|---|
| Buck (step-down) | Lower than input | D = Vout / Vin (duty cycle) |
| Boost (step-up) | Higher than input | Vout = Vin / (1 − D) |
| Buck-boost | Either | Used for batteries across a wide range |
- Efficiency is typically 85 to 95 percent: a buck converter from 12 V to 5 V at 0.5 A might lose only 0.3 to 0.5 W instead of 3.5 W.
- Ideal buck duty cycle: 5 / 12 = 41.7 percent.
- Drawbacks: switching noise and ripple (can disturb sensitive analog or radio circuits), layout sensitivity, and radiated interference. Use ready-made modules or recommended layouts and filter the output with an LC or a following LDO for noise-sensitive circuits.
- Choose the inductor current rating above the peak current, and low-ESR capacitors as the datasheet says.
5. Protection and good practice
- Reverse polarity: a series diode or P-channel MOSFET (diode lesson).
- Fuse or resettable polyfuse at the input, rated for the maximum safe current.
- Overvoltage: a TVS diode across the input absorbs spikes; a Zener clamp helps with small loads.
- Decoupling: 100 nF ceramic at every chip plus bulk capacitance (10 to 100 µF) near the regulator, and short, wide ground and power tracks.
- Soft start and inrush: large capacitors draw a big current when power is applied; limit it if the source is weak.
- Test under load and at the lowest and highest input voltages, not just on the bench with a light load.
6. On your bench
- Build a 7805 (or an LDO) circuit from a 9 V battery or 12 V adapter with the datasheet’s capacitors. Measure the output with no load and with a 100 Ω load (50 mA).
- Calculate the power in the regulator and touch (briefly, carefully) the case after a minute to feel the heat. Measure the input and output current and compute the efficiency.
- Replace it with a buck converter module set to 5 V and repeat. Compare efficiency and the temperature.
- Use a scope with AC coupling at 20 mV/div on each output and compare the noise: linear is quiet, switching shows a spiky ripple.
- Reduce the input voltage slowly until the regulator drops out and the output follows the input down. Record the dropout voltage.
7. Hands-on lab: regulator and supply calculations
8. Common mistakes
| Mistake | Better |
|---|---|
| A 7805 from 24 V at a high current | Use a buck converter; the linear part would cook |
| Ignoring dropout at low battery voltage | Check Vin_min against Vout + dropout |
| No input or output capacitors | Follow the datasheet |
| Switching noise on sensitive analog | LC filter, an LDO after the buck, careful layout |
| No fuse or reverse protection | Add both on the input |
| Testing only with a light load | Test at full load and across the input range |
9. Key takeaways
- A power chain is protection, rectifier, smoothing, regulator, decoupling.
- Ripple ≈ I / (f × C); a bridge on 50 Hz mains ripples at 100 Hz.
- A linear regulator wastes (Vin − Vout) × I as heat and has a dropout voltage; check T_j = T_a + P × θ.
- A switching regulator (buck, boost) is 85 to 95 percent efficient but noisier.
- Add fuses, reverse protection and decoupling, and test across the whole input range.
A battery-powered sensor uses a 4 x AA pack (4.0 to 6.4 V) and a 3.3 V, 100 mA load. Linear or switching?
At 6.4 V the linear loss is (6.4 − 3.3) × 0.1 = 0.31 W with 52 percent efficiency, and when the pack falls to 4.0 V a low-dropout (0.3 V) part still works. For a duty-cycled sensor that sleeps most of the time, quiescent current matters more than conversion efficiency, so a low-quiescent LDO is a good choice. A buck-boost would be better if the load runs continuously and battery life matters, or if the pack could go below 3.6 V.
Can You Explain It?
Close the lesson and answer these without looking back. The goal isn't the wording — it's whether you've formed a usable mental model.
- Explain how a bridge rectifier and reservoir capacitor create DC and how to estimate ripple.
- Compare linear and switching regulators on heat, efficiency and noise.
- Show how to check a regulator's junction temperature and what to do if it is too high.
🧪 Want to practise this on your own computer? See how to set up your lab →