Robot Pi Shop

KY-032 4pin IR Infrared Obstacle Avoidance Sensor

$1.50

Shipping calculated at checkout.

Quantity

KY-032 4-Pin IR Infrared Obstacle Avoidance Sensor Module for Arduino & ESP32

The KY-032 Infrared Obstacle Avoidance Sensor Module is a compact, non-contact proximity sensor designed to detect nearby objects using infrared light reflection.

Featuring an infrared transmitter, infrared receiver, and adjustable detection circuitry, the module emits infrared light and detects reflections from objects in front of the sensor. When an obstacle is detected, the module changes its digital output signal, allowing a connected microcontroller to respond.

The KY-032 is ideal for Arduino, ESP32, Raspberry Pi, obstacle-avoiding robots, autonomous vehicles, smart cars, and DIY electronics projects.

Its adjustable detection distance and simple digital interface make it suitable for educational robotics and basic automation applications.

Key Features

  • Model: KY-032
  • Sensor Type: Infrared Obstacle Avoidance Sensor
  • Detection Method: Reflected Infrared Light
  • Operating Voltage: Typically 3.3V–5V DC (Module Dependent)
  • Output Type: Digital (HIGH/LOW)
  • Typical Detection Distance: Approximately 2–40cm, depending on adjustment and conditions
  • Adjustable Detection Sensitivity
  • Adjustable Infrared Transmission Characteristics on Common Versions
  • Infrared Transmitter and Receiver
  • Onboard Detection Indicator LED
  • 4-Pin Interface: VCC, GND, OUT, EN
  • Compact PCB Design
  • Suitable for Arduino, ESP32, and Robotics Projects

Technical Specifications

Parameter Specification
Model KY-032
Product Type Infrared Obstacle Avoidance Sensor Module
Sensor Technology Reflective Infrared
Detection Type Non-Contact Object Detection
Operating Voltage Typically 3.3V–5V DC
Typical Detection Range Approximately 2–40cm
Output Type Digital
Output Logic Typically Active LOW
Infrared Transmitter IR LED
Receiver Infrared Receiver
Adjustment Onboard Potentiometers
Number of Pins 4
Pin Configuration VCC / GND / OUT / EN
Detection Indicator Onboard LED
Board Dimensions Approximately 40 × 16mm (Variant Dependent)
Interface Digital GPIO
Measurement Type Obstacle Presence Detection

Pin Configuration

Pin Function
VCC Power Supply
GND Ground
OUT Digital Obstacle Detection Output
EN Sensor Enable Control

Note: On common KY-032 versions, the EN connection is used to enable or disable infrared transmission. Its logic and default state depend on the module circuit. Some versions use an onboard jumper to keep the sensor enabled.

How It Works

The KY-032 uses reflected infrared light to detect nearby objects.

  1. The infrared LED emits infrared light toward the area in front of the module.
  2. When an object is present, some of the infrared light is reflected toward the receiver.
  3. The detection circuit processes the received signal.
  4. The digital output changes state when an obstacle is detected.
  5. A connected microcontroller can use this signal to stop a motor, change direction, or activate an alarm.

Adjustable Detection

The module commonly includes two adjustable potentiometers:

  • Detection adjustment: Changes the effective detection threshold or range.
  • Infrared transmission adjustment: Changes the transmitter's modulation characteristics on supported versions.

Actual detection performance depends on object color, surface reflectivity, distance, angle, and ambient lighting.

Arduino Connection Example

KY-032 Arduino Uno
VCC 5V
GND GND
OUT D2
EN Leave in the module's default enabled configuration

Before connecting the EN pin, verify the enable logic of the supplied module.

Arduino Example Code

const int sensorPin = 2;

void setup() {
  pinMode(sensorPin, INPUT);
  Serial.begin(9600);
}

void loop() {
  int sensorState = digitalRead(sensorPin);

  if (sensorState == LOW) {
    Serial.println("Obstacle Detected!");
  } else {
    Serial.println("No Obstacle");
  }

  delay(100);
}

This example assumes the common active-LOW output configuration, where the sensor produces a LOW signal when an obstacle is detected.

Applications

  • Obstacle Avoidance Robots
  • Arduino Smart Car Projects
  • ESP32 Robotics
  • Autonomous Mobile Robots
  • Object Presence Detection
  • Basic Collision Avoidance
  • Educational Robotics
  • DIY Automation Systems
  • Interactive Electronics
  • STEM Learning Projects
  • Proximity-Activated Devices

Important Notes

  • The KY-032 is an infrared obstacle detection sensor, not a precision distance measurement sensor.
  • It provides a digital detection signal rather than an exact distance value.
  • The typical 2–40cm detection range is approximate and depends on the module version, adjustments, target surface, and environmental conditions.
  • Dark, transparent, or poorly reflective objects may be more difficult to detect.
  • Strong sunlight and other infrared sources may affect detection performance.
  • The sensor should be positioned and calibrated for the intended application.
  • The onboard potentiometers may require adjustment before reliable obstacle detection is achieved.
  • The EN pin behavior varies between board versions; verify the module's enable configuration before connecting it.
  • For ESP32 and Raspberry Pi, ensure the output signal does not exceed 3.3V.
  • Although some KY-032 modules support 3.3V operation, detection performance may differ from operation at 5V.
  • The module is intended for basic robotics and educational applications, not safety-critical collision prevention.

Package Includes

1 × KY-032 4-Pin Infrared Obstacle Avoidance Sensor Module