You are on page 1of 3

En.

no:2007042 Cloud Technologies(IT5102)

Practical:13
Aim: Design a small application based on IOT using Arduino or Rasberry pi.

● Title: Interfacing IR Sensor with Arduino to Detect Obstacle.

● Program:
int LED = 13;
intobstaclePin = 8;
inthasObstacle = HIGH;
void setup()
{
pinMode(LED, OUTPUT);
pinMode(obstaclePin, INPUT);
}
void loop()
{
hasObstacle = digitalRead(obstaclePin);
if (hasObstacle == LOW)
{
digitalWrite(LED, HIGH);
}
else
{
digitalWrite(LED, LOW);
}
delay(200);
}
En.no:2007042 Cloud Technologies(IT5102)

● Output:
When Obtacle is detected by IR Transmitter

When an obstacle is not detected by IR Transmitter


En.no:2007042 Cloud Technologies(IT5102)

● For this Practical we will only need the:


1. Arduino Uno
2. IR Sensor.
3. Resistor
4. LED
5. Breadboard
6. Connecting wires

Conclusion: Hence, in this way, I have successfully completed the practical based on,
Design a small application based on IOT using Arduino or Rasberry pi.

K S P A T

You might also like