A little help for the newb please

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
A couple of months back there was a post about using a momentary switch with a simple latching circuit to turn an LED on and off. I followed, or thought that I did, the instructions from another member who suggested a J-K flip flop. I have laid the project out on a breadboard, but the results are nil. I'm using an MC4027B chip to accommodate the 9v power source. I have tied J/K together and connected them to 9v with a 1k resistor. The LED cathode is connected to Q and the anode to 9v through a 270Ω resistor. Finally, the switch output lug is connected to the clock input.....and nothing. Can somebody tell me what I'm doing wrong? Should the input lug of my switch be from 9v? Any help, or even a schematic, would be greatly appreciated.
 
Here is a suitable schematic for you.

schematic2.jpg


I would make a few observations:

Ensure that you have an MC14027B. MC4027 is a different device altogether. MC14027B is what Motorola (ON Semi) call their equivalent to CD4027B.

If you don't already have one, download a datasheet for MC14027B. You can get one from www.farnell.com/datasheets/76389.pdf

It would be better to increase the value of the LED series resistor. CMOS output stages are generally not really suitable for delivering big milliamps.

You need a pull-down resistor on the clock input. Because CMOS inputs are very high impedance, the value of this pull-down is not critical - anything in the range 1k to 1M would be usable.

With the pull-down as shown, activating the switch will deliver the 0 to 1 transition that is required to toggle the flip-flop.

Setting J and K to 1 enables the flip-flop. Setting R and S to 0 ensures that the flip-flop is not forced into one state or the other.
 
Thanks to all who replied to my post/query. I just returned from out of town and got busy with this little project using the schematic shown above....it works!! But, I think that it will need to be debounced to make it more stable/reliable....any ideas? I'm thinking a Schmitt trigger?
 
Glad to hear that you’ve got things working.

The most likely source of problems with this simple implementation is multiple triggering of the flip flop, due to a bouncy switch.

If the switch doesn’t make cleanly, or it doesn’t break cleanly, or both, there will be multiple 0 to 1 to 0 transitions on the clock input instead of the nice simple single pulse we are looking for.

There are a great many strategies for debouncing switch contacts, but first consider something simple. Try connecting a 1µ capacitor in parallel with the 47k resistor. After the first switch closure has pulled the clock input up, the capacitor will hold the clock input up for a short interval, even if the switch contacts momentarily open (bounce). Thus the flip flop will be immune from being clocked again until the switch contacts have been open for a few milliseconds and the capacitor has discharged through the 47k. Hopefully this few milliseconds will exceed the duration of contact bounce.

Of course, there are many more complex debouncing strategies, most of them dependent on a monostable of some kind. I think for the time being you might want to avoid a debouncing circuit that is more complex than the flip flop you’re trying to implement.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.