Electronics 106: Power Supplies, Buck & Boost Converters
A practical, engineering-focused guide to choosing and using linear regulators and switching DC-DC converters (buck, boost, buck-boost) without burning boards, browning out MCUs, or guessing current ratings.
1) What is a power supply?
A power supply’s job is to provide a stable voltage at the required current for your circuit. In practice, “stable” also means acceptable noise and good behavior under load transients (like motors starting, WiFi modules transmitting, relays switching, LEDs turning on).
2) Power basics (V, I, P) you must know
Power is simply:
P = V × I
If your circuit needs 5V at 1A, that’s:
P = 5V × 1A = 5W
In an ideal world, a converter preserves power (it doesn’t create power), so if you convert from a higher voltage to a lower voltage, the current often increases.
5W / 12V ˜ 0.42A (plus losses).
3) Linear vs Switching Regulators
Linear regulators (e.g., 7805, AMS1117)
A linear regulator “burns off” extra voltage as heat. The output is typically clean (low noise), but efficiency is poor when the input voltage is much higher than the output.
P_heat = (V_in - V_out) × I_out
If you feed 12V into a 5V linear regulator and draw 1A:
P_heat = (12 - 5) × 1A = 7W ? This will run extremely hot.
Switching regulators (DC-DC converters)
Switching converters use inductors and high-frequency switching to efficiently convert power. They are usually much more efficient than linear regulators but can introduce ripple/noise if used incorrectly.
| Type | Pros | Cons | Best use |
|---|---|---|---|
| Linear | Low noise, simple | Runs hot, inefficient | Small current loads, analog circuits |
| Switching (DC-DC) | High efficiency, higher currents | Ripple/noise, layout matters | Battery/12V systems, MCUs, motors, LEDs |
4) Buck converters (step-down)
A buck converter steps voltage down (e.g., 12V ? 5V). These are extremely common in robotics and Arduino/ESP32 projects.
5) Boost converters (step-up)
A boost converter steps voltage up (e.g., 3.7V Li-ion ? 5V). Great when you have a battery and need a higher stable voltage.
6) Buck-boost converters (step-up/down)
A buck-boost handles input voltages that can be above or below the required output voltage. This is useful when a battery discharges over time (e.g., 4.2V down to 3.0V) but you still need a fixed 5V output.
7) Efficiency, heat, and why things burn
Converter efficiency is typically expressed as a percentage:
Efficiency = (P_out / P_in) × 100%
The “missing power” becomes heat:
P_heat ˜ P_in - P_out
8) Understanding current ratings (marketing vs reality)
Most modules quote a “max current” that assumes ideal cooling and a limited temperature rise. Real-world continuous current can be significantly lower, especially in a closed enclosure.
- Continuous current matters more than “peak”.
- Modules can hit thermal shutdown without warning.
- Thin wires and breadboards introduce voltage drop at higher currents.
9) Noise, ripple, and powering MCUs
Switching converters can create ripple. Microcontrollers (especially with WiFi/BT like ESP32) can brown out or reset when the supply dips during current spikes.
- Add bulk capacitance near loads (e.g., 220–1000µF electrolytic) where appropriate.
- Add decoupling capacitors near MCU power pins (e.g., 0.1µF ceramic).
- Keep power leads short; avoid long, thin wires for high current.
Cause: Almost always a power integrity issue.
10) Wiring, grounding, and layout rules (real-world)
- Star ground for mixed loads (MCU + motor): keep motor currents out of MCU ground path.
- Twist power pairs for motors where possible (reduces EMI).
- Put converters close to the load (reduces drop).
- Use thicker wire for high current rails.
- Keep switching converters away from sensitive analog inputs (or shield/filter).
11) Selection guide (what to choose)
- Your current is low (tens to a few hundred mA).
- Input voltage is close to output voltage.
- Noise performance is critical (some analog sensors/amps).
- Input voltage is significantly higher than output (12V ? 5V, 24V ? 5V).
- You need higher current with less heat.
- You need a higher voltage than your battery/source provides.
- Your input varies above and below the output target.
12) Common mistakes & troubleshooting checklist
- Wrong polarity (immediate smoke risk).
- Assuming current is “pushed” rather than “drawn”.
- Running linear regs from high input voltage at high current.
- Powering motors from the same rail as the MCU without proper decoupling/grounding.
- Using breadboards for high current (voltage drop + heating).
- Not measuring under load (voltage looks fine with no load, collapses under load).
V_out at the load while it is operating (motors spinning / WiFi transmitting).
If voltage dips, fix power first before debugging code.