28128 Parallax Inc, 28128 Datasheet - Page 146

no-image

28128

Manufacturer Part Number
28128
Description
KIT BASIC ANALOG/DIGI PARTS ONLY
Manufacturer
Parallax Inc
Datasheet

Specifications of 28128

Accessory Type
ADC, DAC
Product
Microcontroller Accessories
For Use With/related Products
BASIC Stamp® 2 and Board of Education
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
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 28128