If it's a beam-break detector, that's easy. Power an LED with a frequency, be it 9, 38 or whatever kHz. Use a 555, an LED, just 2 resistors and one capacitor for that circuit.
Then have a PV photo diode, connected in 'PC mode' feeding current through a resonant circuit tuned to your frequency, the res circuit rejects ambient light etc. Across the res cct. will be a AC signal that you can amplify if need be. The AC signal (from a few mV to a few V) can be fed into a 567 tone detector, which goes logic low when it hears your LED singing.
Make the 567 and the oscillator variable, because the tuned circuit might not be adjustable easily enough if it's a low frequency.
You can choose whatever frequency you like for your res circuit, but remember the 567 only goes up to 500 kHz(?) and too low, the res-circuit is clumsy.