Fiber optics are the ideal solution when detecting tiny objects in cramped or inaccessible places (e.g., robotics).
Advantages:
Small, light sensors
Easy installation and initial startup
Extremely robust, heat- and chemically-resistant sensors
Long range - up to 4 meters
Reliable detection of transparent media
Short response times for the fastest processes
Usable in high-flex locations, such as drag chains