# Single-IC-based circuit replaces mechanical switch

#### Article By : Santosh Bhandarkar

Here's a circuit that replaces a more costly and bulky push-push mechanical switch.

A simple and inexpensive electronic circuit uses a low-cost pushbutton switch to toggle the electrical power on and off. The circuit replaces a more costly and bulky push-push mechanical switch. The pushbutton switch triggers a monoshot circuit. The monoshot circuit's output triggers a toggle flip-flop, which inverts its output state and controls power to the load.

*Figure 1: A pair of flip-flops configured as a monoshot and a toggle flip-flop debounce a simple, inexpensive pushbutton switch.*

Several implementations of the scheme are possible. Figure 1 shows a single-IC implementation. The circuit uses two flip-flops, IC1 and IC2, in the same IC, CD4027B. You configure IC1 as a monoshot circuit by feeding its output back to its reset pin through an RC network. IC1 outputs a high on the rising edge of the clock by tying its J input high and its K input low. The pushbutton switch connects between the clock input of IC1 and ground. The switch can also connect between the clock input and the positive supply, VDD. By tying IC2's J and K inputs high, IC2 becomes a toggle flip-flop. The output of IC1 clocks IC2 and toggles its output on the rising edge of the IC1 output.

*Figure 2: Trace 1 is the voltage across the clock of IC1, Trace 2 is the output of IC1, Trace 3 is the voltage on capacitor C1, and Trace 4 is the output of IC2.*

You can understand the operation of the circuit by observing the waveform at different points of the circuit (figure 2). When you press the pushbutton switch, due to debouncing, IC1's output goes high on the clock's rising edge. Capacitor C1 starts charging through R1 towards high voltage. At the same instant, IC2 receives a rising-edge transition at its clock and toggles its output. When capacitor C1's voltage exceeds the threshold of the IC1 reset pin, IC1 resets, and its output goes low. C1 now discharges through R1 to low voltage. The charging and discharging rate of C1 are equal. The duration of the monoshot circuit's output pulse handles the switch-press time and the debouncing period. Varying the value of R1 varies the pulse period, and you can set R1 for different types of pushbutton switches. Complementary outputs of IC2 are available, and you can use them to drive power switches, such as transistors, MOSFETs, relays, and shutdown pins of switching regulators. The circuit operates over a supply voltage of 3 to 15V and can control power to analogue and digital circuits.