fbpx

Interface IR Distance Sensor with Arduino Uno

Infrared sensors find numerous applications in electronic systems.

  • IR sensor have two part IR transmitter and receiver.
  • The IR receiver detects the IR radiations transmitted by an IR LED.
  • The output voltage level of this IR sensor depends upon the intensity of IR rays received by the receiver.
  • The sensors output in its original analog form.
  • The output of IR sensor is processing through ADC.
  • The ADC is calibrated to get almost accurate distance measurement.

Application

  • Weather Monitoring System.
  • Manufacturing Industry.

Hardware Required

  • IR Sensor.
  • Arduino.

Pin Diagram

  • VCC: +5v.
  • OutPut: Analog Output.
  • GND: GND.

Circuit

Code

 int LED=13;
 int senRead=A0;
 int limit=970;
 void setup()
 {
 Serial.begin(9600);
 }
 void loop()
 {
 int val=analogRead(senRead);
 Serial.println(val);
 if(val<limit)
 {
 digitalWrite(LED,HIGH);
 }
 else
 {
 digitalWrite(LED,LOW);
 }
 } 

Leave a Reply

Your email address will not be published. Required fields are marked *