This industrial grade photo sensor has a detection distance of
approximately 32 feet.

To install it, you simply attache the supplied reflector to one side of
the detection area and then mount the sensor unit to the other side.
Built in LEDs tell you when they are lined up. Then attach 25 volts DC
for power and connect two wires from the built in switch to whatever you
are trying to control.