28123 Parallax Inc, 28123 Datasheet - Page 198

TEXT WHAT'S A MICROCONTROLLER

28123

Manufacturer Part Number
28123
Description
TEXT WHAT'S A MICROCONTROLLER
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet

Specifications of 28123

Style
Book
Title
What's a Microcontroller?
Contents
Whats a Microcontroller? Text
Product
Microcontroller Accessories
Core Processor
PIC16C57c
Flash
128 Bytes
Operating Supply Voltage
9 V
Board Size
31 mm x 16 mm
Lead Free Status / RoHS Status
Not applicable / Not applicable
As with a potentiometer, you can use a photoresistor in an RC-time circuit. The program
to read the photoresistor is also about the same as the one used to read the potentiometer.
Even though the programming is the same, light is very different from rotation or
position. The activities in this chapter focus on applications that use light (instead of
position) to give the microcontroller information.
programming techniques will be introduced that will help you with long term data
storage, and with making your programs more manageable and readable.
ACTIVITY #1: BUILDING AND TESTING THE LIGHT METER
In this activity, you will build and test an RC-time circuit that reads the value of a
photoresistor. The RC-time measurement will give you an idea of the light levels sensed
by the photoresistor’s light collecting surface. As with the potentiometer test, the time
values measured by the
Light Detector Test Parts
(1) Photoresistor
(1) Resistor – 220 Ω (red-red-brown)
(1) Capacitor – 0.01 µF
(1) Capacitor – 0.1 µF
(1) Jumper wire
Building the RC Time Circuit with a Photoresistor
Figure 7-2 shows a schematic of the RC-time circuit you will use in this chapter, and
Figure 7-3 shows the wiring diagram. This circuit is different from the potentiometer
circuit from Chapter #5, Activity #3 in two ways. First, the I/O pin used to measure the
Although there are two capacitors in the list of parts, you will only use one capacitor in
the circuit at any given time.
RCTIME
command will be displayed in the Debug Terminal.
Figure 7-1
Photoresistor Schematic and
Part Drawing.
The photoresistor’s cadmium
sulfide coated light collecting
surface is shown at the top of
the part’s drawing.
Along the way, some PBASIC

Related parts for 28123