Switching power between USB and Battery [ How to isolate USB properly ?]
I’m working on a dual-supply setup and running into an issue that’s already cost me a few USB ports. My motor drivers (DRV8874) require at least a 20V supply, which I plan to provide using a battery (or bench power supply during testing). At the same time, I’m using an ST-LINK clone (USB flash drive style) connected through an IDC cable for programming my STM32. The ST-LINK provides 5V, which I regulate down to 3.3V.
Previously, I accidentally fried my USB ports when I used an SPDT switch to toggle between the 20V and 5V supply rails while both the battery and USB were connected. I suspect this caused some kind of capacitive or inductive transient.
To fix this, I tried isolating the USB supply using a protection circuit (attached), but I still ended up damaging my USB extender. What am I doing wrong here? Why is the USB side still getting damaged despite isolation? How can I properly protect the USB without using a dedicated power-path management IC? I do NOT want to charge the battery from USB. The USB connection is only for flashing/debugging, not for powering the DRVs.
Any advice or suggested circuit improvements would be really appreciated.
Posted Apr 1, 2026, 8:16 PM UTC