Book Analog Interfacing to Embedded Microprocessors
6 shows a slotted optical switch. An LED is mounted in a plastic
housing, facing a phototransistor. A gap separates the two, so if something
Figure 3.6
Slotted optical switch.
Sensors 59
moves into the gap, it blocks the light path between the LED and the photo-
transistor. Slotted switches are often used to detect motor speed by placing a
slotted wheel on the motor shaft; as the shaft rotates, it alternately blocks and
unblocks the light path. Another use for slotted switches is as indicators when
a door or hood is open or closed. A flag on the door drops into the slot and
blocks the light when the door is closed.
Reflective Sensors
Figure 3.7 shows a reflective sensor. A reflective sensor works the same way as
a slotted switch, except that the phototransistor picks up reflected light from
whatever is in front of the switch. Most reflective sensors have a focal length,