Sharp distance sensors are a popular choice for many projects that require accurate distance measurements. This infrared sensor is more economical than sonar range finder, but it has better performance than other infrared alternatives. The interface to most microcontrollers is simple: a single analog output can be connected to an analog-to-digital converter for distance measurement, or the output can be connected to a comparator for threshold detection. This version of the test range is about 10 cm to 80 cm (4 inches to 32 inches) GP2Y0A21 uses a 3-pin JST connector. It is also easy to solder the three wires to the sensor that holds the connector pins. From the back, the three connections from left to right are power, ground and output signals.