KY-032 Obstacle Avoidance Sensor Module with Arduino

Introduction

The KY-032 Obstacle Avoidance Sensor module is an essential electronic component in the field of robotics and automation. This module can detect obstacles and alert the robot or automation system to avoid them. It is a versatile and easy-to-use module that is widely used in a range of electronic projects.

This module is compatible with popular electronic platforms like Arduino, ESP32, Raspberry Pi, and other microcontrollers. that can read the output of a digital signal from Module

Hardware Required

You will require the following Hardware Components for interfacing the KY-032 Obstacle Avoidance Sensor Module with Arduino.

Components#Buy From Amazon
Arduino UNO1Buy Now
KY-032 Obstacle Avoidance Sensor Module1Buy Now
Jumper Wires3Buy Now
Breadboard1Buy Now

What is the Module?

The KY-032 Obstacle Avoidance Sensor module is an electronic component that can detect obstacles and alert the robot or automation system to avoid them. The module is composed of a PCB board, an infrared sensor, a potentiometer, and a few other electronic components. The module can detect obstacles using infrared radiation and output a digital signal that can be read by a microcontroller or other electronic components.

KY-032-Obstacle-Avoidance-Sensor-Module-with-Arduino

Specifications

This module is equipped with a pair of infrared LEDs, including an emitter and a receiver. The emitter sends out pulses of infrared light at a specific frequency, which bounce off obstacles and return to the receiver LED.

The KY-032 module comes with four pins, including GND, +, S (out), and EN. By default, the module is always enabled and detecting obstacles. However, to control the state of the sensor, you can remove the jumper and use the EN pin. A HIGH signal will enable the sensor, while a LOW signal will disable it. You can adjust the detection distance by rotating the left knob, and for maximum distance, turn it to the middle. The right knob controls the frequency of the emitted IR pulse. To ensure the emitter works in tandem with the receiver, turn it clockwise all the way to set the emitter to the required frequency.

Working voltage3.3V – 5V DC
Current Consumption≥ 20mA
Working temperature-10°C – 50°C [14°F – 122°F]
Detection Range2cm – 40cm [0.79in – 15.75in]
IO interface4-wire interface (-/+/S/EN)
Output signalTTL level (low level if obstacle detected, high if no obstacle)
Adjustment methodmulti-turn resistance adjustment
IR pulse frequency38kHz according to HS0038DB datasheet
Effective angle35°
Board Size1.6cm x 4cm [0.62in x 1.57in]

Features

  1. Highly sensitive to obstacles
  2. Adjustable detection range using a Potentiometer
  3. Low power consumption
  4. Easy to integrate with other electronic components
  5. Affordable and widely available

Pinout

KY-032-Obstacle-Avoidance-Sensor-Module-Pinout

Pin Configuration

Pin NamePin Type
+VPositive supply Pin
GGround Pin
A0Analog Pin
D0Digital Pin

Circuit Diagram

The following circuit shows you the connection of the KY-032 Obstacle Avoidance Sensor Module with Arduino Please make the connection carefully

KY-032-Obstacle-Avoidance-Sensor-Module-Interfacing-with-Arduino-Circuit

Circuit Connections

ArduinoModule
+5V+V Pin
GNDGND Pin
A0A0
D0D0

Installing Arduino IDE Software

First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide then click on how to install Arduino Button given Blow

Code

The sensor’s output pin emits a LOW signal when it detects an obstacle, and a HIGH signal when no obstacle is detected or is out of range. In the example below, we’ll activate the LED on pin 13 of the Arduino when the sensor detects an obstacle.

Note that the code is intended to work with the jumper in place, so the sensor is always active. If you wish to control the sensor programmatically, remove the jumper and connect the sensor’s EN pin to pin 2 on the Arduino. Then, uncomment lines 4, 12, and 13 in the code.

//For more Projects: www.arduinocircuit.com
int ledPin = 13;      // LED pin on arduino
int detectorPin = 3;  // obstacle avoidance sensor interface
int val;              // variable to store result
//int enablePin = 2;  // sensor enable interface (EN)
void setup()
{
  pinMode(ledPin, OUTPUT);  // Define LED as output interface
  pinMode(detectorPin, INPUT);  // Define obstacle avoidance sensor as input interface
  
  // [uncomment and remove jumper on module to use enable pin (EN)]
  //pinMode(enablePin, OUTPUT);
  //digitalWrite(enablePin, HIGH);  // Enable sensor
}
void loop()
{
  val = digitalRead(detectorPin); // Read value from sensor
  if(val == LOW) // When the sensor detects an obstacle, the LED on the Arduino lights up
  {
    digitalWrite(ledPin, HIGH);
  }
  else
  {
    digitalWrite(ledPin, LOW);
  }
}

Applications

  1. Robotics
  2. Automation systems
  3. Smart homes and home automation
  4. Industrial automation
  5. DIY electronic projects

Conclusion

The KY-032 Obstacle Avoidance Sensor module is an essential electronic component in the field of robotics and automation. With its ability to detect obstacles and alert the robot or automation system to avoid them, it is a versatile and useful module that is widely used in a range of electronic projects. Whether you’re building a robot, an automation system, or a smart home automation device, the KY-032 Obstacle Avoidance Sensor module is a versatile and easy-to-use component that can help bring your projects to life.

Leave a Comment


error: