Electronic – Make a momentary switch control a toggle

digital-logicflipflopswitches

What are the simplest, cheapest, smallest ways to make a momentary switch produce a 2-state toggling output (latching momentary switch)?

In other words, the output is continuously low, and when you momentarily press the button/tact switch, the output changes to continuously high, and then when you press it again, it switches back to low.

Best Answer

Here's another alternative with two inverters and debouncing:

Two inverters

For logic output, only the two inverters, RC, and feedback resistor are needed:

enter image description here

NC7WZ14 is $0.06 with 2 inverters, small 6-pin package, and Schmitt trigger inputs, though I think this circuit doesn't even need Schmitt inputs because of the RC. Also it can drive 24 mA, so you could connect the LED directly to it if you're using an LED for whatever reason.

Also shown here and here as a toggle touch switch.

I think the feedback resistor has to be much smaller than the center resistor to prevent it from oscillating if you hold down the button, because the low-impedance connection to the output will prevent the capacitor from charging to the middle voltage until you let go.

Variants are described at Press ON - Press OFF soft latching circuits:

AND gate variant