This GP2Y0A02 sensor from Sharp can be used to detect objects within the range 20cm to 150cm. The sensor senses for objects ahead of it and outputs an analog voltage corresponding to the distance between the sensor and the object. You can easily read this signal from the ADC for an Arduino/Raspberry Pi or a Microcontroller and get the distance of the object. This Sharp sensor is great to add obstacle avoidance or motion sensing to your robot or any other project. The sensor comes with a compatible 3 pin JST 3-pin connector with crimped wires. Since it is a very popular distance sensor, sample codes, tutorials and libraries for Arduino/Raspberry Pi and popular microcontroller are readily available. Features
Operating Voltage: 4.5V - 5.5V
Average current consumption: 33 mA (note: this sensor draws current in large, short bursts, and the manufacturer recommends putting a 10 µF capacitor or larger across power and ground close to the sensor to stabilize the power supply line)
Size: 44.5 mm × 18.9 mm × 21.6 mm (1.75? × 0.75? × 0.85?)
Weight: 5 g (0.18 oz)
Range: 20 cm to 150 cm (8? to 60?)
Gives an analog output corresponding to the distance of the object detected
No need of any external circuit for using this sensor.