Proteus Simulation for IR Proximity Sensor module with Arduino

Proteus Simulation  for IR Proximity Sensor module with Arduino 

// Interfacing Infrared Proximity sensor Module with Arduino
void setup()
{
  pinMode(12,OUTPUT);//connect LED to Digital Pin 12 of Arduno
  pinMode(3,INPUT);// connect OUTPUT pin of  IR Sensor to Digital Pin 3 of Arduino
  Serial.begin(9600);
}
void loop()
{
  if (digitalRead(3)== HIGH )//  (if any obstruction in front of IR sensor-Output will go HIGH)
  {
    digitalWrite(12,HIGH);// Turn on the LED
    
    delay(10);
  }
  else 
  {
    
    digitalWrite(12,LOW);// else ,Turn OFF the LED
    delay(10);
    
  }
  
}


 

Comments

Popular posts from this blog

4 Stage Timer With DS3231RTC Module.

Interfacing KY038 sound sensor with Raspberry pi Pico

Interfacing MQ2 Gas & Smoke Sensor With Raspberry Pi Pico