This circuit is one of the basic circuits one can use to protect his circuit and the output of his power supply.
Actually, it is 2 circuits in one. The first circuit is a simple load switch to activate the entire power to the circuit or cut it. The second one after it is a mosfet ideal diode circuit with reverse current protection.
The combination of these 2 circuits achieves reverse current and reverse polarity protection, as well as, back feeding protection.
Complete video tutorial
Here is a complete video tutorial about it with simulation and explanation.
The design files and simulation files are available on github link: https://github.com/HossamVegetaMoghrabi/Ideal-diode-with-switch. It includes KiCAD files and LTSpice simulation files.
How the circuit works
It is basically 2 parts: the switch and the ideal diode. Both use P-Channel MOSFET

Switch circuit consists of M5, M4, R10, and R11. M5 is the main P-channel MOSFET which power is passed through, R10 keeps M5 gate high which turns it off.
M6 is a small N-channel MOSFET, low power and small footprint, which when activated, pulls M5 gate to ground to turn M5 on. By default, M6 is off by the effect of pulldown resistor R11 unless “activation” signal arrives at its gate.
Thus, when activation signal is on or high, M5 is on and power is switched on. That is how simple it is.
Ideal MOSFET is what matters more, it consists with the rest of the components excluding R5 which is just a load.
Q3 and Q4 is actually just one component, in this case part number is BCM856BS which is a matched pair of PNP transistors. Matched is the key feature here and is a must for this circuit. Those two matched transistors act like a comparison circuit between output and input voltages, which are the voltages at M5’s source and drain respectively.
Operation is simple: assuming Vin = 5v and Vout = 0 because there is nothing wrong on the output, just a load. Here Vb of Q3 is going to be 5v – 0.7v = 4.3v which is the same as Q4 since they are hooked together, but Ve of Q4 is 0v which results in it being off.
Q3 is on because its base voltage is 0.7v less than its emitter voltage, while Q4 is off because its base voltage is a lot higher than its emitter voltage. The reverse bias case is the exact same principle but with Q4 being active.
When Q3 is on, M4 gate is pulled to ground and thus M4 is fully on. While if Q4 is on, M4 gate is pulled high which turns it off. That is the entire trick to this circuit.
Reverse current protection
By the action of the ideal diode, we achieved reverse current protection which means no current can be back fed from output to input simply because there is a physical disconnection in the power path.
This is a robust protection method which is also cheap to implement in any device and I highly recommend it. There are ready-to-use ICs which does this but I feel like discrete solution like this is simple and effective as well as much cheaper.
PCB layout
Nothing special is required besides basic layout principles of keeping everything tight and prevent long signal travel paths.

However, a good designer must layout the board to have good thermal properties. Here, connect the power MOSFETs using polygon pours and use thermal vias when necessary. Also, put solid ground plain under everything with many stitching vias.

