When a control circuit is constructed, it must have sensing devices to tell it what to do. The number and type of sensing devices used are determined by the circuit. Sensing devices can range from a simple push button to float switches, limit switches, and pressure switches. Most of these sensing devices use some type of mechanical switch to indicate their condition. A float switch, for example, indicates its condition by opening or closing a set of contacts (Figure 51 – 1). The float switch can “tell” the control circuit that a liquid is either at a certain level or not. Most of the other types of sensing devices use this same method to indicate some condition. A pressure switch indicates that a pressure is either at a certain level or not, and a limit switch indicates if some device has moved a certain distance or if a device is present or absent from some location.
Almost all of these devices employ a snap-action switch. When a mechanical switch is used, the snap action is generally obtained by spring loading the contacts. This snap action is necessary to ensure good contact when the switch operates. Assume that a float switch is used to sense when water reaches a certain level in a tank. If the water rises at a slow rate, the contacts will come together at a slow rate, resulting in a poor connection. However, if the contacts are spring loaded, when the water reaches a certain level, the contacts will snap from one position to another.
Although most contacts have a snap action, they do not generally close with a single action. When the movable contacts meet the stationary contact, there is often a fast bouncing action. This means that the contacts may actually make and break contact three or four times in succession before the switch remains closed. When
this type of switch is used to control a relay, contact bounce does not cause a problem because relays are relatively slow-acting devices (Figure 51 – 2).
When this type of switch is used with an electronic control system, however, contact bounce can cause a great deal of trouble. Most digital logic circuits are very fast-acting and can count each pulse when a con- tact bounces. Depending on the specific circuit, each of these pulses may be interpreted as a command. Contact bounce can cause the control circuit to “lose its mind.” Since contact bounce can cause trouble in an electronic control circuit, contacts are debounced before they are permitted to “talk” to the control system. When contacts must be debounced, a circuit called a bounce- less switch is used. Several circuits can be used to construct a bounceless switch, but the most common construction method uses digital logic gates. Although any of the inverting gates can be used to construct a bounceless switch, in this example only two will be used.
Before construction of the circuit begins, the operation of a bounceless switch circuit should first be dis- cussed. The idea is to construct a circuit that will lock its output either high or low when it detects the first pulse from the mechanical switch. If its output is locked in a position, it will ignore any other pulses it receives from the switch. The output of the bounceless switch is connected to the input of the digital control circuit. The control circuit will now receive only one pulse instead of a series of pulses.
The first gate used to construct a bounceless switch is the INVERTER. The computer symbol and the truth table for the INVERTER are shown in Figure 51 – 3. The bounceless switch circuit using INVERTERS is shown in Figure 51 – 4. The output of the circuit should be high, with the switch in the position shown. The
switch connects the input of INVERTER #1 directly to ground, or low. This causes the output of INVERTER #1 to be at a high state. The output of INVERTER #1 is connected to the input of INVERTER #2. Since the input of INVERTER #2 is high, its output is low. The output of INVERTER #2 is connected to the input of INVERTER #1. This causes a low condition to be maintained at the input of INVERTER #1.
If the position of the switch is changed as shown in Figure 51 – 5, the output will change to low. The switch now connects the input of INVERTER #2 to ground, or low. The output of INVERTER #2 is, therefore, high. The high output of INVERTER #2 is connected to the input of INVERTER #1. Since the input connected to INVERTER #1 is now high, its output becomes low. The output of INVERTER #1 is connected to the in- put of INVERTER #2. This forces a low input to be maintained at INVERTER #2. Notice that the output of one INVERTER is used to lock the input of the other INVERTER.
The second logic gate used to construct a bounce- less switch is the NAND gate. The computer symbol and the truth table for the NAND gate are shown in Figure 51 – 6. The circuit in Figure 51 – 7 shows the construction of a bounceless switch using NAND gates. In this circuit, the switch has input A of gate #1 connected to low, or ground. Since input A is low, the output is high. The output of gate #1 is connected to input A of gate #2. Input B of gate #2 is connected to a high through the 4.7 kilohm resistor. Since both inputs of gate #2 are high, its output is low. This low output is connected to input B of gate #1. Since gate #1 now has a low connected to input B, its output is forced to remain high even if contact bounce causes a momentary high at input A.
When the switch changes position as shown in Figure 51 – 8, input B of gate #2 is connected to a low. This forces the output of gate #2 to become high. The high output of gate #2 is connected to input B of gate #1. Input A of gate #1 is connected to a high through a kilohm resistor. Since both inputs of gate #1 are
high, its output is low. This low is connected to input A of gate #2, which forces its output to remain high even if contact bounce causes a high to be momentarily connected to input B.
The output of this circuit will remain constant even if the switch contacts bounce. The switch has now been debounced and is ready to be connected to the input of an electronic control circuit.
Review Questions
1. Why should mechanical contacts be spring loaded?
2. Name three examples of sensing devices.
3. Why must contacts be debounced before they are connected to electronic control circuits?
4. What function does a bounceless switch circuit perform?
5. Name two types of logic gates that can be used to construct a bounceless switch circuit.