Book Analog Interfacing to Embedded Microprocessors
part to generate digital logic levels. The price for this capability, of course, is
the cost of adding an ADC and the slower speed caused by the time needed
for ADC sampling. A comparator can also be used; it does not provide the
flexibility of the ADC, but is faster and cheaper. 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