Ashish
Published © CC BY

Interfacing E18-D80NK IR Proximity Sensor with Arduino

The E18-D80NK is an advanced low-cost IR Proximity Sensor with an obstacle detection range of 3 cm to 80 cm.

IntermediateProtip2 hours10,059
Interfacing E18-D80NK IR Proximity Sensor with Arduino

Things used in this project

Hardware components

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

Story

Read more

Schematics

Circuit Diagram for Interfacing E18-D80NK Sensor with Arduino

Code

Code snippet #2

Plain text
void setup() {
  Serial.begin(9600);
  pinMode (e18_sensor, INPUT);
  pinMode (led, INPUT);
}

Code snippet #3

Plain text
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);
}

Credits

Ashish

Ashish

1 project • 3 followers

Comments