
RP6 ROBOT SYSTEM - 2. The RP6 in detail
2.3. Sensors
Most sensors have been mentioned in preceding chapters, but now we will have a
closer look at them.
In the overview diagram you will find sensors outside of the blue-coloured area
“Sensors”. Actually these sensors belong to other modules. However, the odometry
encoders, the motor current sensors and the battery voltage sensor are sensors and
will be discussed in this chapter, too!
2.3.1. Battery Voltage Sensor
Basically this sensor is a simple voltage divider consisting of two resistors in series.
We can assume to have a set of batteries with a maximum voltage of 10V. 6 NiMH
batteries will certainly never exceed this level. The ADC reference voltage, which is
compared to the monitored voltage, is set to 5V. The maximum 5V operating voltage
of the Microcontroller must not be exceeded at any time. For this reason the mon-
itored voltage will have to be divided by 2. To achieve this we use the voltage divider
with two resistors, matching the monitored voltage to the ADC's voltage range.
The ADC measures the voltage at a resolution of 10 Bits (which implies a value range
between 0 and 1023 units), resulting in a voltage resolution of
10V
1024
=
9.765625mV
.
A measurement value of 512 units corresponds to 5V and 1023 to approximately 10V!
These limits are usually not reached with 6 normal NiMH batteries!
The measurement is not too accurate, as we are not using precision resistors. A few
percent tolerance has to be taken into account. The reference voltage is not accurate
as well and may be fluctuating in heavy load conditions. We do not care about these
tolerances, as we only need an indicator for checking the discharging limit of the bat-
teries. If you need to determine the exact voltages, you will need to use a Multimeter
to check the exact voltage values and then add correction values in software.
If you can accept tolerances you may even directly estimate the voltage from the ADC
value: 720 units are corresponding roughly to 7.2V, 700 to 7.0V and 650 to 6.5V. A
value of constantly 560 can be considered as empty batteries.
2.3.2. Light Sensors (LDRs)
At the front side of a small sensor-PCB you may spot two so-
called LDRs (="Light Dependant Resistors"), which are aligned to
the left and to the right respectively. There is a black partition
wall between the two sensors in order to prevent light entering
the “wrong” side of the light sensor system. Just like the Voltage
sensor, both light sensors form a voltage divider together with a
resistor, but here to determine the light intensity. In this case, the 5V rail is divided as
well, but now we have a variable resistor. The division relation will change according
to the surrounding light intensity and provide a light dependant voltage level to one of
the ADC channels!
The voltage difference between both sensors may be used to determine at which side
of the robot the brightest source of light is located: left, right or in the middle. A suit-
able program can trace a bright torch in a
darkened
room or guide the robot to the
- 20 -