Flip ON flop OFF

Texas Instruments CD4013B

Toggle, slide, push-pull, push-push, tactile, rotary, etc. The list of available switch styles goes on and on (and off?). Naturally, as mechanical complexity goes up, so (generally) does price. Hence simpler generally translates to cheaper. Figure 1 goes for economy by adding a D-type flip-flop and a few discretes to a minimal SPST momentary pushbutton to implement a classic push-on, push-off switch.

F1a regeneratively debounces S1 so F1b can flip ON and flop OFF reliably.
Figure 1. F1a regeneratively debounces S1 so F1b can flip ON and flop OFF reliably.

An (almost) universal truth about mechanical switches, unless they’re the (rare) mercury-wetted type, is contact bounce. When actuated, instead of just one circuit closure, you can expect several, usually separated by a millisecond or two. This is the reason for the RC network and other curious connections surrounding the F1a flip/flop.

When S1 is pushed and the circuit closed, a 10 ms charging cycle of C1 begins and continues until the 0/1 switching threshold of pin 4 is reached. When that happens, poor F1a is simultaneously set to 1 and reset to 0. This contradictory combination is a situation no “bistable” logic element should ever (theoretically) have to tolerate. So, does it self-destruct like standard sci-fi plots always paradoxically predict?

Actually, the 4013-datasheet truth table tells us that nothing so dramatic (and unproductive) is to be expected. According to that, when connected this way, F1a simply acts as a non-inverting buffer with pin 2 following the state of pin 4, snapping high when pin 4 rises above its threshold, and popping low when it descends below. Positive feedback through C1 sharpens the transition while ensuring that F1a will ignore the inevitable S1 bounce. Meanwhile the resulting clean transition delivered to F1b’s pin 11 clock pin causes it to reliably toggle, flipping ON if it was OFF and flopping OFF if it was ON where it remains until S1 is next released and then pushed again.

Thus, the promised push-ON/push-OFF functionality is delivered!

The impedance of F1b’s pin 13 is supply-voltage dependent, ranging from 500 Ω at 5 V to 200 Ω at 15 V. If the current demand of the connected load is low enough, then power can be taken directly from F1b pin 13 and the Q1 MOSFET is unnecessary. Otherwise, it is, and a suitably capable transistor should be chosen. For example, the DMP3099L shown has an RON less than 0.1 Ω and can pass 3 A.

But what about that “no switch at all” thing?

The 4013 input current is typically only 10 pA. Therefore, as illustrated in Figure 2, a simple DC touchplate comprising a small circuit board meander can provide adequate drive and allow S1 to be dispensed with altogether. It’s hard to get much cheaper than that.

An increase in RC network resistances allows substitution for S1 with a simple touchplate.
Figure 2. An increase in RC network resistances allows substitution for S1 with a simple touchplate.

Materials on the topic

  1. Datasheet Texas Instruments CD4013B
  2. Datasheet Diodes DMP3099L

EDN