Safety Door Switch for CNC

Well… never say never! There are no physical spare pins left unused on the ESP32 so the only option would be to re-purpose an existing used pin, (you cannot use a I2S pin for an input, nor can you use either I2C’s SCL or SDA as an input) perhaps the easiest pin to use would be one of the limit switch pins, is there one of those you wouldn’t mind losing? As you intend having the probe working perhaps the Z limit pin would be a possibility… just need to be careful not to drive the Z into the baseboard :slight_smile:

Comment out the #define Z_LIMIT_PIN GPIO_NUM_34 in the i2s_out_xyz_mks_dlc32.h file and add the #define CONTROL_FEED_HOLD_PIN GPIO_NUM_34.

You get the idea!
firmware.zip (759.0 KB)
This pin is normally closed so the door would need wiring accordingly