Cannot get endstops working

We’re working with FarmBot Genesis v1.3 but without encoder cables so we’re attempting to add in endstops instead. So far we have 2 endstops (x min and y min) using simple buttons. They’re connected the the Farmduino as shown. The x endstop doesn’t work at all and the y endstop only works when connected as shown, between GND and 5V. Both gave the same result when we tested them with a multimeter and pressed the button (high resistance but becomes low when the button is pressed) so we’re not sure why only the y end stop works. We’ve also tried swapping them round to see if it’s a problem with the pins but, in any of the 6 endstop slots, only the y endstop works.

Also, the y endstop works no matter whether the y endstop is enabled or not in the device settings. When the y endstop is activated the logs read:

Firmware handler: Elixir.Farmbot.Firmware.UartHandler died: {:error, :eio}
UART handler died: {:error, :eio}
UART device removed.

and the FarmBot stops moving.

Anyone got any ideas what’s going wrong here? Why is the x endstop not working and why does it not matter whether or not it’s enabled in settings?

Did you try to connect your switch to GND - SIG?
Right now you are causing a short circuit between 5V and ground! That’s why the board always reboots (UART Handler died).

Ah okay that makes sense. With the cables connected to ground and signal the maximum endstops now work. However, the minimum endstops don’t stop the FarmBot, they just reset that coordinate to 0 and the bot continues to move. Is this how it should work or should triggering the minimum endstops also stop the FarmBot from moving too?

Thanks for your help

Did you enable the setting STOP AT HOME? This should prevent the axis from moving into negative coordinates.