Maximum distance from Arduino ports to sensors

Hi Koepel, thank you for the welcome.
Yes, I said "sensors", but it was in the context of both scenarios.
I had already thought about the solution to use 2 Arduinos and communicate them via ethernet, but I was hesitating. I thought there might be a simple and cost-effective way to increase the distance from the sensor to the port. Yep, I'm going to explore the optocoupler idea, also using a GND wire is a good tip. As scenario "B" is my main goal, it needs 2 devices anyway.