In the figure we show how to excite a CMOS port by interrupting light on a Darlington phototransistor. This circuit can be used as a basis for alarms, tachometers, object counters etc. The sensitivity can be controlled by adjusting the trimpot according to the ambient light and the intensity of the light that excites the system. The circuit will work satisfactorily with voltages from 6 to 12 V and the maximum counting frequency, which also depends on the phototransistor, will be limited to a few hundred kilohertz.
