28129 Parallax Inc, 28129 Datasheet - Page 146

TEXT BASIC ANALOG & DIGITAL

28129

Manufacturer Part Number
28129
Description
TEXT BASIC ANALOG & DIGITAL
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet

Specifications of 28129

Style
Book
Title
Basic Analog and Digital
Contents
Basic Analog and Digital Text
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
Display:
RETURN
The Debug Terminal output should indicate that the output of the voltage divider varies
as the LED gets brighter and dimmer. To get the highest swings in measured voltage, turn
the lights off in the room. The circuit should work fine under normal lighting conditions
as long as no direct light from windows or overhead lamps is hitting the front of the
photoresistor. Use a book or a clipboard between these light sources and the photoresistor
to cast a shadow. If your circuit is in direct sunlight, the differences in output voltage may
be too small to measure.
The voltage divider equation can be used to determine the resistance of the photoresistor.
From Chapter #3, the voltage divider equation is:
R
V
algebra to rearrange the terms; the final result is:
This is one method of using a variable resistor as a sensor. Clearly it can detect different
levels of light, and the ADC0831 handles converting the analog information into digital
information. In the next chapter, we'll introduce another method for measuring variable
resistance that uses significantly less hardware and code.
2
input
DEBUG HOME, "Decimal value to DAC:
DEBUG CR, CR, "DVM Reading:
DEBUG ".", DEC2 v2, "-Volts", CR, CR
is a known resistor value, and R1 is the unknown resistance value of the photoresistor.
is 5 volts, and V
V
R
Output
1
=
R
=
2
V
×
Input
V
V
Output
Input
×
output
R
1
R
+
should be noted from the Debug Terminal. It takes some
2
R
R
2
2
", DEC1 v
", DEC3 n

Related parts for 28129