How To Use IR Sensor Using Arduino
- TjCreativeTech
- Oct 24, 2020
- 1 min read
Updated: Nov 19, 2020
Hi My Friends! In This Video will show you how to use IR Sensor Using Arduino Nano.
And Blink a LED Using IR Sensor.

Connection

Hardware Required
1.Arduino board
2.A Solderless Breadboard
3.IR Sensor (FC-51)
4.LED
5.Some Jumper Wires
Schematic

Code
void setup()
{
pinMode(2,OUTPUT);
pinMode(3,INPUT);
Serial.begin(9600);
}
void loop()
{
if(digitalRead(3)==LOW)
{
digitalWrite(2,HIGH);
delay(10);
}
else
{
digitalWrite(2,LOW);
delay(10);
}
}
Comments