Stufin
Home Quick Cart Profile

E18-D80NK Infrared Sensor Module

Buy Now on Stufin

Operating Voltage

3.3-5V

Operating Current

20mA

Detection Range

3-80 cm (1.2-31.5 inches)

Detection Accuracy

1 cm (0.4 inches)

Sensitivity

0.05 lux

Output

Digital (HIGH or LOW)

Output Pin

3-pin interface (VCC, GND, OUT)

Response Time

10ms

Operating Temperature

-20C to 70C (-4F to 158F)

Storage Temperature

-40C to 85C (-40F to 185F)

Applications

  • Obstacle detection in robotics and automation systems
  • Proximity sensing in IoT devices and smart home applications
  • Gesture recognition in gaming and interactive devices
  • Object detection in industrial automation and monitoring systems

Pinout

The sensor module has a 3-pin interface

VCC

Power supply pin (3.3-5V)

GND

Ground pin

OUT

Digital output pin (HIGH or LOW)

Pin Configuration

  • E18-D80NK Infrared Sensor Module Pinout Explanation
  • The E18-D80NK Infrared Sensor Module is a widely used proximity sensor in various IoT applications. It consists of 3 pins, which are explained in detail below:
  • Pin 1: VCC (Power Supply)
  • Function: Provides power to the sensor module
  • Voltage Range: 4.5V to 5.5V (Typical operating voltage: 5V)
  • Current Consumption: Typically around 20mA
  • Connection: Connect to a 5V power supply or a microcontroller's 5V output
  • Pin 2: OUT (Output)
  • Function: Provides the output signal from the sensor module
  • Type: Digital output (TTL logic level)
  • Logic Levels:
  • + High ( Logic 1 ): When the sensor detects an object within the detection range
  • + Low ( Logic 0 ): When the sensor does not detect an object within the detection range
  • Connection: Connect to a microcontroller's digital input pin or a logic level translator (if necessary)
  • Pin 3: GND (Ground)
  • Function: Provides the ground reference for the sensor module
  • Connection: Connect to a common ground point or a microcontroller's GND pin
  • Connection Structure:
  • To connect the E18-D80NK Infrared Sensor Module to a microcontroller or other devices:
  • 1. Power Connection:
  • VCC (Pin 1) 5V Power Supply or Microcontroller's 5V Output
  • GND (Pin 3) Common Ground Point or Microcontroller's GND Pin
  • 2. Signal Connection:
  • OUT (Pin 2) Microcontroller's Digital Input Pin or Logic Level Translator (if necessary)
  • Important Notes:
  • Make sure to use a voltage regulator to regulate the power supply voltage to 5V, if your power source is higher than 5V.
  • Use a pull-up resistor (typically 1k to 10k) between the OUT pin and VCC, if your microcontroller's input pin does not have an internal pull-up resistor.
  • The sensor module has a built-in LED indicator that lights up when an object is detected. You can use this LED as a visual feedback indicator.
  • By following these connection guidelines, you can successfully integrate the E18-D80NK Infrared Sensor Module into your IoT project.

Code Examples

E18-D80NK Infrared Sensor Module Documentation
Overview
The E18-D80NK Infrared Sensor Module is a compact, high-performance IR sensor module designed for obstacle detection, distance measurement, and gesture recognition applications. This module features a high-sensitivity IR receiver and transmitter, enabling accurate detection of objects within a range of 3-80 cm.
Technical Specifications
Operating Voltage: 5V
 Current Consumption: 20mA
 Infrared Frequency: 38 kHz
 Detection Range: 3-80 cm
 Output Signal: Digital (HIGH/LOW)
 Dimension: 20 x 15 mm
Pinout
| Pin | Function |
| --- | --- |
| VCC | Power supply (5V) |
| GND | Ground |
| OUT | Digital output (HIGH/LOW) |
Code Examples
### Example 1: Obstacle Detection using Arduino
This example demonstrates how to use the E18-D80NK Infrared Sensor Module to detect obstacles using an Arduino board.
```cpp
const int sensorPin = 2;  // Connect the OUT pin to digital pin 2 on Arduino
void setup() {
  pinMode(sensorPin, INPUT);
  Serial.begin(9600);
}
void loop() {
  int sensorState = digitalRead(sensorPin);
  if (sensorState == HIGH) {
    Serial.println("Obstacle detected!");
  } else {
    Serial.println("No obstacle detected.");
  }
  delay(50);
}
```
### Example 2: Gesture Recognition using Raspberry Pi (Python)
This example demonstrates how to use the E18-D80NK Infrared Sensor Module to recognize gestures using a Raspberry Pi and Python.
```python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
sensor_pin = 17  # Connect the OUT pin to GPIO 17 on Raspberry Pi
GPIO.setup(sensor_pin, GPIO.IN)
while True:
  sensor_state = GPIO.input(sensor_pin)
  if sensor_state == 1:
    # Gesture 1: Hand wave ( rapid detection and release )
    if GPIO.input(sensor_pin) == 1 and time.time() - last_detection < 0.5:
      print("Gesture 1 detected: Hand wave")
      last_detection = time.time()
  time.sleep(0.05)
```
### Example 3: Distance Measurement using ESP32 (MicroPython)
This example demonstrates how to use the E18-D80NK Infrared Sensor Module to measure distance using an ESP32 board and MicroPython.
```python
import machine
import utime
sensor_pin = machine.Pin(14, machine.Pin.IN)  # Connect the OUT pin to GPIO 14 on ESP32
while True:
  sensor_state = sensor_pin.value()
  if sensor_state == 1:
    # Calculate distance based on pulse width ( duration of HIGH signal )
    duration = utime.ticks_diff(utime.ticks_us(), start_time)
    distance = (duration / 2) / 29  # Convert pulse width to distance (cm)
    print("Distance:", distance, "cm")
  utime.sleep_ms(50)
```
Note: These code examples are provided as a starting point and may require modifications to suit specific application requirements.