User manual
Robotics experiment with PIC microcontroller l 65
LF
AX
=
Therefore, L equals
F
A
L
X
×
=
Thus, the distance value from the phototransistors will be sent to the Signal Evalua-
tion Module before it is changed to voltage, resulting in a change of voltage according
to the measured distance.
5.6.3 Reading GP2D120 with A/D converter
The GP2D120’s output voltage will change acoording to the detection distance.
For example, Vout 0.5V is equal 26cm. distance and Vout 2V is equal 6cm. distance. The
table 5-1 shows the summary of GP2D120’s Vout and Distance relation.
For interfacing with A/D converter module within microcontroller, the result is raw
data from the A/D conversion. The user will need to use the software to convert the raw
data to the exact distance. You can calculate the approximate distance from the formular
below.
#8
'"
4
−
+
=
Thus, R as Distance in Centimetre unit
V as Digital data from A/D conversion
For example, see the Table 5-1. The raw data from conversion is 307. It is equal
8cm. distance.
Warning for the signal cable of the GP2D120
The GP2D120 module has a different pin arrangement then that of the MicroCamp board,
even though it looks similar. Therefore, a special signal cable has already been connected
to the GP2D120 module. The user just needs to connect the other end of the cable to the
connection points of the MicroCamp board. DO NOT remove the cable from the module,
and do not replace it with signal cables from other sensor modules.