Instructor: William Fenton, Science Department, The Hotchkiss School

Instructions for using the Sharp GP2D12 IR Distance Sensor

The Sharp GP2D12 IR Distance Sensor is reliable from about 10-80 cm. It doesn't seem to be too affected by ambient light or angle of the target so it might be perfect for navigating the maze at Trinity. It works by triangulation (read more here). A pulse is sent from one side and when it is reflected and received at the other side the angle at which it is received affects a voltage that you can measure with the Vex microcontroller. The voltage value will be converted to a number between 0 and 1023 that will be the SensorValue(sensorName) in your program. To hook the sensor up to your microcontroller set up the sensor as a potentiometer and plug it into one of the A/D ports on the Vex microcontroller. Notice that the cable does not have a polarizing tab to tell you which way to insert it. Insert the cable with the black wire towards the outside of the microcontroller. Failure to do this may damage the microcontroller or the sensor.

Though you should do your own tests with your sensor, microcontroller and code, I produced a calibration plot to guide you.