DISCLAIMER: I\'ve collected these information from different sources. The author may revise this documentation from time to time without notice. THIS DOCUMENTATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN NO EVENT SHALL THE AUTOR BE LIABLE FOR INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY KIND ARISING FROM ANY ERROR IN THIS DOCUMENTATION, INCLUDING WITHOUT LIMITATION ANY LOSS OR INTERRUPTION OF BUSINESS, PROFITS, USE, OR DATA. |
There is a type of detector known as a "slotted switch" that consists of a phototransistor/LED pair mounted on a solid frame with a small air gap between the two elements. A typical circuit might be:
o +5v o +5v | | | | \ \ 220 ohms / / 4.7K \ \ / / | | | +-------> Vout _|_ / \ / |/ ----- |\ NPN | \ | | | | | | GND GND | air gap |