Designing an active‑high 3.3 V high‑side switch for op‑amps with an STM32 GPIO
Published 2026-11-05
Circuit that makes an active‑high GPIO turn 3.3 V on
Use a P‑channel MOSFET high‑side switch: source to 3.3 V input, drain to the op‑amp rail, gate normally pulled up to 3.3 V so it is off until an NMOS sinks the gate when the STM32 GPIO goes high. Start with concrete values and verify against your load current and inrush budget.
- P‑MOSFET: choose RDS(on) ≤ 50 mΩ at VGS = −2.5 V so the drop stays <5 mV at 100 mA; examples engineers often use and can source easily include SiA446DJ (~23 mΩ @ −2.5 V), DMP2035U (~35 mΩ @ −2.5 V), IRLML6402 (~80 mΩ @ −2.5 V). Ensure VGS(max) ≥ ±12 V and check the package θJA.
- N‑MOSFET to pull the P‑FET gate low: 2N7002 or BSS138 is sufficient; drive it from the STM32 pin through 150 Ω.
- Gate network: 100 kΩ from PFET gate to 3.3 V for a safe default off; 47 nF from PFET gate to source for soft‑start (τ ≈ 4.7 ms); 100 kΩ from NMOS gate to GND so EN defaults low; ~150 Ω from MCU pin to NMOS gate to tame edges.
- Output discharge and defaulting: 100 kΩ bleeder from the analog rail to GND discharges the op‑amp rail when off (~33 µA during normal operation). If you need faster discharge, reduce this while checking standby current.
What values should I start with?
Size the PFET from your peak current and dropout target. Example: four op‑amps at 2.5 mA each average ~10 mA; allow 50–100 mA for startup. With RDS(on) = 35 mΩ, Vdrop ≈ 3.5 mV at 100 mA and dissipation ≈ 0.35 mW (I²R). If your op‑amp rail ever draws 500 mA transients, 50 mΩ would dissipate ~12.5 mW—still small but verify copper area and θJA.
How do I set slew and inrush current?
Estimate the output capacitance (local bulk 4.7–10 µF near the switch plus 0.1 µF per op‑amp). To cap inrush at 15 mA with 10 µF total, target dV/dt ≤ 1.5 V/ms (I = C × dV/dt). With the 100 kΩ/47 nF gate RC (τ ≈ 4.7 ms), you typically get a millisecond‑scale output rise; adjust Cgs (10–100 nF) to meet your measured Iinrush. Validate with a current probe: Pinrush = VIN × Iinrush is a quick cross‑check.
How do I prevent backfeed through op‑amp I/O?
If an op‑amp pin is driven when V+ is off, ESD diodes can lift the rail. Ensure upstream drivers tri‑state before disabling the rail or insert series resistors. A 10 kΩ series part limits a 3.3 V input to roughly (3.3 − 0.3)/10 kΩ ≈ 0.3 mA into the clamp, which is below the 1 mA maximum common on many small‑signal ESD diodes—always confirm in your op‑amp datasheet. Keep the bleeder so the analog rail falls to <0.3 V within a few milliseconds after disable.
Prefer a load‑switch IC? Numbers to check
A 1.1–5.5 V load switch simplifies soft‑start and can add reverse‑current blocking. For a 3.3 V op‑amp rail, look for: ON pin active‑high; RON at 3.3 V in the 20–100 mΩ range for single‑digit mV drop at ≤100 mA; controlled rise time in the 0.5–5 ms range (or an external C pin) to hit your Iinrush limit; a specified reverse‑current block when disabled (often implemented with back‑to‑back FETs), and optional quick‑output‑discharge. Families engineers commonly select from include TI TPS22910A/12/18/19, Microchip MIC2005/2009, and Diodes Inc. AP2331/2332. Verify in each datasheet the enable polarity, RON at 3.3 V, rise‑time curve vs. load capacitance, whether true reverse‑current blocking is present, and any current‑limit/foldback behavior that could trip during op‑amp startup.
PCB layout that keeps the analog rail quiet
Place the PFET or load‑switch within a few millimeters of the bulk capacitor (4.7–10 µF) feeding the op‑amp rail and keep each op‑amp’s 0.1 µF at its V+ pin. Use short, wide copper from the 3.3 V source to the switch and from the switch to the analog rail; for ≤100 mA on 1 oz copper, a 6–10 mil trace is typically adequate—consult IPC‑2152 if you need more margin. Keep the PFET gate node compact to avoid coupling; if you observe ringing, a 0 Ω jumper footprint lets you add a small gate‑stopper during bring‑up. Star‑route the analog rail after the switch and tie analog ground to the main plane near the decouplers to keep digital return currents away from the op‑amp loop.
Bring‑up checks that catch mistakes fast
Confirm EN=1 pulls the PFET gate near 0 V; EN=0 lets it sit at 3.3 V. Measure rise time and compute Iinrush = Ctotal × dV/dt across temperature. During power‑down with op‑amp inputs driven, probe the analog rail; it should fall below ~0.3 V promptly if backfeed is controlled. Re‑check thermal margins if your load exceeds the original assumption.
Manufacturing and documentation support
HyperPCB operates an ISO 9001:2015 certified QMS (certificate CN‑2023‑Q1156, SGS, valid through June 2027) and supports RoHS and REACH compliance for hazardous substance control. Boards can be built and inspected to IPC Class 2 or IPC Class 3 acceptance criteria. Quotes are typically returned within 24 hours and DFM feedback within 1 business day.
Send your schematic and stackup for a fast DFM check—quote in 24 hours, feedback in 1 business day. — Get a quote