Download PICDEM Mechatronics Demonstration Board User's Guide

Transcript
PICDEMTM Mechatronics Demo Board User’s Guide
FIGURE 2-5:
PROJECT 2: SCHEMATIC
VDD
PIC16F917
VDD
11/32
Light Sensor
C24
0.1 μF
6 VDD
4
VBAT 7
GND
R31
1 kΩ
VDD
2 C1-
RD7 30
5 C1+
VSS
TSL251RD
VDD
POT1
10 kΩ
12/31
R36
270 Ω
D0
R10
1 kΩ
Instructions
Provide a light source for the light sensor and set Potentiometer 1 to the desired trip
point. Block the light source and LED1 should turn on. Experiment with the set point
and the amount to which you block the light from the sensor. Move your hand slowly in
front of the sensor and note that the LED does not flicker. This demonstrates how
software hysteresis prevents the output of the comparator from chattering near the trip
point.
Discussion
Comparators are found in many PIC microcontrollers due to the versatility and low cost
they offer the user. As you can see, the comparator is one of the more easily used
peripherals. Refer to the Comparator Tips ‘n Tricks pamphlet included on the CD in this
kit for more information on comparators.
DS51557D-page 24
© 2007 Microchip Technology Inc.