IR Sensors
Two TypesDiode-Phototransistor Pair
Sharp Sensors
Sharp Sensor
Pros● Easy to useCons● Expensive● Large● Noisy readings
Diode-Phototransistor PairPros● Cheap● Small● More accurateCons● Complex to manage
Example Parts• Diode (Emitter): SFH-4545• Phototransistor (Receiver):
TEFT4300• 10SC010075 SC10 3/4 Nylon
Screw Insulators• I will try to get these in the lab
• Black Thermal Tubing• Prevents IR leakage• Use hot-air gun to shrink
Example Setup: Emitter
MCU
GND
5V
0.1 uF 4.7 uF
How to insulate:1. Cut small piece of
thermal tubing2. Put tubing over
emitter so only tip is exposed
3. Use hot-air gun to shrink tubing
Example Setup: Receiver3.3V
MCU
GND
How to insulate:1. Cut a small piece of the
Nylon Screw Insulator2. Use a SMALL amount of
glue to glue it over the TEFT4300
3. Cover with thermal tubing, same way as previous slide
Example Sensor Layout
Position Correction• Wall-in-front correction
• http://micromouseusa.com/?p=398• Corrects angle and translational position• Use twice at dead end to correct X and Y position
• Post detection• http://micromouseusa.com/?p=828• Corrects translational position while on the move• Must calibrate for each speed
Software Tips• Only turn one on at a time• Turn them on only long enough to get a good
reading• Charge period: ~100 us • Discharge period: ~140 us
• Do post-detection and wall-in-front correction• Subtract ambient noise from sensor reading
Maze AdjustmentsSince the Diode/phototransistor pair reads the intensity of the light, the material of the maze walls will significantly change the readings you get.
For example, UCSD uses wooden walls, while UCLA uses plastic walls. The plastic walls will reflect a lot more light. If your mouse is very stable, you might be able to just multiply all your sensor values by a constant to account for the difference. However, in reality the relationship is not always linear, so it may be necessary to re-calibrate all your sensor values.
It is probably a good idea to multiply all your sensor values by 100 or 1000 from the beginning, then you can adjust it up or down as needed when you run your mouse on a new maze. This makes it so you don't need to use floating point to make small adjustments.