How it works
Before you can write your own programs for Mr. Tidy you need to understand how the sensors work and how
the motors can be controlled.
Front sensors:
Each front sensor consists of 1 infrared LED and two infrared phototransistors. The two phototransistors are
wired in parallel to increase the range. These are analog sensors. As ambient infrared light will affect their
readings the software needs to take two readings.
The first reading is taken with the IR LEDs turned on. This value is a total of both ambient light and light from
the IR LEDs reflecting off nearby objects. The brighter the light, the higher the value.
The second reading is taken with the IR LEDs turned off. This value is the ambient light only. By subtracting
the ambient light value from the total light value you are left with a value equivalent to light reflected by
nearby objects.
You will see in the sample software that a small time delay (IRdelay) is used after the IR LEDs change
states. This is required to get the best results from the phototransistors. This value is set in the constants tab
and can be adjusted if necessary.
Bright sunlight should be avoided as it will result in high ambient light values and reduce the sensitivity of the
sensors.
Side and rear sensors:
The side and rear sensors are similar to the front sensors but have only one phototransistor so their range is
about half that of the front sensors. These are analog sensors but are connected to digital inputs as we only
need to know if an object is within range. Ambient light will affect their range and may even trigger a false
detection if it is very bright.
The side and rear sensors have a visible LED wired in parallel with their IR LED. Unlike the front sensors
these LEDs are individually controlled allowing the visible LEDs to be used to display patterns or the status
of the robot. This does not interfer with object detection which only requires the IR LEDs to be on for very
brief amounts of time.
IR receiver:
The IR receiver is a true digital sensor. Unlike the other IR sensors this sensor is designed to detect IR light
modulated at 38KHz. It does not respond to the overall intensity of the light so ambient light is ignored. As
with the analog sensors, it’s range can be reduced by bright sunlight.
The output of this sensor is normally high. When the receiver detects IR light modulated at 38KHz it’s output
goes low. This sensor is ideal for detecting signals from a universal TV remote or IR navigation beacons. If
two or more robots need to communicate with each other then this sensor could receive data from another
robot that was modulating it’s IR LEDs at 38KHz.
Colour sensing:
This robot uses a Red, Green, Blue (RGB) LED and a Light Dependant Resistor (LDR) to detect colour.
Colour sensing is achieved by shining different colours of light onto an object. By measuring how much of
each colour is reflected back the objects colour can be determined. In the sample software the voltage
across the LDR is measured while shining red, green and then blue light onto the object. The voltage is also
measured with the RGB LED off to get an ambient light reading which is subtracted from the red, green and
blue readings so that the values represent the reflected light only.
The sample software then compares the red, green and blue values to the average value to provide a simple
3 bit result. This is not the most accurate method and should be refined if precise colour matching is
required. As the red, green and blue elements of the RGB LED are driven by PWM outputs the sensor can
be easily calibrated.
13
Summary of Contents for MR. Tidy
Page 3: ...Main board Features 3...