infrared distance detection

5
Infrared Distance Detection

Upload: gtj890

Post on 10-Apr-2018

224 views

Category:

Documents


0 download

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

8/8/2019 Infrared Distance Detection

http://slidepdf.com/reader/full/infrared-distance-detection 5/5