Monday, July 6, 2020

IR Obstacle Detection Module Interfacing with Arduino Uno By Engr.Habib Ur Rehman

IR Obstacle Detection Module 
Interfacing with Arduino Uno
By Engr.Habib Ur Rehman

Components/Equipment Required:

            Following Components/Equipment are required to perform task.

1.    Arduino Uno (https://piees.pk/product/arduino-uno-r3/)

2.    IR Obstacle Detection Module (https://piees.pk/product/ir-obstacle-detection-module/)

4.    Breadboard

5.    Jumper Wires (https://piees.pk/product-category/jumper-wires/)

Circuit Diagram:

Arduino Program:


const int ODSensor=2;

void setup() {               

  pinMode(ODSensor,INPUT);

  pinMode(12, OUTPUT); 

}

void loop() {

  if(digitalRead(ODSensor)==HIGH)     

  {

    digitalWrite(12, LOW);  

  }

  else

  {

    digitalWrite(12, HIGH);   

  }

  delay(100);             

}


No comments:

Post a Comment