Pins 1 to 7 from the motor control
board are connected directly to the 13 pin connector on the other side of
the board. This 13 pin connector will eventually connect to our
microcontroller.
IC1 is an 8-pin IC called a
Comparator. What this does is it looks at the two inputs, and puts a
high or low voltage at the output depending on which input is higher.
For example, if the input marked + is higher than the input marked - then
the output will go high, and conversely if the input marked - is higher than
the input marked + the input goes go. The inputs to the comparator are
connected to the line follow circuit. R19 is placed between the output
of IC1 and +5V in order to interface to the microcontroller later on.
It limits the current when the output of IC1 goes low, and is a standard
interfacing component in logic circuits. Other logic gates can now be
connected to the same pin without any worry of blowing the logic gates up.
In this configuration it is called a 'Wired OR'.
The two LEDs on the antennae of Cybot
are also connected to this board via PL5 and PL6. They are wired in
series. R20 is used to limit the current through the two LEDs.
Its value is calculated by subtracting 2V for each LED from the supply
voltage (in this case 6V) and dividing by 32mA (16mA for each LED).
This gives us a value of 62 Ohms. One end of the two LEDs is connected
to pin 12 of PL3 and pin 6 of PL1 which is our +6V from the AA batteries.
To turn the LEDs on, pin 6 of PL3 is brought low.
In a later issue of Real Robots, a
buzzer will be connected to cybot. This is connected to pins 2 and 3
of PL3, which is controlled by the microcontroller.
C9 is used to decouple any noise on
the +5V supply rail. The +5V supply is provided by an LM705 regulator
on the motor control board. These type of regulators are quite noisy
(electrically speaking) and so it is always a good idea to place decoupling
capacitors throughout the circuits.
The two light sensors (LDRs) are
connected to PL7 and PL8. The resistance of the LDRs will change
depending on the amount of light falling on them. They are used, with
R21 and R22, to charge and discharge capacitors C10 and C11. The
equivalent circuit is shown below:

Let us assume that the capacitors are
completely discharged. If we monitor pins 4 and 5 of PL3, we will get
an increasing voltage from 0V to almost +5V. The time to when we get
+5V will be dependant on the value of the LDRs. When we have finished
looking at the voltages across the capacitors, all we need to do is bring
pins 4 and 5 of PL3 to 0V, and this will discharge the capacitors again.
If we were to look at the waveforms across the capacitors, we would see
something like this:

Where the curve rises is when the
capacitor is charging, and when it is falling is where the capacitor is
discharging.
What we need to do now is to determine
which sensor has reached the higher voltage first. What we do is
monitor each sensor output i.e. PL3 pins 4 and 5, and see which one reaches
the high voltage first. If they both reach the same voltage at the
same time, then obviously the light is ahead of Cybot. This is a very
simple way of producing an analogue to digital converter, and although not
the best solution, is adequate for this situation.