# Power Supply Design Guide ## Topology Selection | Topology | When to Use | Efficiency | Noise | Cost | |----------|-------------|------------|-------|------| | **LDO** | Vdrop < 1V, Iout < 500mA, noise-sensitive | Low (η ≈ Vout/Vin) | Very low | Low | | **Buck** | Vdrop > 1V, Iout > 200mA, efficiency matters | High (85-95%) | Medium | Medium | | **Buck + LDO chain** | High Vin, multiple rails, mixed noise needs | Good overall | Low on LDO rails | Medium | | **Boost** | Vout > Vin (battery → 5V, etc.) | Medium (80-90%) | Medium-High | Medium | | **Buck-Boost** | Vin can be above or below Vout | Medium | High | High | | **Charge Pump** | Small current (<100mA), voltage doubling/inversion | Medium | High | Low | ### Decision Tree ``` Is Vin always > Vout? ├─ Yes → Is (Vin - Vout) < 1V AND Iout < 500mA? │ ├─ Yes → LDO │ └─ No → Is noise critical on this rail? │ ├─ Yes → Buck + LDO (buck for bulk, LDO for clean rail) │ └─ No → Buck └─ No → Is Vin sometimes < Vout? ├─ Yes → Buck-Boost (or SEPIC) └─ No → Boost ``` ## Input Protection Every power input should have: 1. **Reverse polarity protection**: P-MOSFET (preferred) or Schottky diode (simpler, lossy) 2. **Overvoltage / transient protection**: TVS diode rated above max operating voltage 3. **Inrush current limiting**: NTC thermistor or soft-start IC for high-capacitance designs 4. **Fuse**: Resettable PTC or standard fuse, rated for max expected current × 1.5 ```python # circuit-synth pattern: input protection block @circuit(name="input_protection") def input_protection(vin_raw, vin_protected, gnd): fuse = Component(symbol="Device:Fuse_Small", ref="F", value="2A", footprint="Fuse:Fuse_1206_3216Metric") tvs = Component(symbol="Diode:TVS", ref="D_TVS", value="SMBJ15A", footprint="Diode_SMD:D_SMA") cin = Component(symbol="Device:C", ref="C_IN", value="10uF", footprint="Capacitor_SMD:C_1206_3216Metric") vin_raw += fuse[1] fuse[2] += tvs["A"] # TVS anode to fused input tvs["K"] += gnd # TVS cathode to ground (unidirectional) vin_protected += fuse[2], cin[1] gnd += cin[2] ``` ## Decoupling Strategy ### Per-IC decoupling (mandatory) - **100nF ceramic (X7R/X5R, 0402 or 0603)** on every VDD pin, placed as close as possible. - For MCUs with VDDA (analog supply): separate 100nF + 1µF, with ferrite bead isolation. - For MCUs with VCAP (internal regulator output): capacitor per datasheet (typically 2.2µF). ### Per-rail bulk capacitors - **10µF ceramic** per power rail (at the regulator output). - **100µF electrolytic/tantalum** for high-current rails (>500mA). ### High-frequency bypass - **100nF + 10nF** pair for noise-sensitive analog circuits. - Place smaller cap closest to IC pin. ### Layout rules - Capacitor → IC pin via is shorter than capacitor → pour via. - Ground vias under decoupling caps (direct path to ground plane). - Never route high-speed signals under/near switching regulators. ## Common Regulator Reference Circuits ### LDO: AMS1117-3.3 (SOT-223) ```python @circuit(name="ldo_3v3") def ldo_3v3(vin, vout_3v3, gnd): reg = Component(symbol="Regulator_Linear:AMS1117-3.3", ref="U_LDO", footprint="Package_TO_SOT_SMD:SOT-223-3_TabPin2") cin = Component(symbol="Device:C", ref="C_LDO_IN", value="10uF", footprint="Capacitor_SMD:C_0805_2012Metric") cout = Component(symbol="Device:C", ref="C_LDO_OUT", value="22uF", footprint="Capacitor_SMD:C_0805_2012Metric") vin += reg["VI"], cin[1] vout_3v3 += reg["VO"], cout[1] gnd += reg["GND"], cin[2], cout[2] ``` ### Buck: TPS54331 (SOIC-8) — 3A, 3.5-28V input ```python @circuit(name="buck_5v") def buck_5v(vin, vout_5v, gnd): buck = Component(symbol="Regulator_Switching:TPS54331", ref="U_BUCK", footprint="Package_SO:SOIC-8_3.9x4.9mm_P1.27mm") inductor = Component(symbol="Device:L", ref="L_BUCK", value="15uH", footprint="Inductor_SMD:L_1210_3225Metric") diode = Component(symbol="Diode:SS34", ref="D_BUCK", footprint="Diode_SMD:D_SMA") # Feedback resistors, bootstrap cap, input/output caps... # (Complete circuit depends on exact target voltage) vin += buck["VIN"] buck["GND"] += gnd buck["PH"] += inductor[1], diode["K"] inductor[2] += vout_5v diode["A"] += gnd ``` ## Multi-Rail Design Patterns ### Pattern: 12V → 5V (Buck) → 3.3V (LDO) → 1.8V (LDO) Good for: general-purpose MCU boards, moderate current. ``` VIN_12V ──→ [Buck] ──→ 5V rail (1A) ├──→ [LDO] ──→ 3.3V rail (500mA) │ └──→ MCU VDD, peripherals └──→ [LDO] ──→ 1.8V rail (200mA) └──→ MCU VCORE (if separate) ``` ### Pattern: USB 5V → 3.3V (LDO) Good for: simple USB-powered devices. ``` USB_VBUS ──→ [Fuse 500mA] ──→ [LDO] ──→ 3.3V ``` ### Pattern: Battery (3.0-4.2V) → 3.3V (Buck-Boost or LDO) Good for: battery-powered IoT. LDO if battery always > 3.5V; buck-boost otherwise. ## Thermal Considerations - Calculate power dissipation: `P = (Vin - Vout) × Iout` for LDO - Check junction temperature: `Tj = Ta + P × θja` - SOT-223 θja ≈ 65°C/W; SOIC-8 ≈ 125°C/W; QFN exposed pad ≈ 35°C/W - If Tj > 125°C at max load → need larger package or switch to buck