Simple Light-based Sensor System
In this system, the sensor (a phototransistor) is positioned opposite a light source. A condensing lens system forms parallel a light beams that are directed toward the focusing lens. It, in turn, directs the light to the sensor.
When an opaque object passes between the sensor and the Light source, the light is cut off, and that changes the sensor state.
A problem with the type of sensor system is that it requires the light source and sensor to be on opposite sides of the object's path of travel.
How to solve this problem?
Simple optical Presence sensor