Interfacing a button to a microcontroller (and PC) with a 50 m long cable
Looks like too much circuitry, which leads to more cost, complexity, failures.  There is nothing in the question that indicates anything more than series resistors are required.  Adding components, like isolated switching power supplies, adds components with much higher failure rates than a few resistors and diodes.  The circuit below is well protected, simple, reliable, and goes high/low when switch is closed/open.  There would need to be a specific, compelling reason to add all that circuitry in the question.







simulate this circuit &ndash; Schematic created using CircuitLab