This popular sensor made by Sharp produces an analog output that varies from 3.1V at 10cm to 0.3V at 80cm.
The sensor has a Japanese Solderless Terminal (JST) Connector. You can purchase a pre-made cable with connector that mates with this sensor - see 3-pin cable for Sharp Sensors (30cm) or 3-pin cable w/Male Pin Header for Sharp Sensors (30cm).
For limited period, the sensor comes with a 3-pin cable approx. 20cm.
Documents: