Arduino Tutorials – Lesson 12 – IR Sensor control Using Arduino UNO

Creating IR Sensor program using Arduino UNO

Required Components

  1. Infrared sensor-1
  2. Arduino board -1
  3. Connecting cables -1 set

Circuit

Steps

  1. Make sure the components are working properly.
  2. Connect the IR Sensor to the Arduino UNO board.
  3. Connect the Arduino UNO board 2nd pin to the IR Sensor.
  4. Connect IR Sensor board VCC, GND to 5V, GND of Arduino Uno Board.
  5. Check the Cicuit Connections.
  6. Check the Arduino program.
  7. Run the Arduino program.

Arduino Program

int IRPin = 2;
int ledPin=13;
int value;

void setup(  )
{
  pinMode (ledPin,OUTPUT);
  pinMode(IRPin, INPUT);
  Serial.begin(9600);
}
void loop(  )
{
  if (digitalRead (IRPin)==HIGH)
  {
    digitalWrite(ledPin,HIGH);
    Serial.print("Sensor is detect,LED is on");
    delay(100);
  }
  else
  {
    digitalWrite(ledPin,LOW);
    Serial.print("signal is cut,LED is off");
    delay(100);
  }
  value = digitalRead(IRPin);
  Serial.println(value);
}

Usage

  1. Flame Monitors
  2. Radiation Thermometers
  3. Moisture Analyzer
  4. Gas Analyzers
  5. IR Imaging Devices

Leave a Reply

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