Debounce" Explained; What Is Switch "Bounce; What Is "Debouncing; Example Of Switch Bounce - Honeywell CNI2 Operating And Installation Manual

Cellular network interface - 2 mercury instruments
Table of Contents

Advertisement

CNI2 Operating and Installation Guide

"DEBOUNCE" EXPLAINED

What is Switch "Bounce"?

If you strike a hard surface with a stick it is likely to bounce a few times before coming to rest.
The same is true for most mechanical switches. As the contacts come together they may
"bounce" (open and close a few times), then finally settle in the closed position. This "bouncing"
may be falsely interpreted as several events rather than just one. If the CNI2 is counting pulses
from this switch it might interpret the bounce as two or three pulses rather than just one.
Electronic switches such as transistors do not have this problem.

Example of Switch Bounce

What is "Debouncing"?

The process of "debouncing" requires the switch be in the same state over a specific number of
samples to be considered "valid". Therefore the DEBOUNCE CYCLES and SAMPLE RATE are
interrelated. If the input line changes states within this period of time the event is ignored and
the debouncing process starts over.
See the next illustration. Suppose an alarm input is sampled 10 times a second and the
debounce cycles are set for 4. This means that the input has to be in the same state for 4
consecutive samples (0.4 seconds) to be considered "valid". If it changes even once during
this time the entire process starts over. As seen in the illustration the first and second
transitions were ignored because they did not stay in that same state for 4 samples. However
the third transition was considered to be a "real" event.
Setting the DEBOUNCE CYCLES to 1 will result in the fastest recognition of a change in the
switch. As soon as it changes from one state to another it is considered "valid". But this may
also lead to inaccurate results if the switch bounces a lot. This setting is normally used with
non-mechanical switches such as transistors because they do not exhibit bounce problems.
The debounce cycle count can be as high as 255. The equation is (debounce ÷ sample rate)
seconds. For instance if the sample rate is set to 25 and the debounce is 2, then the input
condition will be recognized in (2 ÷ 25) seconds, or 0.08 seconds (80 mS). As an alarm input
this means that the signal must be in the active (on) state for at least 80 mS to be considered a
real alarm. As a pulse counting input the signal must be in the active (on) state for at least 80
mS and in the inactive (off) state for another 80 mS to be considered a real pulse. This total
period of 160 mS translates into a maximum pulse rate of 6.25 pulses per second.
109

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents