I have a main PCB and 3 button boards. You can see the connection at bottom from my ugly paint sketch. Each button board has 2 push buttons and a power LED. One of the buttons is switching GND and other one is switching 24V. Power and button signals goes together with a CAT6 cable.
The main PCB includes a PIC microcontroller.
Main PCB input circuit for buttons here:
TS for GND switching buttons, ST for 24V switching buttons. To the right side is a ULN2003 connected to the microcontroller with pull-ups.
I tested the circuit with a short cable and it worked. When I tried with longer cables, it fails sometimes.
The main PCB reads a button pressed without the button being pressed.
I also tried to add pull-down resistors on the input side of the main PCB of 24V switching buttons. It is increased accuracy but sometimes still fails.
I can change the main PCB very little (like adding pull-up, pull-down resistors) but not much. I am free to makr changes on buttons.
It may be a basic problem but I could not figure it out. I am open to any solution for proper working buttons.
Edit: I know there is little information but I can not find the cause of the problem.