Sensors - UCLA IEEE Micromouse

advertisement
 We deal with voltage signals
 Sensors convert environment data to electrical signals
 Output: Voltage
 Input: Time/Distance/Whatever
Reading
Move
Receiver
around
Voltage (V)
7
6
5
4
3
2
1
0
0
5
10
15
Distance (cm)
20
Cell Counting
Wall Detection
Accurate Turning
Rotary Encoder
IR LED Sensors
Gyro
*Covered in Meeting #3
Powerpoint
*Covered in Meeting #3 Powerpoint
 Used to measure distance traveled
 Two major flavors
 LED emitter/receiver pair with optically marked disk
 Hall effect sensor with magnetically marked disk
LEDs emit light with luminance dependent on voltage/current.
They work the other way too
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
 One emitter/receiver pair can be used to detect walls in one direction
 Use infrared light to avoid visible ambient light interference
 Sharp sensors
 Model GP2Y0A21YK
 Pre-made and assembled
 Very easy to use, but they are bulky
 Provides single analog output to
use
 Slow response time
 Custom sensors
 Emitter-Receiver pair required
 Can be specially chosen for your needs
 Requires an IR LED Driver circuit:
Darlington Driver IC
 Narrow emission angle is necessary in
LEDs
 Potentially more accurate, but can be
harder to calibrate
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 receiver
Also indicated by “viewing angle”

Power Density
Measures light intensity/solid angle
 In data sheets, often measure in mW/sr
Higher means more light emitter/better

Check datasheet for directivity graphs, which
show intensity vs. angle
This angle should
be small
 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
IR LED emitters and receivers are often sold
together and are wavelength-matched already
This emitter emits most at 940 nm
Receivers also have directivity –
Look for narrow ellipses
This receiver is most sensitive to 950
nm light
 Need at least 3 pairs to detect walls in front
and sides
 4 or more is recommended for calibration
 2 to detect side walls
 2 pointing front to detect front walls and
front wall alignment
 Used to straighten the mouse
Wall Sensor Reading
7
the voltage output of the
receiver
 Read the voltage output with
MCU
 Relate Voltage output with
distance
 LEDs are nonlinear
 Find the relation experimentally
6
Voltage (V)
 Get distance to wall by reading
5
4
3
2
1
0
1
2
3
4
5
6
7
8
9
10
Distance (cm)
11
12
13
14
15
Gyros output angular velocity about a axis
SMD on breakout board style
SMD style
Mouse needs to turn a
certain amount and begins
turning
Gyro reports angular velocity
to MCU
Integrate to get current turn
angle
 Optional, but highly recommended
 Encoders can be used to measure angular velocity instead
 But they are less accurate and susceptible to wheels slipping
 Used to measure rotation of the mouse
 Needs stable power source
 Otherwise, lots of noise generated
Mouse continues turning
until desired turn angle is
achieved
Only need to measure one axis
Analog or digital output: MCU can handle either
 Most important characteristic: Range
 Typically measured in degrees/second
 What range you need depends on how fast
your mouse spins
 +- 1000 degrees/second is plenty
 Analog output:
 When not turning, voltage is half of
maximum
 Turning clockwise/counterclockwise
will change the output
positively/negatively, depending on
specific gyro
 Digital output:
 Uses a serial scheme such as I2C or
SPI
 Same output as analog output, but
numbers are encoded digitally (bits)
For this analog gyro:
Turning counterclockwise
decreases voltage
Turning clockwise
increases voltage
 Gyros measure angular velocity
 Integrate 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
 Relate voltage output summation with angle
 Can be done experimentally
Non-ideality: Gyro drift
 Gyros do not measure angular velocity perfectly
 Integration of the velocity result in an error that
increases linearly over time
 Measure 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 EAGLE
 Hosted by our Projects Manager Julian Brown
 Nov. 14, 6 PM, location TBD
Download