know how to bias these
sensors, you need to read the
datasheet. For the newcomer
to the art of datasheet reading,
this can be a daunting prospect
because datasheets might just
as well be written in Klingon for
all the difficulty it can be to
wrestle useful information
from them. Fortunately for us,
the Fairchild Semiconductor
datasheet is very straightforward in telling us what we need to know.
The first graph to look at is the one that tells us
where the device is the most sensitive. Figure 3 gives this
chart. It shows us that 150 mils is optimal (0.15 inches).
The chart gives this data for a 20 mA IF (the current
through the LED) and VCE (voltage used on the sensor) of
5V, which suits us, so we’ll use those values. This chart has
normalized collector current as the Y axis — what is
that? This is a fancy way of saying that if we call the
maximum current 1, then every other point on the curve is
a percentage of that value. We’ll need another chart to tell
us what the typical current would be through the sensor to
set our bias resistor.
Now, how much current should we allow through the
sensor? As usual, that depends. We want to avoid the
maximum values and pick something that is typical or
recommended. We won’t get any direct answers from the
tables here. All we have to work with are maximum values
for certain chosen settings. However, in the Electrical/
Optical Characteristics table of the datasheet, we find the
information shown in Figure 4.
This information shows us that if we put 40 mA
through the LED and had no resistor limiting current,
and used 5V to power the device that we should get a
maximum of 0.60 mA (600 microamps) current through the
device. Further, it tells us that the saturation voltage from
the collector to the Emitter would be 0.4V. This means that
whatever we use as a dropping resistor would have about
5V – 0.4V = 4.6V across
it. That’s a pretty good
logical ‘1.’ I like to
connect the bias resistor
from Vcc (5V to the
collector of a transistor)
so that when the sensor
is fully on, I read a logic
‘0’ and when it is off, I
read a logic ‘1.’ A voltage
of 0.4V will read a logic
‘0’ very nicely on our
microcontrollers so no
ADC (Analog-to-Digital)
reading is needed; we
can just use a digital
input line. We’re only
going to be driving the IR
Figure 2. QRB-1134
reflection sensor.
Figure 3. How close should we be?
(Used with permission from Fairchild Semiconductor.)
LED at 20 mA, so let’s estimate that our fully on current
would be a minimum of 100 μA (half of that seen at 40
mA of LED current). Since I like to use worst case, let’s use
100 μA as the current for that worst case. If we were to be
fully turned on with all of these settings, what resistor value
would give us 100 μA if the sensor transistor was dropping
0.4V across it? The answer is:
(5V – 0.4V)/100 μA = 46000, or 46K ohms
That isn’t a very common value, so let’s choose 47K
ohms from our junk box.
We’ve decided that we want an LED current of 20 mA.
How do we choose the resistor value for that current?
Again, we look at a chart. In this case, we will use the
Electrical/Optical Characteristics table again, but the
section shown in Figure 5. This shows us that at 20 mA,
our LED will drop a maximum of 1.7V across it. So, our
resistor value needs to be:
(5V – 1.7V)/20 mA = 165 ohms
We have now used the charts and tables from a
datasheet to decide upon reasonable and predictable values
Figure 4. Excerpted table information for sensor current.
(Used with permission from Fairchild Semiconductor.)
Figure 5. IR LED current information. (Used with permission from Fairchild Semiconductor.)
SERVO 06.2008 15