hIOTron
Created October 27, 2021 © LGPL

Interfacing IR Obstacle Avoidance Sensor with arduino

In this project, we are using E18-D80NK IR Proximity Sensor which we will interface with Arduino.

Interfacing IR Obstacle Avoidance Sensor with arduino

Things used in this project

Hardware components

E18-D80NK IR Sensor
×1
Arduino Nano R3
Arduino Nano R3
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1

Story

Read more

Code

Run a Program

Arduino
const int e18_sensor = 7;
const int led = 2;
void setup() {
  Serial.begin(9600);
  pinMode (e18_sensor, INPUT);
  pinMode (led, INPUT);
}
void loop() {
  int state = digitalRead(e18_sensor);
  Serial.println(state);
  if(state==LOW){
  Serial.println("Object Detected"); 
  digitalWrite(led, HIGH);
  }
  else {
  Serial.println("All Clear"); 
  digitalWrite(led, LOW);
}
delay(1000);
}

Credits

hIOTron
78 projects • 2 followers
hIOTron is an internet of things based company that offers an IoT Platform, products, IoT Solutions, and IoT Training.
Contact

Comments

Please log in or sign up to comment.