For everyone interested: I did a quick experiment today using a hall-effect device to replace the mechanical microswitch currently in use in my bench mill. The test objectives were to see first if a simple circuit would actually work, and second, to see how repeatable the action of the device would be. This latter is important, as a consistent home function on your mill will help with batch operations and fixturing.
My mill uses 1000-line servos, Flashcut control, ground ballscrews (2mm pitch C3 grade), THK rails. For the test, I increased the resolution of the system to its best, which was 0.00005". The Flashcut system uses digital servo drivers (Logosol) so I am able to jog and move about by "step" which equates to a single line on the encoder wheel.
When homing in Flashcut, the software is designed to report any deviation from the previous home operation. This allowed me to run a few dozen home ops in succession and check the results.
The quick/dirty circuit: The system uses a hall sensor (several were tried) which acts as an open drain to a cheap logic-level N-MOSFET like a BS170. The entire test setup uses an external 5V supply, and behaves like a NORMALLY CLOSED microswitch.
On the left is the hall chip, with built-in digital logic and hysteresis. It behaves like a simple NPN transistor. When the South pole of a magnet is in range, the transistor is "on", which dumps the charge on the MOSFET gate to ground, shutting off the MOSFET. This opens the line from the controller, and the controller senses an open circuit ("switch is tripped"). With no magnet, the MOSFET gate is pulled high with the 10K pullup resistor; the MOSFET conducts, and the controller "sees" a closed switch.
Inside probably 95% of modern digital CNC controllers is a setup like that shown. Everything to the right of the vertical dashed line is part of the controller. One of the paired switch lines has a small potential... it is likely pulled high internally, and that line is tied to a uProcessor chip. The other switch wire is simply ground. When the two wires are continuous, like an NC microswitch, the wire to the uProcessor is near ground potential, and the uProcessor determines that the circuit is in its normal closed state.
With this circuit, the CNC controller switch line that is pulled high is wired to the MOSFET drain, and the grounded line to the MOSFET source. The 470 ohm resistance is a safeguard against excess current if a component fails.
On the Hall chip, pin 1 is Vcc, pin 2 is ground, and pin 3 is the "output" (open drain). Current through the hall cannot exceed typically 25 to 50 mA; this setup will draw ~ 1 mA.