Book Analog Interfacing to Embedded Microprocessors
The threshold of the com-
parator can be adjusted to compensate for circuit limitations, such as the
relatively high saturation voltage of a darlington output. In addition, a com-
parator permits the use of hysterisis (see Appendix A) to avoid a noisy output
caused by the slow speed of the phototransistor.
62 Analog Interfacing to Embedded Microprocessors
IR Problems
Most slotted and reflective sensors use IR LEDs and phototransistors. This
means that the response of the part may not be the same as it would be for
something in the visible spectrum. Specifically, objects that are good at reflect-
ing or blocking visible light may be less effective at IR wavelengths. IR is also
susceptible to interference from fluorescent lights and sunlight.
Figure 3.9 shows how driving the LED with a square wave signal can
be combined with a filter to eliminate this type of interference. In this