This optical pass-through shield can be used in various applications, such as object sensing or even drops, interfacing the input of microcontrollers. The resistor in series with the LED can be changed according to the type. The circuit is documentation from the 1980s. The transistor can be the 2N2222.