H Bridge for microcontroller power management?
While it may be possible to bend one of those to your proposed usage, it's far from ideal, for a number of reasons:


It's far more expensive than the single P-FET that you need to get the job done
It's risky: you can easily reverse the current through your components and blow them up
It imposes a ground offset which can cause you communication problems.


All you need is a single P-channel MOSFET (assuming you are switching 5V with a 5V logic signal) and a single resistor (10kΩ would be fine, but any large value is ok).







simulate this circuit &ndash; Schematic created using CircuitLab

Pull the GPIO LOW and the power switches on. As simple as that.

If you want to switch a higher voltage then simple use an N-channel MOSFET to pull the GPIO line LOW for you - which you then switch with your GPIO signal.