Object Detection using IR Sensor Program with Component Connection

Objective:

         To detect the objects using IR sensor.

Components Required

  • Arduino Uno
  • Infra Red Sensor

Connection Diagram

Program

int sensorPin = 3;

int sensorValue = 0;

void setup()

{

pinMode(sensorPin, INPUT);

Serial.begin(9600);

}

void loop()

{

sensorValue = digitalRead(sensorPin);

if(sensorValue==HIGH)

{

Serial.println(“Object Detected”);

}

else

{

Serial.println(“Object not Detected”);

}

}

Working

         The output of the IR sensor is accessed by the Arduino Uno and displayed. Whenever the IR sensor detects the objects it produces HIGH voltage and If there is no objects detected it produces LOW voltage.

 Output

The output value is : 1 (when object present)

The output value is : 0 (when object not present)

Buzzer Siren using Arduino Uno Program with Connection Diagram
LDR sensor Interfacing with Arduino Uno Program with Component Connection

Leave a Reply

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

Navigation

My Cart

Close
Viewed

Recently Viewed

Close

Great to see you here !

Your personal data will be used to support your experience throughout this website, to manage access to your account, and for other purposes described in our privacy policy.

Already got an account?

Quickview

Close

Categories