28125 Parallax Inc, 28125 Datasheet - Page 337

TEXT ROBOTICS

28125

Manufacturer Part Number
28125
Description
TEXT ROBOTICS
Manufacturer
Parallax Inc
Datasheet

Specifications of 28125

Title
Robotics with the Boe-Bot
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
Calibrating Using a Linear Approximation
The photoresistor is often referred to as a non-linear device. In other words, if it returns
one measurement at one brightness, that doesn’t mean that the measurement will be five
times as large when the light is five times as bright. The math is more complicated and
involves logarithms. However, in cases where the measurements are confined over a
narrow range of the sensors overall detection abilities, the sensor can be treated like it’s a
linear device. You can take a couple of measurements, and then figure out how the
device will react if other measurements in its range could be plotted in a straight line.
The technique is called linear approximation.
Another thing you can do with linear devices is assume the difference between the two
lines can also be plotted as a line. In fact, if you have one linear device that has larger
measurements than the other for ambient and low light, you can use a linear
approximation for making the sensors return approximately the same values for the same
light levels. For every reading from one sensor, (we’ll call that one x), you can multiply
it by a scale factor (m), and add it to a constant (b) to get a value in the same range the
other sensor would report (y).
Here is an example of how to get the values of m and b to match the left photoresistor
circuit to the right. First, assign X
to the right photoresistor values.
mismatched photoresistors. Your values will be different.
Now, solve for m and b using two equations in two unknowns. One of the simpler
approaches is to write two y = mx + b equations, one in terms of X
in terms of X
m.
y
Duration Values
timeLeft
X
X
=
1
2
mx
= 36
= 152
2
and Y
+
b
2
Table F-2:
. Then, subtract one from the other to eliminate b. Then, solve for
timeRight
Y
Y
1
2
= 56
= 215
RC-Time Measurements in Ambient and Low Light
1
Description
Photoresistors in uniform ambient light
Photoresistors in uniform low light
and X
(Table F-2) shows some example values for
2
to the left photoresistor values and Y
1
and Y
1
and the other
1
and Y
2

Related parts for 28125