infrared distance detection
TRANSCRIPT
8/8/2019 Infrared Distance Detection
http://slidepdf.com/reader/full/infrared-distance-detection 1/5
Infrared Distance
Detection
8/8/2019 Infrared Distance Detection
http://slidepdf.com/reader/full/infrared-distance-detection 2/5
BackgroundO Use IR LED and IR Phototransistor pair as a
sensor similar to RADAR
O IR Phototransistor responds best to aparticular frequency of IR light
8/8/2019 Infrared Distance Detection
http://slidepdf.com/reader/full/infrared-distance-detection 3/5
Arduino Frequency
WorkaroundO Generate a square wave:
O Output HIGH
O DelayO Output LOW
O Delay
O Frequency of 38.5KHz
O Pulse time of 1 millisecond
O Then read IR phototransistor
8/8/2019 Infrared Distance Detection
http://slidepdf.com/reader/full/infrared-distance-detection 4/5
O Motor Pins
O Right Forward – 9
O Left Forward–
7
O Right Back – 8
O Left Back - 6
O Useful Commands
O pinMode( pin#, INPUT/OUTPUT )
O delay( # in ms )
O
delayMicroseconds( # in μs )O analogWrite( pin#, 0-255 )
O digitalWrite( pin#, HIGH/LOW )
O digitalRead( pin# )
IR Circuit Schematic