24v Emergency Stop Input
Here is kind of a sketch to get you on the right track. The ESTOP_SW controls the coils for both the detect relay and the machine contactor. So when the contactor is energized, the detect relay is energized and ESTOP_DETECT will be low.

When someone pushes the ESTOP_SW and opens the circuit, then the contactor and relay will be de-energized, the machine will be stopped, and ESTOP_DETECT will be high.

R1 is on the MBED. The MBED may have outputs that can be configured to have pullups (you may not need to modify the MBED). If so, use one of those, and configure it so the pullup is enabled.

NOTE: if there is a possibility of property damage or personal injury, please hire a professional engineer with liability insurance to review your installation. This is just a sketch to give you a rough idea. Lots of things could go wrong, and I have no idea what your installation is like.







simulate this circuit &ndash; Schematic created using CircuitLab