| Electronics > Projects, Designs, and Technical Stuff |
| How to make a tactile switch act as a pushbutton switch + state reset |
| (1/1) |
| Skleb:
Hi all, I am still a newbie here. I've been experimenting and trying to make a circuit which has four tactile switches which are used to turn on and off leds. I am using J-K flip-flop for saving a tactile button state. Circuit should work as follow: when user clicks button 1 LED1 should light up. When user clicks button 2, LED 2 should light up but LED 1 should immediately go off. To conclude, only one LED should be lit. I am having a problem with this "reset" feature. I can reset output by pressing a same button once again but then it acts like a push-button switch which I would like to avoid. I attached a schematic with my circuit. Any help is kindly appreciated. Regards |
| David Hess:
If you do not want a single push-button toggling its LED, then use the set and clear inputs instead of the clock input. I would probably do it using 7474 type dual D flip-flops and driving the clear inputs through a diode array so 3 diodes per flip-flop. Someone here likely knows a better way other than just programming a microcontroller. |
| bsfeechannel:
Observing how ganged push-button switches work, when you press a button, it resets all the other switches and then latches. So let's try to mimic this behavior electronically. When you press a button, it will send a rising edge pulse to all the FFs. J and K' will be 0 for the buttons that are not pressed forcing their respective FFs to reset, at the same time J and K' will be 1 for the pressed button. As with mechanical switches, if you press the same button again it'll remain "pressed". Nothing will happen. Likewise if you press two or more buttons at the same time they have a chance to get simultaneously latched. Pressing one of them again will release the others. I haven't built nor simulated this circuit so I don't know if things like timing will affect its operation. It's just an idea. Good luck. |
| Navigation |
| Message Index |