DEPARTMENT OF BVOC AUTO
EXP NO: Arduino Interfacing with IR Sensor
AIM
Automatically turn the LED ON and OFF using an Arduino with IR Sensor.
COMPONENTS AND EQUIPMENTS REQUIRED
• Arduino uno
• Data cable
• BreadBoard
• IR Sensor
• Connecting wires
• LED (3v)
• Resistor -220ohm
What is IR Sensor
An IR sensor is a device that measures the Infrared radiation in its surroundings and gives an electric
signal as an output. An IR sensor can measure the heat of an object as well as can detect the motion of
the objects. IR technology is used in our day-to-day life and also in industries for different purposes.
For example, TVs use an IR sensor to understand the signals which are transmitted from a remote
control. The main benefits of IR sensors are low power usage, their simple design & their convenient
features. IR signals are not noticeable by the human eye. The IR radiation in the electromagnetic
spectrum can be found in the regions of the visible & microwave. Usually, the wavelengths of these
waves range from 0.7 µm to 1000µm. The IR spectrum can be divided into three regions near-infrared,
mid, and far-infrared. The near IR region’s wavelength ranges from 0.75 – 3µm, the mid-infrared
region’s wavelength ranges from 3 to 6µm & the far IR region’s infrared radiation’s wavelength is
higher than 6µm.
FAROOK COLLEGE
DEPARTMENT OF BVOC AUTO
Infrared LED
The Infrared LED looks the same as a normal LED. But the Infrared LED emits light that is invisible to the naked
eyes. Whenever the electricity is given to the Infrared LED. it emits infrared light.
Infrared Photodiode
The IR photodiode will be black in color as shown in the picture above. Whenever Infrared waves are applied to
the Infrared photodiode, in result the Infrared photodiode changes its resistance, which causes a change in the
output voltages.
CIRCUIT DIAGRAM
FAROOK COLLEGE
DEPARTMENT OF BVOC AUTO
PROGRAM
int LED = 13;
int IRsensor = 10;
void setup()
{
pinMode(LED, OUTPUT);
pinMode(IRsensor, INPUT);
Serial.begin(9600);
}
void loop()
{
If (digitalRead(IRsensor) == LOW)
{
Serial.println(“SOMETHING IS AHEAD!!”);
digitalWrite(LED,HIGH);
}
else
{
Serial.println(“PATH IS CLEAR”);
digitalWrite(LED,LOW);
}
Delay(100);
}
CONNECTIONS
Arduino side IR Sensor Side
5v pin VCC pin of IR Sensor
GND pin GND pin of IR Sensor
Pin 10 OUT pin of IR Sensor
Pin 13 One of the pins of Resistor
GND pin Negative pin of the LED
FAROOK COLLEGE
DEPARTMENT OF BVOC AUTO
PROCEDURE
Step 1: Make connections as per the circuit diagram given above.
Step 2: Open Arduino IDE and type the above code.
Step 3: Using a USB cable, connect your Arduino board to the computer.
Step 4: Select the correct port and the board you are using.
Step 5: Upload the code to the Arduino.
Step 6: The LED will glow when any obstacle detected by the IR Sensor.
RESULT
FAROOK COLLEGE