Download - Micromouse Meeting #4 Lecture #3 Sensors
Micromouse Meeting #4Lecture #3
Sensors
Signals
We deal with voltage signalsSensors convert environment data to electrical signals
Output: Voltage Input: Time/Distance/Whatever
Move Receiver around
0 2 4 6 8 10 12 14 1601234567
Reading
Distance (cm)
Vol
tage
(V
)
Use sensors for:Wall Detection Accurate
TurningCell Counting
*Covered in Meeting #3 Powerpoint
Rotary Encoder
IR LED Sensors
Gyro
High Level Diagram
Used to measure distance traveled
Two major flavorsLED emitter/receiver pair with optically marked diskHall effect sensor with magnetically marked disk
Rotary Encoder*Covered in Meeting #3 Powerpoint
One emitter/receiver pair can be used to detect walls in one direction
Use infrared light to avoid visible ambient light interference
Infrared LED Sensors
Need to know if there are
walls around mouse
Emitter emits light
Light reflects off wall, if
there is a wall
Receiver measures light
intensity
Determine presence of
wall and distance to it
LEDs emit light with luminance dependent on voltage/current.They work the other way too
Sharp sensorsModel GP2Y0A21YK
Pre-made and assembledVery easy to use, but they are bulkyProvides single analog output to useSlow response time
Receiver TypesCustom sensorsEmitter-Receiver pair requiredCan be specially chosen for your
needsRequires an IR LED Driver circuit:
Darlington Driver ICNarrow emission angle is necessary
in LEDsPotentially more accurate, but can be
harder to calibrate
Choosing LED Emitters/Receivers
Two Important Characteristics:
Emission Angle Power Density
How sharp of an angle the LED emits light at
How brightly the LED emits
Look for narrow emission angle Maximizes power efficiency Maximizes signal amplitude received by the
receiverAlso indicated by “viewing angle”
Choosing a LED Emitter
Check datasheet for directivity graphs, which show intensity vs. angle
This angle should be small
Power Density Measures light intensity/solid angle In data sheets, often measure in mW/srHigher means more light emitter/better
Match emitter wavelength with the receiver’s most sensitive wavelength
Receivers also have directivity – minimize this Reduces interference from other IR light
sources Most common wavelengths are 850 nm
and 950 nm Check datasheets for this information
Choosing a LED Receiver
This emitter emits most at 940 nm
This receiver is most sensitive to 950 nm light
IR LED emitters and receivers are often sold together and are wavelength-matched already
Receivers also have directivity – Look for narrow ellipses
Need at least 3 pairs to detect walls in front and sides
4 or more is recommended for calibration2 to detect side walls2 pointing front to detect front walls
and front wall alignmentUsed to straighten the mouse
LED Emitter/Receiver
Get distance to wall by reading the voltage output of the receiver
Read the voltage output with MCU
Relate Voltage output with distanceLEDs are nonlinearFind the relation
experimentally
IR LED Data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 150
1
2
3
4
5
6
7
Wall Sensor Reading
Distance (cm)
Vol
tage
(V
)
Optional, but highly recommendedEncoders can be used to measure angular velocity insteadBut they are less accurate and susceptible to wheels slipping
Used to measure rotation of the mouseNeeds stable power source
Otherwise, lots of noise generated
GyroscopeGyros output angular velocity about a
axis
Mouse needs to turn a certain amount and
begins turningGyro reports angular
velocity to MCUIntegrate to get current
turn angleMouse continues turning until desired turn angle
is achieved
SMD style SMD on breakout board style
Only need to measure one axis
Choosing a Gyro
Analog or digital output: MCU can handle either
Most important characteristic: RangeTypically measured in degrees/secondWhat range you need depends on how
fast your mouse spins+- 1000 degrees/second is plenty
Analog output:When not turning, voltage is half of
maximumTurning clockwise/counterclockwise
will change the output positively/negatively, depending on specific gyro
Digital output:Uses a serial scheme such as I2C or
SPISame output as analog output, but
numbers are encoded digitally (bits)
Gyro Data
For this analog gyro:
Turning clockwise increases voltage
Turning counterclockwise decreases voltage
Gyros measure angular velocityIntegrate angular velocity to get angular position (which is
more useful to know)Gyro output is recorded as discrete samples, so the integration
is a summation
Gyro Data Processing
Relate voltage output summation with angleCan be done experimentally
Gyro Data Processing
Non-ideality: Gyro driftGyros do not measure angular velocity perfectlyIntegration of the velocity result in an error that
increases linearly over timeMeasure the error and subtract it out
We’ll cover how to do this next time
Algorithms!EAGLE tutorial next week
Learn how to design printed circuit boards in EAGLEHosted by our Projects Manager Julian BrownNov. 14, 6 PM, location TBD
Future Things