Although it may seem obvious now that keys on a keyboard would use simple electrical switching, this was not always the obvious choice. Switch bounce necessitated alternative approaches to keystroke detection until viable means were found to satisfactorily accommodate conductive switching.
Conductive switches occupy a range of reliability levels. Although they will never reach the highest tier of reliability reserved for contactless switching techniques, rated lifetimes of 100 million keystrokes are claimed by some mechanical switch types. Conductive switches are subject to a number of additional limitations over contactless switching. Conductive switches are more susceptible to ingress of foreign materials. The metal switch contacts can corrode and fail: even if the contact surfaces were pure gold, the body of the switch contacts will be a metal subject to oxidisation. The switch contacts can lose their correct elastic properties and misregister, and the contacts may suffer physical damage.
In realistic terms, however, well-made conductive switch designs should offer many years of reliable service. IBM’s Model M keyboards demonstrate that even membrane keyboards will hold up reliably for decades; the main flaw with their product range was the use of heat staking instead of metal tabs or screws to secure the membrane assembly backplate, not the membranes themselves.
Various characteristics of a switch degrade with age and wear, in particular:
- Contact resistance will increase as the contact surfaces wear, which will eventually cause switches to stop registering; this is especially true of conductive rubber switches where the conductive surface fails and needs to be cleaned or renewed
- Bounce time will increase as the contacts age, eventually leading to chatter
Switch contacts can either be pressed together to close the circuit or allowed to close of their own accord. The latter technique is more common with discrete switches and is held by some manufacturers to be superior. In their “New IBM Compatible Keyboards” flyer of unknown age, Hi-Tek said of their Series 725 switches:
HI-TEK’s patent pending keyswitch design is truly the key to the exceptional performance and reliability of these new keyboards. The smooth feel, full travel, field-proven keyswitch features a passive contact system which isolates the contact force from the actuation force thereby optimizing switch performance.
The catalogue entry for Mechanical Enterprises T-5 Series states:
Switching action is accomplished by movement of one gold plated bar against another at right angles (classic cross bar switching). The bars strike with a velocity determined only by spring forces and not subject to the speed at which the switch plunger is struck. This type of design provides a much more constant and lower contact bounce than is found in mechanical contact switches of more conventiona design. The effects of operator differences are substantially eliminated.
This “passive” contact operation can also be found in the Cherry and SMK mechanical keyboard types, but “switchplate”-based designs including Alps (S)KCC, Alps (S)KCL/KCM and Omron B3G-S do indeed press the contacts closed. Membrane keyboards by their very nature also require the contacts to be pressed together, and in many cases offer no isolation from the operator actions besides the cushioning effect of the rubber dome.
Passive contacts are held apart by the switch mechanism, typically by the plunger. Of their M4/M5/M6 contact design, Cherry noted the following in their 1973, 1974 and 1979 catalogues:
Contacts are normally held apart for greatest shock resistance.
No microphonics or bounce during turn-off or at rest.
Of their older Dovetail Series switches, Hi-Tek wrote:
To this design, HI-TEK incorporated cantilevered contacts which are isolated from the switch dynamics, thus assuring that the contact pressure is independent of switch operations.
Switch contacts are formed around elastic materials such as phosphor bronze, polyester and silicone rubber. When a switch changes its state, the contact body takes a few milliseconds to settle in its new position. This can be visualised as dropping an elastic ball onto the floor: it will bounce back into the air each time it strikes the floor, with each rebound reaching a lower height until the ball finally stops moving. For a ball, this process make take a few seconds; for switch contacts, the target bounce time willl be as low as 2–10 milliseconds depending on the switch type and intended usage and price point. Unfortunately, to a machine, 2 milliseconds is a long time and electronic hardware will interpret the repeated contact closures as the button being pressed repeatedly in rapid succession.
Debouncing is the process of filtering out this period of instability, either electronically, or by simply waiting for the switch contacts to settle. Various techniques exist, with varying levels of bulkiness and complexity. These techniques include:
- A double-throw switch can be connected through a flip-flop (latch), with each throw connected to one flip-flop input. The flip-flop will remember the last switch position and hold it while the contacts settle. This approach was used by Micro Switch for their contact buffer circuits sold for use with PB series switches, but has yet to be observed in a keyboard.
- A resistor–capacitor (RC) filter can be used to smooth out the changes in current until the switch settles. This too is not known from any keyboards.
- Mercury switch contacts, as used in the Mercutronic line of switches from Mechanical Enterprises. Liquid conductive surfaces will presumably fuse instead of bounce hard, ensuring clean make and clean break.
- Timed delay: once a keystroke is detected, wait a defined period (e.g. 10 ms) for the switch contacts to settle. If the switch is still conducting after this period, the switch is successfully closed and the keystroke should be registered. If the switch is no longer conducting, then the keystroke could have been spurious (as a result of electromagnetic interference) or unintentional. Single-chip encoders extensively used this technique, pausing the scanning process to allow time for the switch to settle. Timed delay is trivial to implement in logic (both hardware and firmware) but it does come with a limitation: any key that continues to bounce beyond the expected limit will stop being filtered, leading to duplicate keystrokes being reported.
The Ganssle Group has written a detailed article on contact bounce and various techniques that can be used to combat it, entitled Debouncing Contacts and Switches in Embedded Systems.
When the bounce time exceeds the time limit set by time-based debouncing, the bounce is referred to as “chatter”. Causes of chatter include an incorrect pairing of encoding logic and switches (where the switches by design are outside of the tolerance of the debounce logic) and switches that are out of tolerance due to manufacturing defects, damage or age. Switch contact cleaner can be used to restore chattering switches back to an acceptable bounce time.
The maximum bounce time of switch depends on its design. Reed switches have some of the lowest bounce times as the metal reeds are small, light and barely move, thus developing minimal momentum. Generally, reducing bounce time increases switch cost. Reed switches tend to have a bounce time under 2 ms, mechanical switches tend to have a maximum bounce time of 5 ms, and elastomeric types and cheap mechanical switches can have a longer limit of 20 ms.
Bounce time also depends on how the switch is operated. The 5 ms maximum bounce time of Cherry MX switch time is conditional upon an actuation speed of 0.4 ms−1. Amphenol advertised their 601 Series mechanical switches as having a maximum bounce time of “500 microseconds on touch typing applications and two milliseconds on hunt and peck applications”.
In his article “Real-Time Time Conversions” (Personal Computing, May 1980), James Nestor wrote, “If your keyboard bounces (don’t they all?) and puts an extra L in London, the name will be rejected, Try again.” The article would suggest that consumer computers of the era simply ignored key bounce, but as the article describes a program that the author wrote for a Radio Shack TRS-80, the author may have been experiencing a curious defect of that specific model of computer. In his article Model I Keybounce, Matthew Reed notes that the Level II BASIC ROM for the TRS-80 Model 1 did not include a debounce routine. Separate software—Keyboard Debounce and Real-Time Clock, known as “KBFIX”—had to be loaded into memory to add a debounce routine, each time the computer was started. It seems that debouncing was present in Level I BASIC, but anyone upgrading to Level II BASIC would lose that facility.
In this instance, the severity of the contact bounce was attributed to the lack of protection afforded by the switches against the ingress of foreign matter (with cigarette smoke being signficantly blamed). The switch type is not named, but from the description—where removing a keycap exposes the switch contacts—this would have been the Hi-Tek “High Profile” keyboards. The later Alps KCC seemed to be a lot less susceptible.
In the field of video games, there is a desire for all possible delays to be reduced as much as possible. Multiple factors introduce delays in presentation and response, including frame rate control in monitors, packet round trip time in networking and keyboard response. Keyboard response time itself involves multiple delays, including USB polling rate and debounce time. By opting for a keyboard technology with lower debounce time (e.g. replacing membrane with mechanical) or no debounce time at all, up to 20 ms of delay can be eradicated.
Avoiding contact bounce and its attendant complexity was a driving factor in a number of other fundamentally different switch types. In particular this included photoelectric, Hall effect, capacitive and inductive sensing. Capacitive and Hall effect keyboards never went out of production, while photoelectric keyboards have made a comeback.