sharp ir sensor 10 meter wire unstable output

Hi i'm building this elevator system, and as safety precautions im using two infrared sensors at bottom and top, when i use sensor very close to arduino it works fine but when i extend the distance with long wiring, i cant get healthy results, it acts like it sees something when it doesnt.

My guesses are:

long wiring caused either too much noise or high resistance prevents it working right.
supplying it from arduino from 10 meters maybe not a good idea?
wires are too thin or not shielded so signals are not protected.

Thank you in advance

Do you have a link to the sensor.
What is the LED current.
What is the value of the pullup resistor.
Leo..

is the link to sensor.

i dont use additional resistor. im using Arduino Mega so the resistance is whatever it has.

A <=5cm distance sensor (PWM output) as end stop for an elevator seems strange.
It seems you don’t need additional parts for this sensor.
Coudn’t find anything in the datasheet of the sensor of it’s output drive capacity (current).
I would try Cat-6 wire (low capacitance), and run output and ground on one pair.
5volt on a second pair, and ground on the remaining two pairs.
This sensor pulses ~70mA through the IR LED.
An electrolytic cap (~470uF) from +5volt to ground at the sensor end might help smooth the supply.
Leo…

CAT6 is balanced, for long runs you may have to use differential signalling to get reliable
results, but this is low data rate so it will probably be OK.

Never connect the sensor electrically to chassis where its fixed, it should only be connected
to the Arduino via its cable, that's essential.

Maybe easier to use shielded cable. Definitely decouple at the sensor, that is always correct.

With 70mA make sure the total cable resistance only drops a few tenths of a volt - this is
something you can calculate or measure.