Page 1 of 1

Sharp IR Distance Sensor

Posted: Tue Feb 25, 2025 4:57 am
by dguimaraes
Hi,
I'm using Sharp Distance Sensor (20-150cm) with IR Distance Adapter.
If I declare the sensor type:

PhidgetVoltageRatioInput_setSensorType(voltageRatioInput0, SENSOR_TYPE_1101_SHARP_2Y0A02);

After this I never receive reads... I only can use this setup receiving values from voltageRatio value... how can i receive data in distance like mm

thanks

Re: Sharp IR Distance Sensor

Posted: Tue Feb 25, 2025 4:37 pm
by Patrick
If you open it in voltage ratio mode, what range of values are you getting?

The formula for converting voltage ratio to distance is:

Distance (cm) = 9.462 \ (VoltageRatio - 0.01692)

This formula is only valid for VoltageRatio between 0.08 and 0.49.

-Patrick