Powered by Blogger.

Saturday, 2 August 2014

Push Button Switch that Turn On a Motor in One Push and Turn Off in Next Push

by realfinetime  |  in Motor Driver at  11:46

            We have already seen A Funny J K Flip-Flop Trick, Push Button Switch that Turn On the Circuit in One Press and Turn off the Circuit in Next Push. Here we will design a circuit with a push button switch which will turn on a motor in one push and turn off the motor in next push.

Circuit is done as shown in the following diagram.
Components needed in the circuit

5V Voltage source  - Normally supplied from a 5V Voltage Regulator.
Pull up Resistors 1K  - 4
Push Button Switch   - 1
7473 J K Flip-Flop IC - 1
L293D Motor Driver   - 1
5V DC Motor    - 1

          Complete the circuit as given above. Motor will rotate, when 5V is given to the circuit. Now press the push button switch. Motor will turn off. Again press the switch. This will turn on the motor again. Motor will turn on and turn off alternatively, in each alternative pushes of push button switch.

Pinout diagram of 7473

          Pinout diagram of 7473 is given below. Each 7473 has two master-slave J K flip-flips. Half portion of IC, above VCC and ground constitutes the first flip-flop and the half portion below VCC and Ground constitutes the second master-slave flip-flop. First flip-flop is used for this circuit.

Truth Table of 7473

From the truth table, we can conclude that:

1. When CLR is LOW, Q will be LOW and Qbar will be HIGH. These outputs will not change, even if the other inputs ( J, K and CLK)  change, until CLR is set to HIGH.
2. When CLR becomes HIGH, if J is LOW and K is HIGH, Q becomes LOW and Qbar becomes HIGH during the next negative transition.
3. When CLR becomes HIGH, if J is HIGH and K is LOW, Q becomes HIGH and Qbar becomes LOW during the next negative transition.
4. When CLR becomes HIGH, if J and K are HIGH, Q and Qbar will toggle in each negative transitions.
5. When CLR becomes HIGH, if J and K are LOW, Q and Qbar will remain in the previous state and is independant of the state of CLK input.

Why pull up resistors ?.

          5V is given to J, K, CLK and CLR through pull up resistors. Pull up resistors helps to pull the inputs ( J, K, CLK and CLR )  to a HIGH value always. When the push button switch turns on, CLK input get grounded through the push button switch. Then, CLK will get LOW voltage.

          If the same circuit is done without connecting the pull up resistors of proper resistance, when the swith turns on, power supply get shorted through the switch. High current will flow through the switch due to low resistance of the path. This may damage the power supply and gate operation will not take place.

Why push button switch ?.

          Push button switch is connected in between the CLK and ground as shown in the circuit. Push button switch is most suitable for this purpose, because by default it will be in off state. A switch in off state means, CLK gets a HIGH voltage. When the switch is pressed, CLK get grounded and will get a LOW voltage. When press is released, switch will automatically turn off and CLK will get HIGH voltage. 

Pinout Diagram of L293D

          L293D is a popular motor driver. It is special by its high current and voltage rating. Each L293D can be used to control two motors. First motor is connected across 1Y and 2Y. Second motor is connected across 3Y and 4Y. 1A and 2A are the control pins for first motor. Similarly 3A and 4A are the control pins for second motor. Here, the circuit is demonstrated to control Motor ( M1 ) connected across 1A and 2A. 

Truth Table of L293D

          Direction of rotation as per the control signals is represented in the following table. Motor will rotate, if there is a voltage difference between 1A and 2A pins ( 1A=1, 2A=0 ). Motor will change the direction of rotation, if voltage difference is reversed ( 1A=0, 2A=1 )Motor will not rotate, if there is no voltage difference between 1A and 2A ( 1A=1, 2A=1 or 1A=0, 2A=0 ).

Working of Circuit

          Row encircled by a red line in the truth table of 7473 is used for this circuit. When CLR, J and K becomes HIGH, output will toggle in each negative transitions of the CLK input. Negative transition will occur when the push button switch is pressed. If the switch is pressed, CLK get grounded. Then a transition of CLK input from HIGH to LOW will occur. At this moment, if the output ( Q1 ) is HIGH, it will become LOW. Similarly, if the output ( Q1 ) is LOW, it will become HIGH. If the switch is released, CLK input will change from LOW to HIGH voltage. No change will happen to the output during the positive transition of CLK input.

          In this circuit 2A pin of L293D ( Pin 7 ) is connected to ground. From the truth table of L293D, we know that, motor will rotate, if there is a voltage difference between 1A and 2A pins. Since 2A pin is LOW always, a HIGH at 1A will  rotate the motor and LOW at 1A will stop the motor. That is, when Q1 becomes HIGH, motor will rotate and when Q1 becomes LOW, motor will stop rotation. During toggling of master-slave J K flip flop, Q1 becomes HIGH and LOW in each alternatives pushes of push button switch.

More options:
     If you want to change the direction of rotation of motor, interchange the pins of motor connected to 1A and 2A of L293D.
     In this circuit, motor will rotate when 5V is supplied to circuit ( when circuit starts working ). If you don't want to rotate motor when 5V is given to circuit, two methods are there.
1. Connect Q1bar pin of 7473 to the 1A pin of L293D. Q1 is connected to 1A pin in this circuit.
2. Connect 2A pin of L293D to 5V. 2A pin is connected to ground in this circuit.


  1. This comment has been removed by the author.

  2. how do I alter this circuit to control two motors?

  3. What needs do with other pins

  4. What I need do with other pins when I use only one half?

  5. Your blog is really impressive, you included much knowledge for us. It genuinely had good content. Thanks for sharing this.test and tag Perth



All the circuits, published in this blog is only after testing and getting proper results in my private lab. When you try these circuits, you should check the supply voltage, polarity of components, presence of childrens nearby and shorts in the circuits. This website will not be responsible for any harm happened to you or your components caused by your carelessness.

For More Electronic Tips

Blog Archive

Proudly Powered by Blogger.