There are a lot of schematics online for high side switch latching using a p-channel mosfet or PNP transistor, (I) couldn't find any for low-side so I tried to design my own:
simulate this circuit – Schematic created using CircuitLab
I want to when output of op amp goes high mosfet stay "on" even when the op amp output goes low until SW3 is pressed. the circuit kinda/sorta works in a crude simulator but there are two problems:
First; When op amp output goes low from high, mosfet gate voltage reduces to ~2.5V even if I disconnect Q1 emitter from Q2 collector and connect 12V supply to Q2 collector. obviously because the base is at 2.5V...
Second; I want to use a normally open push button instead of normally closed.
Note: I know adding a diode from op amp output to the non-inverting input of op amp can keep the output of op amp latched but that will disturb/change the voltage at non-inverting input which is not desirable.
How can I solve the described problems? is there a better approach to do this?