Microchip Technology PICDEM Mechatronics Demo Board DM163029 DM163029 User Manual

Product codes
DM163029
Page of 64
PICDEM
TM
 Mechatronics Demo Board User’s Guide
DS51557C-page 24
©
 2006 Microchip Technology Inc.
FIGURE 2-5:
PROJECT 2: SCHEMATIC
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.
PIC16F917
V
DD
C1-
V
SS
RD7
V
DD
1 k
Ω
 
R31
270 
Ω
 
R36
30
11/32
2
12/31
D0
1 k
Ω
 
R10
C1+
POT1
10 k
Ω
 
V
DD
7
6
4
V
DD
V
DD
GND
V
BAT
5
C24
0.1
μ
F
TSL251RD
Light Sensor