Hello,
it is impossible to give a clear answer:
- what is the sensor and what is the output signal? What is the output?
- What is the receiver of this signal? What signals are expected on the receiving side?
- what cable do you want to use? How routed? The presence of any interference?
This is as a starting point.
20 m is already quite a lot for digital signals, but to light up an LED is not a problem.
Such a cable will bring a lot of delay to the signal edges, so here is the first potential problem.
Inducing interference and lowering signal levels, meaning it can be difficult to detect whether it's an L, H or Z state.
With such a long cable it is more likely that the output should be OC/OD type and loaded on the receiver side.
Regards