logic circuit to control a DC motor

Discussion in 'Digital Circuit Design' started by J7NF, Mar 12, 2016.

  1. J7NF

    Thread Starter New Member

    Mar 12, 2016
    18
    0
    I need to use 2 push button switches to control a dc motor, such as when I press sw1 then sw2 the motor will be on. If I press again sw1, the motor will be off and if it is followed by a press to sw 2 the motor will start again. Any help in this issue ???
    Especially what are the logic gates used in this circuit and how they are connected to the 2 switches and the motor ?
     
  2. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,388
    497
    Truth table, where?
     
    Marcus2012 likes this.
  3. Marcus2012

    Member

    Feb 22, 2015
    349
    26
    I'm assuming these are momentary switches? You could use a 556 timer with each switch representing the trigger and reset of each individual 555 in bistable configuration. Using these with a XNOR gate you'd get the correct truth table you'd need

    XNOR.png

    The problem then would be keeping the motor inactive initially. You could use a DPST momentary on the primary switch to deactivate a pull up circuit for one of the XNOR inputs. However this element would have to have no impact on consecutive pushes or at least a complementary switching pattern.
     
    Last edited: Mar 12, 2016
  4. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,388
    497
    I think I was wrong. They need state diagram more than truth table. The description goes:
    State 1: 11 (but they are not pushed together, so some kind of latching is needed) ( motor on)
    State 2: 01 (switch 1 unlatched) (motor off)
    State 3: 00 (motor on)

    Is it ok for me to say that I want to be a simpleton and I just want to use a uC?
     
    J7NF and Marcus2012 like this.
  5. Marcus2012

    Member

    Feb 22, 2015
    349
    26
    :) Yeah a uC could be used to good effect here. Of course I would have no idea how to do that lol :) Suppose it just depends on the OPs skill level there and if there are any other circuit considerations. Are these literally the only two buttons on the device?
     
    J7NF likes this.
  6. J7NF

    Thread Starter New Member

    Mar 12, 2016
    18
    0

    this is the correct state table that you have mentioned, but I couldn't applied it correctly to the circuit. I have used NAND gates to form SR latches. This is ok with sate 2 and 3 but the problem is in state 1, that the motor will start directly if you push button 2 only and in my case I need to push Sw 1 then Sw 2 to operate the motor
     
  7. J7NF

    Thread Starter New Member

    Mar 12, 2016
    18
    0
     
  8. J7NF

    Thread Starter New Member

    Mar 12, 2016
    18
    0
    yes, they are the only 2 buttons used in the circuit
    Circuit.PNG
     
  9. absf

    Senior Member

    Dec 29, 2010
    1,492
    372
    Perhaps the attached circuit is what you want. The 74LS74 uses 5V while the motor is using 10V.

    If you want to use the same voltage < 15V for both logic and motor and the inputs are active High, you may use 4013 instead.

    J7NF.PNG
    allen
     
    J7NF likes this.
  10. J7NF

    Thread Starter New Member

    Mar 12, 2016
    18
    0
    Ok thank you, I will try this
     
  11. J7NF

    Thread Starter New Member

    Mar 12, 2016
    18
    0
    I have tried this configuration using 7474 and it has worked, but still I have the problem at state 1 where if I press SW 2 directly the motor will be on and in my project it is required to press sw 1 then sw2 to operate the motor, so the motor should not operate directly when press sw 2.
    Any help regarding this issue ??
    and what about using 7476 the JK flip-flop instead of the 7474
     
  12. Marcus2012

    Member

    Feb 22, 2015
    349
    26
    I'm still testing it but I think this would do the trick. Uses a 7473 negative edge JK.

    motor control 1.png

    The resistor value are just arbitrary at the moment and would depends on the supply voltage/current for the motor

    FYI I bridged the 5V and 9V rails here unintentionally I've fixed it in my next diagram
     
    Last edited: Mar 13, 2016
    absf likes this.
  13. absf

    Senior Member

    Dec 29, 2010
    1,492
    372
    In this circuit, while the motor is running and you press SW2 again it would stop. Pressing SW2 again it would start the motor again.

    But if you remove the wire between ~Q to J of !C1b, then it should work as what the TS requested.

    Allen

    P/S: does it work if the motor is connected to the emitter of the transistor?
     
    Marcus2012 likes this.
  14. Marcus2012

    Member

    Feb 22, 2015
    349
    26
    The jumper is only there to match potential between J and ~Q it doesn't make difference if it's removed. You are right though in the fact that a second press of SW2 will deactivate the motor but a third press will not reactivate it unless SW1 is pressed again first. I'll keep think about how to adjust that. The motor is connected to the emitter.
     
  15. J7NF

    Thread Starter New Member

    Mar 12, 2016
    18
    0
    Thank you for your efforts, also I am thinking in using two 7474 D-flip flop as SR, by connecting D and clk in each one to the ground. Any idea how to connect the two 7474 to each other and to the circuit, to obtain the required states mentioned before.
     
  16. Marcus2012

    Member

    Feb 22, 2015
    349
    26
    Now this version will come on when you press SW1 then SW2 and will only deactivate on another press of SW1 BUT will only reactivate when SW2 is then pressed so on etc... That was what you wanted correct?

    EDIT Problems resolved see below
     
    Last edited: Mar 13, 2016
  17. Marcus2012

    Member

    Feb 22, 2015
    349
    26
    Here you go I figured it out in the end, probably worth checking of course :). Just required some feedback from the second JK and a different initial state. This will now follow your required state diagram. Bear in mind this uses momentary (push to make) and not latching switches and you still need to determine your resistor values for the pull ups and base resistor and what NPN would be appropriate. Not sure what voltage (or current draw) your motor is but these TTL ICs need a 5 volt regulated supply so if your supply is higher than that for you motor you can just put a 7805 regulator in for the logic. You might also want to consider a general power switch further upstream in the circuit just so the power to the logic etc. isn't always on, unless you want it to be of course :).

    motor control 1.png
     
    Last edited: Mar 13, 2016
  18. J7NF

    Thread Starter New Member

    Mar 12, 2016
    18
    0
    Thanks, this what I want. I will try the configuration that you have provided and see if it works
     
  19. J7NF

    Thread Starter New Member

    Mar 12, 2016
    18
    0
    If I am using the 7476 Jk any idea where to connect the PR of each one, and I connected the C the same as the 7473's
     
  20. J7NF

    Thread Starter New Member

    Mar 12, 2016
    18
    0
    If I am using the 7476 Jk any idea where to connect the PR of each one, and I connected the C the same as the 7473's
     
Loading...