microswitch

BillB3857

Joined Feb 28, 2009
2,571
i would like to know how to connect 2 microswitch to the input J and K for a JK flip flop .
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?
 

Thread Starter

kuxz2008

Joined Nov 16, 2009
84
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?
 

BillB3857

Joined Feb 28, 2009
2,571
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?
 

Thread Starter

kuxz2008

Joined Nov 16, 2009
84
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?
is it possible for you to draw out the schematic diagram for me to understand better ....
 

BillB3857

Joined Feb 28, 2009
2,571
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?
 

Thread Starter

kuxz2008

Joined Nov 16, 2009
84
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.
 

BillB3857

Joined Feb 28, 2009
2,571
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?
 

Thread Starter

kuxz2008

Joined Nov 16, 2009
84
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
 

Attachments

BillB3857

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

BillB3857

Joined Feb 28, 2009
2,571
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.
 

Thread Starter

kuxz2008

Joined Nov 16, 2009
84
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?
 

Thread Starter

kuxz2008

Joined Nov 16, 2009
84
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.
 

BillB3857

Joined Feb 28, 2009
2,571
+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.
 

Thread Starter

kuxz2008

Joined Nov 16, 2009
84
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?

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?
 

SgtWookie

Joined Jul 17, 2007
22,230
It doesn't get much easier than this:



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.
 

Attachments

Top