AVR Controlled GP2D120 Distance Sensor

May 11th, 2006

Sharp's GP2D120 (and the GP2D12) is an infared distance sensor which is pretty common in the hobby robotics community. I purshaces a couple of these from DigiKey to use in a small wall-huggin robot. I spent quite a bit of time experimenting with it. This page will provide you with my schematic and AVR gcc source code for my demo file. It simply uses the ADC on an ATMega8 mpu to read the analog output of the GP2D120 and send the distance in centimeters to my laptop through the serial port (actually, through a USB to serial converter).

Read the rest of this entry »