Pairs of metal blades, common on-off switches, pushbuttons, microswitches, and reed switches can be used as sensors in robotics and mechatronics projects. In this chapter, we include blocks using these devices to add some important features such as debouncing, inverting, and delaying.
Theory
We often need to turn a circuit on or off when an event occurs; this is a basic function in robotics and mechatronics projects. A motor can be reversed when the robot is stopped by an obstacle or when a mechanical arm strikes an object. A mobile robot can change its direction if a sensor detects a wall in its way.
Starting with some common components and configurations, you can add mechanical sensors to your projects. Several are described below.
On-off switches—microswitches.
On-off switches can easily be adapted for use as position sensors in many applications. Figure 1 shows how can we adapt a slide on-off switch (SPST) to be used as an impact detector.
This switch can be placed in front of a robot and used to detect when it runs into any obstacle. Soft-touch types are ideal for these applications, since it does not take much power to close them.
Microswitches, e.g., those used in industrial machines, are also ideal for applications involving position sensors such as the ones shown by Figure 2.
These switches are small and sensitive, needing only a small force to be engaged. Many types of mechanisms can be adapted to common switches to convert them into sensors. Lervers can increase the sensitivity of a microswitch. Pushbuttons can also be used as sensors, as shown by Figure 3. It is important to choose one that can be easily closed by the mechanism to which it is attached.
Reed switches
Reed switches are formed by a glass enclosure that is filled with an inert gas, inside of which are blades with electric contacts. This is shown in Figure 4. The presence of a magnetic field acts on the blades, making them to touch each other and thereby closing the circuit. Reed switches are very sensitive and can be used as sensors as shown in Figure 5.
In operation, we use the field of a magnet to engage the switch. We simply install the magnet in the mobile device or in any mechanical part whose movement or position change must be detected.
Home-made sensors
Two or three blades placed together as shown in Figure 6 form a mechanical sensor that has many applications in robotics and mechatronics. The blades and the contacts can be found in old relays and switches. The reader only needs to exercise some care to make sure that the contacts are in good working condition.
Bended or deformed contacts indicate burns that can reduce the efficiency of the sensor. If present, it is best to discard the component and find a better one.
The blades can be activated in many ways. The figure shows some suggested mechanisms that can be used to activate this kind of sensor. A long
spindle, for instance, can be used to create a position or obstacle sensor.
Debouncing
When a switch is closed, electric contact isn’t established immediately. Mechanical contacts such as found in switches, relays, and sensors produce noise during their settling time. They bounce and make repeated contact during the first few milliseconds of action as shown by Figure 7.
Logic circuits such as TTL and CMOS, and even some other electronic circuits, are fast enough to recognize each and every bounce (noise pulse) as a separate impulse or logic level change. You close the switch one time, expecting to add one count to the command chain, but the circuit will jump many commands. To avoid this problem when using switches, reed switches, relays, or other on-off sensors with mechanical contacts, a proper conditioning (debouncing) circuit must be used.
The simplest circuit is formed by an RC network as shown in Figure 8. The voltage across the capacitor rises gently, even when many pulses are produced by the switch.
Other circuits, as we will show in the following blocks, can help the robotics and mechatronics designer to avoid problems created by bouncing contacts in sensors, switches, and other devices that use mechanical contacts.
Switches as Sensors
Many types of switches can be used as sensors or adapted to that task. Momentary switches can be used as bump sensors, navigation feelers, and limit sensors. The most useful are microswitches and pushbutton switches such as the ones shown in Figure 9.
Reed Switches
A reed switch is formed by a glass bulb filled with an inert gas. Inside the bulb, we find two or more metal blades as shown in Figure 10. When a magnetic field acts on the blades, they bend and touch one another, closing the external circuit.
Reed switches are very sensitive but can’t operate with large currents. Typical currents are in the range between 50 and 500 mA. Since they can switch a circuit very quickly, they can be used in high-speed applications, sensing the rotation of a shaft or any mobile part of a mechanism as shown in Figure 11.
Attaching a magnet to a wheel and placing a reed switch in an appropriate position, it is possible to produce a pulse every revolution. The pulses can be used to control the speed of the wheel or to excite a tachometer.