page_title: Switch
section_title: Contact bounce
hierarchical_section_title: Switch / Contacts / Contact bounce
caption_attribution_description: English: The "bouncy" voltage of a switch turning on. This is a crop from a screenshot of an Agilent Technologies oscilloscope.
context_page_description: In electrical engineering, a switch is an electrical component that can disconnect or connect the conducting path in an electrical circuit, interrupting the electric current or diverting it from one conductor to another. The most common type of switch is an electromechanical device consisting of one or more sets of movable electrical contacts connected to external circuits. When a pair of contacts is touching current can pass between them, while when the contacts are separated no current can flow.
  Switches are made in many different configurations; they may have multiple sets of contacts controlled by the same knob or actuator, and the contacts may operate simultaneously, sequentially, or alternately. A switch may be operated manually, for example, a light switch or a keyboard button, or may function as a sensing element to sense the position of a machine part, liquid level, pressure, or temperature, such as a thermostat. Many specialized forms exist, such as the toggle switch, rotary switch, mercury switch, pushbutton switch, reversing switch, relay, and circuit breaker.
context_section_description: Contact bounce (also called chatter) is a common problem with mechanical switches and relays, which arises as the result of electrical contact resistance (ECR) phenomena at interfaces. Switch and relay contacts are usually made of springy metals. When the contacts strike together, their momentum and elasticity act together to cause them to bounce apart one or more times before making steady contact. The result is a rapidly pulsed electric current instead of a clean transition from zero to full current. The effect is usually unimportant in power circuits, but causes problems in some analogue and logic circuits that respond fast enough to misinterpret the on‑off pulses as a data stream. In the design of micro-contacts controlling surface structure (surface roughness) and minimizing the formation of passivated layers on metallic surfaces are instrumental in inhibiting chatter.
  The effects of contact bounce can be eliminated by use of mercury-wetted contacts, but these are now infrequently used because of the hazards of mercury. Alternatively, contact circuit voltages can be low-pass filtered to reduce or eliminate multiple pulses from appearing. In digital systems, multiple samples of the contact state can be taken at a low rate and examined for a steady sequence, so that contacts can settle before the contact level is considered reliable and acted upon. Bounce in SPDT switch contacts signals can be filtered out using a SR flip-flop (latch) or Schmitt trigger. All of these methods are referred to as 'debouncing'. 
  Software-based contact debouncing methods are usually based onto a multiple polling with simultaneously statistics storing. The simplest method is a similarity counting algorithm, that is continuously and periodically polls the contact. If the current instant read is equal to previous, counter increments, otherwise, it clears. The contact considered as a trust closed-up, when the similarity counter reaches some predefined threshold value. An improved method consists in denoting one of a contact states as a desirable (target), which is difficult to get (needs a multiple equal values, which have inextricably inputted during threshold period) into and easy to leave (a single contact conjoin value leads to reset of trust state). In this case, a Mealy finite-state machine (FSM) approach is suitable.
  Auto-repeat is a feature when after the first contact closing-up condition is detected, the polling FSM begins to periodically emit the addition closing-up signals of button pushing  predominantly with the decreasing of time period between emits. During auto-repeating FSM behaves itself (in relation to the upper-level subroutine) similar to a pulse-frequency modulator. This feature is a strongly necessity in such application as an input devices (for example, in remote control units, RCU).
  All electronic and software-based debouncing methods only mask (or filter) the bounce transient process for sensitive or control digital circuits, or soften and shorten the trajectory of the electrical component of the transient process.
  By analogy, the term "debounce" has arisen in the software development industry to describe rate-limiting or throttling the frequency of a method's execution.
  In the Hammond organ, multiple wires are pressed together under the piano keys of the manuals. Their bouncing and non-synchronous closing of the switches is known as Hammond Click and compositions exist that use and emphasize this feature. Some electronic organs have a switchable replica of this sound effect.
caption: Snapshot of switch bounce on an oscilloscope. The switch bounces between on and off several times before settling.
exif: {}