Specifications
37
Figure 4.16 Sensor mounting on the Robot
There were two main options to communicate between the sensors and the
microcontroller. Either the status wire from the receiver could be connected as an
interrupt to the microcontroller; or it could be connected as a data line to any available
port. Due to the fact that the robots guidance is more interested in knowing the current
status of each of the sensors rather than knowing exactly when each is triggered, using
the data line approach is far more effective. One advantage of this method is that noise
filtering can be used by checking the sensor a number of times to ensure there is
actually an object in front of the sensor and that the signal was not just caused by noise.
After checking the sensors, the robot can make an informed direction on which direction
to travel. Not using interrupts also allows checking of each of the sensors during any
part of the code or in any interrupt service routine.
Each of the sensors is connected to PORT A (pins 0-2). After originally connecting the
wires directly into the port so that when the sensor was active it would read logic zero
and non-activated would read logic one, it was deemed more practical if the data was
inverted. More accurate calculations can be made on this data and the code will be a lot
easier to understand and debug. To invert this data, a HD74lS00P (quad two-input
NAND gate) IC was used with the inputs of each individual NAND tied together to










