microswitch

Discussion in 'General Electronics Chat' started by kuxz2008, Jan 6, 2010.

  1. kuxz2008

    Thread Starter Member

    Nov 16, 2009
    84
    0
    i would like to know how to connect 2 microswitch to the input J and K for a JK flip flop .
     
  2. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    Wire usually works best. String or tape will make the connection but won't work well.:)

    Seriously, it all depends upon what you want the switch to do to the J-K. Is the J-K being used to debounce the switch? Should the switch SET or RESET the J-K? Should the switch ........(any number of other questions) In other words, what is the end result you want?
     
  3. kuxz2008

    Thread Starter Member

    Nov 16, 2009
    84
    0
    for eg. When the microswitch is activated, it will sent a 1 to j input of the jk flip flop. Same 4 the k input of jk flip flop. My concern is that do i need to used the 5volt n ground from the jk flip flop 4 the microswitch n how do i connect it?
     
  4. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    If you use the Normally Closed contact tied to the J or K input, place a pull-up resistor to the inputs of the J-K and the other side of the switch to ground. Pushing the switch will cause the J or K input to go high. Otherwise, if you use the Normally Open side of the switch, place a pull-down resistor to the J and K inputs of the J-K and tie the other end of the switch to the +5 volts. How are you going to clock the J-K?
     
  5. kuxz2008

    Thread Starter Member

    Nov 16, 2009
    84
    0
    is it possible for you to draw out the schematic diagram for me to understand better ....
     
  6. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    Before I attempt a schematic, I need to know what you are trying to accomplish. Also, what means are you planning to use for the CLOCK input to the JK?
     
  7. kuxz2008

    Thread Starter Member

    Nov 16, 2009
    84
    0
    i am trying to build a tamiya car type that when the front microswitch which is connected to j input of jk ff and the back microswitch connected to k input of jk ff. When the front microswitch is activated, it wil produce a 1 at output q. The output q will be connected to a relay.same for the back microswitch.i have not think of what to connect to thd clock input. But my goal is only to activate the relay whem the microswitch is activated.
     
  8. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    Have you looked at a datasheet for a JK flip-flop? You should understand what they do and how they work before trying to implement one into a functional circuit. Now, to your project. Simply activating the J or K input of the JK flip flop does absolutely nothing until a pulse is applied to the clock input.
    You say you want to pick up a relay and have it stay up when the front microswitch is activated. I assume you want to pick up a second realy and have it stay up if the rear micorswitch is activated and drop out the front relay. If the front microswitch is activated again, the front relay would pick up and the rear relay would drop out. Is all of that correct? If so, there is no need for a JK as all can be accomplished with the switches and relays alone.
    What relays are you going to use?
     
  9. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    Here is a circuit I worked up that uses only relays. What do you want the relays to do after they are activated?
     
    • AAC.png
      AAC.png
      File size:
      9.9 KB
      Views:
      30
  10. kuxz2008

    Thread Starter Member

    Nov 16, 2009
    84
    0
    my goal here is to allow the motor to change direction when either of the microswitch is activated.

    i have thought of just connecting directly from the microswitch to the relay.
    however, when the microswitch in the first place is activated, it will then activate the relay to allow a change in direction(eg. backward).
    however, when the microswitch is deactivated, the relay will be off. causing the change in direction(move forward)but is it suppose to be moving backward even when the microswitch is deactivated.
    this is the reason why i am trying to use a JK ff.

    i have attached the diagram that i have thought off. i still could not figure out what to connect to the clock input. and should i connect the source voltage and ground for the microswitch to the one that i used for the JK ff?


    the relay that i use is in the link below:
    http://tinyurl.com/ykk3vc3
     
  11. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    This thread is on the same subject. Check it out. ttp://forum.allaboutcircuits.com/showthread.php?t=30232&highlight=reverse
     
  12. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    As shown in your diagram, the circuit MUST HAVE A CLOCK PULSE before the outputs can change. If you use Pin 4 and Pin 15 (DIRECT SET / DIRECT RESET) you have a shot at it. Again, I would solidly recommend that you go online and get a datasheet for a JK flipflop. That is a great way to learn. You will see that in order for the J or K inputs to work, they must be clocked. Most data sheets (especially older ones) will give example circuits.
     
  13. kuxz2008

    Thread Starter Member

    Nov 16, 2009
    84
    0
    do you have any suggestion or recommendation of what to connect to the clock input? What do you mean by connecting pin 4 and 15, you have a shot at it?

    If i were to change the connection for the 2 microswitch from the jk input to preset and clear, then how do i connect the voltage n ground for the microswitch? Do i need to connect to the jk ff voltage and ground?
     
  14. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
  15. kuxz2008

    Thread Starter Member

    Nov 16, 2009
    84
    0
    then how do i connect the 2 microswitch to the preset n clear to the jk ff?
    Can you draw the digram out? I am more interested in how to conect the voltage n ground.
     
  16. BillB3857

    Senior Member

    Feb 28, 2009
    2,400
    348
    +5 volts ties to the power pin and 0 volts ties to the ground pin. Get a data sheet and it will show. Unless you get a data sheet, I will no longer respond to this thread.
     
  17. kuxz2008

    Thread Starter Member

    Nov 16, 2009
    84
    0

    i have read through the jk ff datssheet and i have an idea for the clock input. I am thinking of conneting the output of a one shot timer to the jk clock input. The one shot timer will trigger by the mcroswitch . The 2 microswitch will still be connected to the jk ff.
    Whenever the microswitch is activated, a pulse will be at the jk clock input. Will this work?
     
  18. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    A latching relay for reversing may be easier.
     
    Last edited: Jan 17, 2010
  19. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    It doesn't get much easier than this:

    [​IMG]

    Just a beam running through the car attached to both bumpers.
    There's a hole in the beam; the handle of a DPDT switch goes through the hole; the body of the switch is mounted fixed to the car body.

    When the front bumper strikes something, the bumper beam flips the switch to the other direction, reversing the polarity of the motor.

    No gates, flip-flops, relays, or anything else is needed.
     
  20. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    I think that's the final word on a low component count solution.
    --- Well Done Wookie
     
Loading...