Yes.Thanks All
only the switch is far away about 20 M from the counter but the resistor and the debounce circuit will be closed to the counter .
So still need a driver ?
The 4017 clock input advanced the count on the positive-going edge. If you want to use a grounded switch as shown, tie the clock input to Vdd and drive the Enable input with a negative-going edge. The 4017 internal schematic shows that this will work.
What is the power supply voltage?
5 V
ak
could u suggest a driver to use ?Yes.
Assuming that you want to put a passive switch 20m away, I would use a 220Ω resistor as my driver.could u suggest a driver to use ?
R5 can be deleted because R6 and R7 limit any external currents.Do u mean as seen in circuit below ?
Here's the simplest circuit I could come up with.
It uses the inhibit input for the MCU clock and a large RC filter on the PB line to debounce the switch and suppress noise pickup.
The simple RC debounce will work since the CD4017's clock input is insensitive to clock rise and fall time as shown below.
The one possible disadvantage of this simple circuit is that it triggers on the release of the push-button, not when it's pressed.
View attachment 129300
View attachment 129301
R5 can be deleted because R6 and R7 limit any external currents.
Your debounce period is less than 1 ms. Increase C4 to 10 uF for more effective debouncing.
When both inputs are off pin 14 will float, a CMOS no-no. Add a 10K pull down resistor from pin 14 to GND.
ak
And add a small resistor (e.g. 100Ω) in series with the switch so the large current spike from discharging the capacitor doesn't weld the contacts.Yes.
You may have to increase C4 to about 10 to 22μF.