2Y0A02 OPTICAL SENSOR,SHARP DISTANCE SENSOR-20-150CM 2YOA21

Torindia Product Code :
1290-D32

This popular sensor made by Sharp produces an analog output that varies from 2.5V at 20cm to 0.4V at 150cm.

Based on "typical values" from Sharp, the formula to translate SensorValue into Distance (the formula is only valid for a SensorValue between 80 to 490) is:

Distance (cm) = 9462/(SensorValue - 16.92)