robots and eyes v2
Download
Report
Transcript robots and eyes v2
MAKING YOUR ROBOTS SEE
Building and Testing Photosensitive
eyes
3/26/2016
1
Building Photosensitive Eyes
Parts
1.
Two Photo-Resistors
2.
Two 0.1µF Capacitors
3.
Two 220Ω Resistors
3/26/2016
Circuit Building
3/26/2016
Concepts
Resistors
Reduces the flow of current
Photo-resistor
Resistance value varies with change in lighting
condition
Resistance is less in the presence of more light
and more in the absence of less light
Capacitor
3/26/2016
Stores energy
Controls the reaction of the photo-sensor
Programming to Measure
Resistance
RC Time
3/26/2016
Time it take the lower plate of the capacitor to discharge from 5 to
1.4 V. BASIC Stamp I/O pin’s threshold voltage = 1.4v.
voltage depends on R × C, the RC time constant, Tau.
When voltage > 1.4 V, register input = 1, when voltage < 1.4 V,
register input = 0.
Resistor and Capacitor are constant. Photo-resistor value changes
based on light, so the voltage changes.
rctime command measures how long it takes for the voltage to fall
from 5 to 1.4 V.
RC time varies according to the formula:
RC Time Measurements
3/26/2016
Controlling your Robot Based on
RC time
Deadband
A threshold that indicates different lighting (or color) conditions
seen by the resistors
Allows you tell the robot what direction to turn
Following a Black Stripe
3/26/2016
If deadband criteria is not met, just go forward
If deadband criteria is met, then check to see what direction to go
Example: If RC time for left wheel is greater than RC time for right
wheel
Which wheel sees a darker color?
What should the robot do?
Controlling your Robot Based on
RC time
Avoiding a Black Stripe
3/26/2016
If deadband criteria is not met, just go forward
If deadband criteria is met, then check to see what direction to go
Example: If RC time for left wheel is greater than RC time for right
wheel
Which wheel sees a darker color?
What should the robot do?