A way to avoid the influence of ambient light, or even the action of external light sources on the detector circuit, is to use modulated light. The resulting signal from a sensor circuit such as the one shown in the following figure is a tone with the same frequency as that used in the modulation and can be applied to a PLL for detection or to a recognition circuit of another type, including those that use DSPs. In the indicated circuit, the 22 kΩ resistor in series with the sensor can be changed depending on the desired sensitivity. The phototransistor used must be of a type chosen according to the application, but in general common types such as the TIL78 allow operation with modulated signals of up to a few hundred kilohertz. The complete circuit for this application is in the figure.