Photointeruptors come in a lot of different flavors, some costing under US$ 1.00
Some have lenses over the LED and some do not. Some have wires attached and some have only bare pins. Some have polycarb housings and some use much cheaper plastic. Some are rated for vibration and some not . . etc. etc.
In order, I have had lots of false signals from stray light and dust with the un-lensed parts, pins break off very easily on the parts with bare pins sticking out (in fairness, these are meant to be mounted on a PCB, not have wires hanging off them), plastic housings that dissolve seemingly in anything except distilled water, and finally, some just litterally fall apart. The 4th axis was the 'acid test' that killed a number of these parts, some of which were actually working fine as homing switches.
After the above experience with various recommended products, I have settled on the following rather expensive unit US$ 7.25 approx. It has wire leads, lenses covering the optics (to keep out dust and swarf), an indestructible polycarbonate housing that can bend a .060 aluminum tab that gets out of line and hits it, and can tolerate vibration.
It is a Honeywell model HOA 1887-012
I now have these on all of my machine axis and also on the 4th axis and they will be used on the commercial verison of the 4th axis as well. You simply need a 100 to 150 ohm resistor on the 5V that feeds the LED (red wire) You can use 5V or up to 30V for the trigger side. For example if you use 5V from a BOB, you can daisy chain 3 of these and still have 3.5V return to the BOB. I have a little "Remote LED driver board" to boost signals, but it has not been necessary to use with these Honeywell interrupters and the Homann designs BOB.