The screenshots are from the clock circuit on the left. This is switch C, with the clock pin helt high, and pulse low:Ĭlick on images for better resolution. In the video we are using the circuit on the right. This is the clock circuit: Clock pin held low - pulse high That makes the whole counting start at Q0.įurther details of the circuit will not be explained.įirst we will try with no bounce control at all. When the counting reaches Q8 (PIN 9), it clocks PIN 15, which is the reset pin. The IC receives a clock signal on PIN 14 and then lights the LED on Q1. When the next clock signal is received, the IC turns off Q1 and lights Q2, and so on. You can find a datasheet for the 4017-types IC here. However, there are many other manufacturers that still make this little IC, and they are often pin compatible. They do not produce this IC anymore, so this actual type is obsolete. This is a decade counter/divider made by STMicroelectronics. The basic of our circuit will be the HCF4017BE. First we will see how the switches behave in their raw form. I have 2 micro switches, 1 push button, and 1 toggle switch:Īll the switches will be connected the same way (this is essential if we are going to compare the results). I will show you how 4 different switches bounce. If you compare two of the same switches, there is a great chance that they will bounce differently. The following screenshots illustrates a typical switch bounce, without any sort of bounce control:Įach switch has its own characteristics regarding the bounce.
![software lag switch pulse on pulse off software lag switch pulse on pulse off](https://denkovi.com/Software/DRM/DAEnetIP3-DAQ-Module/screen1.jpg)
![software lag switch pulse on pulse off software lag switch pulse on pulse off](https://image5.slideserve.com/10668177/meba-time-relay-dh48s-2z-dh48s-time-relay-l.jpg)
The hardware is often an integrated circuit. "When the switch is closed, the two contacts actually separate and reconnect, typically 10 to 100 times over a periode of about 1ms." ("The Art of electronics", Horowitz & Hill, Second edition, pg 506.) Usually, the hardware works faster than the bouncing, which results in that the hardware thinks you are pressing the switch several times. The switch is bouncing between in-contact, and not in-contact. Then it makes contact a little longer, and then again a little longer. When you push the switch, it initially makes contact with the other metal part, but just in a brief split of a microsecond. Inside the switch there are moving parts. For the user, it might seem that the contact is made instantly. What is switch bounce? When you push a button, press a mico switch or flip a toggleswitch, two metal parts come together.
![software lag switch pulse on pulse off software lag switch pulse on pulse off](https://venturebeat.com/wp-content/uploads/2018/06/img_20180601_110244.jpg)
First I will take you through the theory, and later I will show you some ways to handle it in both hardware and in software. In this article I will discuss what switch bounce is and some ways to deal with it.