Introduction: Project on E18-D80NK IR Proximity Sensor With Arduino
Infrared sensors are electronic device that can be utilized to determine the exterior appearance emitting or detecting infrared radiation. IR sensors can also detect motion and detect the quantity of heat that is released by the object. They are typically used in intruder alarms lights, and other industrial and home automation applications. We've used IR sensors in a variety of projects. However, these IR sensors aren't able to be placed in direct sunlight since the sun also emits IR waves. There's only one universal solution to this problem Modify your IR signal to allow your device to detect an IR variation instead of the fixed IR level.
In this guide we will connect the E18-D80NK Proximity Sensor with Arduino. The E18-D80NK sensor is a modern inexpensive IR Proximity Sensor equipped with obstruction detection area of 3cm to 80 centimeters. The use of a modulated IR signal shields the sensor from interference generated by normal light from the light bulb or sunlight.
Supplies
Step 1: E18-D80NK IR Obstacle Avoidance Proximity Sensor
E18D80NK Infrared Obstacle Avoidance Sensor cost-effective IR Proximity Sensor that has an adjustable range of 3cm to 80 centimeters. The E18-D80 sensor includes IR Transmitter as well as IR receiver all in one unit. The IR transmitter emits a modulated IR signal that is then reflected back by objects in the path of reflection and then interpreted from the receiver. The sensor is less affected from sunlight due to its altered IR light.
The E18-D80 IR Sensor is extensively utilized in robots to stay clear of obstacles and industrial assembly lines, Reverse Car Parking and numerous other applications that require automation. The range of detection can be altered depending on the purpose of use by via the multi-turn screw that is located on the rear of the device. The output of the switching signal changes depending on an obstacle's detection. It stays high when there aren't obstacles are detected, and decreases in the event of obstacles. The probe has a red light positioned behind the probe and it will turn high when it detects an obstacle. The E18 sensor runs on 5V and can consume 5mA-30mA of current, without burden.
Step 2: Specifications & Features
- Input voltage: 5V DC
- Current consumption: >25mA (min) > 100mA (max)
- Dimension: 1.7cm (diameter) x 4.5cm (length)
- Cable length: 45cm
- Detection of objects: transparent or Opaque
- Diffuse reflective type
- Sensing range: 3cm-80cm (depends on the surface of the obstacle)
- NPN output (normally high)
- Environment temperature: -25 degC ~ 55 degC
Step 3: Circuit Diagram for Interfacing E18-D80NK Sensor With Arduino
Full diagram of Interfacing the E18-D80NK proximity sensor to Arduino is provided below:
The connection to interface the E18-D80NK IR Sensor to Arduino is easy to do connecting to the Brown wire of the sensor to Arduino 5V Pin, then connect the blue wire of the sensor to Arduino's Ground. connect the black pin of the sensor to the digital pin 7 of Arduino Nano.
Step 4: Programming
The code to interface E18-D80NK the IR sensor with Arduino is about as easy as it is. The entire Arduino code for the IR sensor is provided in the last paragraph of this document. The description of the code is as follows:
Begin by creating all the pins needed which are needed to read sensor's information in order to control and regulate the light.
const int e18_sensor = 7;
const int led = 6;
In the setting() function start the serial monitor with 9600 to allow debugging. Also assign the sensor pin to be input, while the LED pin as the output.
void setup() {
Serial.begin(9600);
pinMode (e18_sensor, INPUT);
pinMode (led, INPUT);
}
Then within loop(), inside the loop()function read the sensor's pin using the digitalRead() and when the state of the pin is low then turn on the LED, if not shut off the lights.
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);
}
Step 5: Testing the E18-D80NK IR Sensor
When your hardware and code are set and you are ready to connect the Arduino to your laptop and upload your code. Then, open the serial monitor with a baud rate of around 9600, and move some motions on the sensor's front. Look at the Serial monitor and LED.





