28125 Parallax Inc, 28125 Datasheet - Page 210

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
How the Photoresistor Circuit Works
A BASIC Stamp I/O pin can function as an output or an input. As an output, the I/O pin
can send a high (5 V) or low (0 V) signal. Up to this point, high and low signals have
been used to turn LED circuits on and off, control servos, and send tones to a speaker.
A BASIC Stamp I/O pin can also function as an input. As an input, the I/O pin does not
apply any voltage to the circuit it is connected to. Instead, it just quietly listens without
any actual effect on the circuit. In the previous chapter, these input registers stored
values that indicated whether or not the whiskers were pressed. For example, the
input register stored a 1 when it sensed 5 V (whisker not pressed), or a 0 when it sensed 0
V (whisker pressed).
An I/O pin set to input doesn't actually need to have 5 V applied to it to make its input
register store a 1. Anything above 1.4 V will make the input register for an I/O pin store
a 1. Likewise, an I/O pin doesn't need 0 V to make its input register store a 0. Any
voltage below 1.4 V will make an input register for an I/O pin store a 0.
When a BASIC Stamp I/O pin is an input, the circuit behaves as though neither the I/O
pin nor 220 Ω resistor is present. Figure 6-4 shows the equivalent circuit. The resistance
of the photoresistor is shown as the letter R. It could be a few Ω if the light is very
bright, or it could be in the neighborhood of 50 kΩ in complete darkness. In a well lit
room with fluorescent ceiling fixtures, the resistance could be as small as a 1 kΩ (full
light exposure) or as large as 25 kΩ (shade cast around most of the object).
As the photoresistor’s resistance changes with light exposure, so does the voltage at Vo;
as R gets larger, Vo gets smaller, and as R gets smaller, Vo gets larger. Vo is what the
BASIC Stamp I/O pin is detecting when it is functioning as an input. If this circuit is
connected to
below 1.4 V,
BASIC Stamp I/O pins are input by default. When a BASIC Stamp program starts, all I/O
pins start as inputs. When you use commands like
the I/O pin is changed from input to output so that the BASIC Stamp can send the high or
low signals.
IN6
IN6
, when the voltage at Vo is above 1.4 V,
will store a 0.
HIGH
IN6
,
LOW
will store a 1. If Vo falls
,
PULSOUT
or
FREQOUT
IN7
,

Related parts for 28125