So I salvaged these photo interruptor sensors from an HP Laserjet 5000 printer. I think I figured out how to use them. This is what's going on inside them. Here's a schematic of the parts: To use a photo interrupter you will need to identify the three wires leaving the photo interrupter. They are Vcc, Gnd and signal. Vcc is connected to the IR LED anode (+) , signal is connected to the photo transistor collector (+) and ground is connected to both the IR LED cathode and the photo transistor emitter. And here is a sample circuit: I believe the arrow pointing to the right is the "detector" which you connect to your machine limit switch inputs. All of this was provided by https://capolight.wordpress.com/2010/11/24/making-endstops-from-printer-photo-interrupters/ I found a datasheet on one of them, On the side it says P1241 C5 8B which is a Toshiba TLP1241-C5.Attached as a pdf.
For jobs that don't have a materials that can be magnetized you can use a simple REED switch. You will all remember electronics as a kid, this is one of the first non contact switches used. Quote "Most matter will exhibit some magnetic attraction when under high enough magnetic fields. But under normal circumstances aluminum isn't visibly magnetic." http://terpconnect.umd.edu/~wbreslyn/magnets/is-aluminium-magnetic.html https://en.wikipedia.org/wiki/Reed_switch https://www.sparkfun.com/products/8642 $1.50 US $110 with shipping, JOKE! for all you with NO sense of humor. http://www.maplin.co.uk/p/assemtech-micro-reed-switch-no-cl37s £1.99 A Rhodium contact reed switch Low contact resistance and high speed operation Suits many applications including sensors, proximity switching instrumentation and alarm solutions It acts electrically the same as any other switch but because if has no external switching mechanism it can not be blocked with debris. They are easy to mount in any location and very cheap being old school.