I'm working on the realization of overcurrent detection that will be powered by a battery supply. I successfully simulated a comparator with an operational amplifier that will set the output high when there is overcurrent and the flip-flop circuit has to carry that value (until the reset button is pressed) and send it to the buffer that will set the MOSFET transistor on/off. I'm trying to figure out what is the best way to implement the flip-flop logic that sends the information to the buffer. Below is the schematic of my project. Thank you very much for your ideas.

enter image description here

  • \$\begingroup\$ Two transistor latch (bistable circuit), two NANDs, 4043 or 4044 ic (according logic), some folks even use 555. There is also possible use D flops like 4013 or 7474. \$\endgroup\$ Nov 26, 2023 at 9:27
  • \$\begingroup\$ Regarding two NANDs: if possitive logic is needed (set and reset with logic High) two NORs is better option. Also two schmitt triggers will do the job. \$\endgroup\$ Nov 26, 2023 at 9:38

1 Answer 1


The function you want is called "set/reset latch".

There are some old chips that integrate multiple latches (CD4043/CD4044, 74xx279), but the simplest solution is to build a latch with two NAND or NOR gates ((SN)74xx2G00, (SN)74xx2G02):

S/R NAND latch
(source: Wikipedia)

To ensure that it is in the correct state after power up, you need a reset signal during power up.

  • \$\begingroup\$ I have created the schematic for the latch, but how do I convert the overvoltage value which is over 12V from the output of my comparator as "HIGH" value to the NOR gate? Below are pictures of the schematic and simulation. Schematic: imgur.com/tJRvY96 Simulation: imgur.com/FeuFFjW \$\endgroup\$
    – Simplifier
    Nov 26, 2023 at 19:01
  • \$\begingroup\$ Just adjust the pull-up resistor at the comparator's output. Which you forgot. (How an open-collector output works and how to do level shifting with it is a different question.) \$\endgroup\$
    – CL.
    Nov 26, 2023 at 19:06
  • \$\begingroup\$ I adjusted the pull-up resistor but the latch circuit still does not work. Is the value of the resistor wrong? imgur.com/lAJEUC9 \$\endgroup\$
    – Simplifier
    Nov 26, 2023 at 19:31
  • \$\begingroup\$ This is not a pull-up resistor. Look up how open-collector outputs work, and if needed, ask a new question. \$\endgroup\$
    – CL.
    Nov 27, 2023 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.