|
||
| Introduction: | ||
The Sharp
GP2D12 IR Distance Detector is a small device that
measures 1 and 3/4 inches by 1/2 inch with a 1/4 inch
connector on one side. It is capable of measuring the
distance between itself and an object that is within a
distance range of 10cm (~4") to 80cm
(~30"). This sensor takes a continuous distance reading and reports the distance as an analog voltage which can be read from its connector, which has 3 pins; power, ground and the output voltage. |
||
This
sensor uses triangulation to detect the distance. A small
linear CCD array detector is positioned 3/4 of an inch
away from an IR emitter and is used to compute the
distance and/or presence of the IR reflection in the
field of view. If the IR light reflects off an object, it returns to the detector and creates a triangle between the point of reflection, the emitter, and the detector. The angles in this triangle vary based on the distance to the object, and from those angles, the distance to the object can be calculated. This method of ranging is almost immune to interference from ambient light and offers amazing indifference to the color of object being detected. |
||
When
reading the output voltage of the sensor, two things are
noticed;1: As shown on the graph on the right, the output voltage that is generated from the sensor represents a value of a trigonometric function, because of this, the output of these sensors is non-linear with respect to the distance being measured.
|
||
| I/O connections: | ||
To connect the Sharp GP2D12 to
the OOPic, one Analog to Digital I/O Line is used. The
OOPic's +5-Volt power can be used for one GP2D12, but two
or more will put a strain on the OOPic's voltage
regulator. You can upgrade the OOPic's voltage regulator
by following these instructionsA capacitor in the value of 4.7uF is placed between the sensor's output voltage and the ground. This limits the output voltage from changing very fast and thereby smoothes out the 0.01 voltage pulses. |
||
| To connect the Sharp GP2D12 to the OOPic, 1 Hardware
Object must be created. This hardware object will be set up in the following manner. |
||
| The Program: | ||
|
||
| Send mail and comments to: Savage Innovations. |