Actually, I am fairly sure - but not certain - it will work, and I am a little less sure it will work well enough. I have included a link to a schematic of the design below. "Switch 1" is actually a GPIO output pin from an Arduino, and R5 is actually A Raspberry Pi. The intent is to have the Arduino shut down the RPi when a certain variable is true and turn it back on when the variable is false. The default will be for the RPi to be on until the Arduino's GPIO pin goes high, producing a 3.3V signal at R4, which energizes the X5 Optocoupler's LED and turns off the X4 MOSFET. I have run it in my simulator, and it works there, but there are a couple of catches. The problem is , I am using Micro-Cap 12.2, and it does not have exact matches for all of my components.
>
> In particular, Optocoupler X5 does not have a BJT output. I have a ton of H11F1 Optocouplers (read that: free) which I need to use, and they have symmetrical bilateral silicon photo-detectors as their outputs. Micro-Cap does not have an exact match for this, but I think the FET output Coupler will work just fine to switch the P-Channel X4 MOSFET. If anyone knows of any reason why an H11F1 Optocoupler will not work here, please let me know.
>
> A bit more worrisome is the PC-Channel MOSFET. Micro-Cap does not have an exact match for the PMV28XPEAR MOSFET I need to use. Again, I think it will work, but I am not certain. I tried several different MOSFETs in the simulator, and some perform quite well, with less than 0.1V drop, but others have as much as 0.25V drop in the same situation, which is a bit too much. The PMV28XPEAR has a quite low Rds of around 40 milliohms, but I am not at all sure a somewhat higher Rds is why some of the others I used in the sim are failing. Increasing the value of R5 in the sim did not increase the output voltage. Is anyone out there familiar with the PMV28XPEAR, or know of a very low cost MOSFET that would be guaranteed to work? My cost for the PMV28XPEAR is $0.076 each.
>
>formatting link
Do you actually need the opto-isolation? The switch would drive an NPN transistor into saturation when it closed, or a small N-MOSfet. You'd need a pull-up resistor to +5V to get the voltage swing you want, but it's much the same circuit with less to go wrong.