Hi,
I have a few question about the added photo of this switch circuit. In general when turned on, Vin passes through the P-mos transistor to Vout, and when off all transistors are closed. ON/OFF is connected to one of arduino's GPIO pins.
General explanation of what happens during sw on and sw off in the yellow marked part.
During off state the Nmos's gate should be pulled low - how does it happen? and are the resistor and cap marked green related to that?
The diode marked in rainbow is for protection against reverse polarity of the load(connected to the header)?
Also, I would appreciate for some recommendations of a circuit simulator software(web/desktop) which is free and simple to use for such similar cases.
Thanks
If you want a soft toggle switch or push-button latching power-on a flexible approach is using CMOS
logic chips permanently powered driving the switching device. Typically a flip-flop of some
sort would be used, set-reset or DQ typically (DQ can toggle if Qbar is fed back to D).
With a flip-flop output driving a switching device you can build a wide variety of types of switch,
with one or more push buttons, software control, auto-toggling, and time-outs (RC plus Schmidt-trigger
gate). CMOS logic can be very low power (only the pull-up and pull-down resistors consume power!),
and 4000 series will run upto 15V supply too.
Another approach is a small microcontroller running on slow internal RC oscillator (very low power too),
which can be programmed however you like.
Any discrete design of switch needs at least two active devices, and amount to bistable flip-flop
circuits in effect anyway.