Limit switch end stops, best/safer if they were wired normally closed, I'm not sure what is recommended for the optical.
End Stops: Magnetic Hall Sensor, Auto level probe. Would an optical sensor be an improvement? [reprap.org]
Filament detection using an end stop. [forums.reprap.org]
some gotchas.. the steppers will not move in a negative direction if it thinks the min endstop for that axis is triggered. Which is why I like to get the endstops working first thing. Be very careful not to short the + pin to the - pin on the endstop connector. Shorting this kills most boards. [forums.reprap.org]
if you only have 3 endstops, you need to disable the max endstops, //#define DISABLE_MAX_ENDSTOPS
End Stop: Start with the M119 command to check your endstop wiring. If the switches are reading triggered when the carriages are not touching them, the printer will think that it is already homed and not move the carriages [forums.reprap.org]
Connecting end stop [reprap.org]
Wiring Diagram: Sometimes the parallel port's limit switch terminal will be signaled by the noise in the steppers’ wires. [solsylva.com]
Wiring limits and home switches [www.pminmo.com]
Unshielded twisted pair: End stop wiring [www.reprap.org]
End Stops: Magnetic Hall Sensor, Auto level probe. Would an optical sensor be an improvement? [reprap.org]
Filament detection using an end stop. [forums.reprap.org]
some gotchas.. the steppers will not move in a negative direction if it thinks the min endstop for that axis is triggered. Which is why I like to get the endstops working first thing. Be very careful not to short the + pin to the - pin on the endstop connector. Shorting this kills most boards. [forums.reprap.org]
if you only have 3 endstops, you need to disable the max endstops, //#define DISABLE_MAX_ENDSTOPS
End Stop: Start with the M119 command to check your endstop wiring. If the switches are reading triggered when the carriages are not touching them, the printer will think that it is already homed and not move the carriages [forums.reprap.org]
Connecting end stop [reprap.org]
Wiring Diagram: Sometimes the parallel port's limit switch terminal will be signaled by the noise in the steppers’ wires. [solsylva.com]
Wiring limits and home switches [www.pminmo.com]
Unshielded twisted pair: End stop wiring [www.reprap.org]