IR Obstacle Avoidance Sensor Module – 3 Pin (Blue PCB)
1. What Is an IR Obstacle Avoidance Sensor Module?
The IR Obstacle Avoidance Sensor Module is a compact infrared detection sensor designed to detect nearby objects without requiring physical contact.
It uses an infrared transmitter and receiver pair to identify obstacles by detecting reflected infrared light.
The module features an onboard LM393 comparator, adjustable potentiometer, digital output and indicator LEDs.
Its three-pin interface makes it suitable for Arduino, ESP32, robotics and other compatible microcontroller-based projects.
The blue PCB version is especially useful for obstacle-avoiding robots, object detection systems, proximity switches and educational electronics experiments.
2. What Can You Build With an IR Obstacle Avoidance Sensor Module?
This infrared sensor is suitable for projects such as:
- Obstacle-avoiding robots
- Arduino obstacle detection systems
- Smart robotic cars
- Contactless object detection
- IR proximity switches
- Automatic object counters
- Conveyor belt object detection prototypes
- Robotics navigation experiments
- Touch-free electronic switches
- Automatic parking demonstration models
- Sensor-based warning indicators
- Educational STEM and engineering projects
The module is particularly useful when a project needs to detect whether an object is within an adjustable sensing region.
3. Who Is It For?
The IR Obstacle Avoidance Sensor Module is suitable for:
- Beginners learning electronics
- School and college students
- Engineering students
- Arduino and ESP32 enthusiasts
- Robotics hobbyists
- IoT project developers
- STEM educators and trainers
- DIY electronics makers
It helps students understand infrared sensing, reflected light, voltage comparators, digital outputs and basic robot obstacle detection.
4. How Does an IR Obstacle Avoidance Sensor Work?
The IR Obstacle Avoidance Sensor Module operates using reflected infrared light.
It contains two main optical components:
Infrared Transmitter: Emits infrared light towards objects in front of the sensor.
Infrared Receiver: Detects infrared light reflected by nearby objects.
When an object reflects sufficient infrared light towards the receiver, the sensor circuitry responds to the reflected signal.
The onboard LM393 comparator evaluates the signal against a threshold configured by the adjustable potentiometer.
Working principle:
IR Transmitter → Infrared Light → Nearby Object → Reflected Infrared Light → IR Receiver → LM393 Comparator → Digital Output
Digital Output (OUT)
The OUT pin provides a digital signal indicating whether the comparator’s obstacle detection condition has been met.
On many modules of this design:
- LOW indicates an obstacle has been detected.
- HIGH indicates no obstacle has been detected.
Verify the output polarity of your particular module before integrating it into a project.
Adjustable Potentiometer
The blue potentiometer allows users to adjust the comparator’s obstacle detection threshold.
Changing the threshold can affect the effective sensing distance under the same operating conditions.
It does not turn the module into an accurate distance measurement sensor.
5. Technical Specifications
| Specification | Details |
|---|---|
| Product Type | Infrared Obstacle Detection Sensor Module |
| Module Marking | MH-B |
| PCB Colour | Blue |
| Sensing Technology | Reflective infrared detection |
| Infrared Transmitter | Present |
| Infrared Receiver | Present |
| Comparator IC | LM393 |
| Typical Operating Voltage | 3.3–5V DC |
| Output Type | Digital |
| Output Pin | OUT |
| Typical Output Logic | Active LOW on obstacle detection |
| Adjustable Potentiometer | Yes |
| Detection Threshold | Adjustable |
| Typical Reference Detection Range | Approximately 2–30cm |
| Onboard Indicators | Power and output LEDs |
| Number of Pins | 3 |
| Pin Labels | OUT, GND, VCC |
| Mounting | PCB mounting hole |
| Application | Obstacle detection and proximity sensing |
Important Technical Notes
- Detection distance depends on object reflectivity, colour, size and orientation.
- Dark, matte surfaces may reflect less infrared light than light-coloured surfaces.
- Direct sunlight and other infrared light sources can affect performance.
- The module provides an ON/OFF detection signal, not a calibrated distance measurement.
- The blue potentiometer adjusts the detection threshold.
- The typical range and voltage figures should be verified against the actual supplied batch.
6. IR Obstacle Avoidance Sensor Pinout
The IR Obstacle Avoidance Sensor Module has three electrical terminals.
| Pin | Function |
|---|---|
| OUT | Digital obstacle detection output |
| GND | Ground connection |
| VCC | Positive power supply |
When viewing the component side of the module with the IR transmitter and receiver at the top and the connection pins facing downward, the pin order from left to right is:
OUT → GND → VCC
This orientation corresponds to the printed labels on your MH-B PCB.
For basic obstacle detection, connect OUT to a compatible microcontroller digital input.
7. How to Connect an IR Obstacle Avoidance Sensor to Arduino
The IR Obstacle Avoidance Sensor Module can be connected to Arduino Uno using three jumper wires.
Required Components
- 1 × IR Obstacle Avoidance Sensor Module
- 1 × Arduino Uno
- Jumper wires
- Suitable 5V power supply
Arduino Wiring Connections
| IR Sensor Pin | Arduino Uno |
|---|---|
| OUT | Digital Pin D2 |
| GND | GND |
| VCC | 5V |
Connection Procedure
- Connect the sensor OUT pin to Arduino D2.
- Connect the sensor GND pin to Arduino GND.
- Connect the sensor VCC pin to Arduino 5V.
- Power the Arduino board.
- Place an object in front of the infrared transmitter and receiver.
- Observe the onboard detection indicator.
- Adjust the potentiometer if necessary to achieve reliable detection.
Begin testing with a light-coloured object at a short distance.
8. Arduino Example Code
The following program reads the digital output of the IR Obstacle Avoidance Sensor Module and displays the obstacle detection status in the Arduino Serial Monitor.
const int irSensorPin = 2;
// Typical LM393 IR module uses active LOW.
const int obstacleDetectedState = LOW;
void setup() {
pinMode(irSensorPin, INPUT);
Serial.begin(9600);
}
void loop() {
int sensorState = digitalRead(irSensorPin);
if (sensorState == obstacleDetectedState) {
Serial.println("Obstacle Detected");
} else {
Serial.println("No Obstacle Detected");
}
delay(100);
}
How to Test the Sensor
- Connect the module to Arduino.
- Upload the program using Arduino IDE.
- Open the Serial Monitor at 9600 baud.
- Place an object in front of the sensor.
- Observe the detection message.
- Remove the object and observe the change.
- Adjust the potentiometer until the output switches at the desired position.
If the messages are reversed, verify the actual output polarity and change the obstacleDetectedState setting accordingly.
9. Beginner Project: IR Obstacle Detection Alarm
Build a simple obstacle detection alert system using the IR Obstacle Avoidance Sensor Module and an Arduino Uno.
Components Required
- 1 × IR Obstacle Avoidance Sensor Module
- 1 × Arduino Uno
- 1 × 5mm Red LED
- 1 × 330Ω Resistor
- Breadboard
- Jumper wires
Wiring Connections
| Component | Arduino Uno |
|---|---|
| IR Sensor VCC | 5V |
| IR Sensor GND | GND |
| IR Sensor OUT | D2 |
| Red LED Anode | D8 through a 330Ω resistor |
| Red LED Cathode | GND |
Arduino Code
const int irSensorPin = 2;
const int ledPin = 8;
// Adjust if your sensor uses opposite polarity.
const int obstacleDetectedState = LOW;
void setup() {
pinMode(irSensorPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
int sensorValue = digitalRead(irSensorPin);
if (sensorValue == obstacleDetectedState) {
digitalWrite(ledPin, HIGH);
Serial.println("Warning: Obstacle Detected");
} else {
digitalWrite(ledPin, LOW);
Serial.println("Path Clear");
}
delay(100);
}
Project Working
- The infrared transmitter continuously emits infrared light.
- When a nearby object reflects enough light, the sensor output changes.
- The Arduino detects the digital signal.
- The red LED turns ON when an obstacle is detected.
- When the object moves away, the LED turns OFF.
This project teaches digital inputs, infrared sensing, conditional programming and output control.
Advanced Project Idea
You can extend this project into an obstacle-avoiding robot using:
- Arduino Uno or Nano
- Two BO geared motors
- Two 65mm BO motor wheels
- Motor driver module
- Battery pack
- Robot chassis
- IR Obstacle Avoidance Sensor Module
The Arduino can monitor the IR sensor and use a motor driver to stop or change the robot’s direction when an obstacle is detected.
This single sensor detects objects within its sensing region; it does not provide complete environmental mapping or precise distance measurements.
10. Related Products
Complete your electronics project with these Yagobotix components:
- Arduino Uno R3 Compatible Programmable Board
- ESP32 Development Board
- BO Motor Dual Shaft
- 65mm BO Motor Wheel
- Motor Driver Module
- 5mm Red LED
- 5mm Green LED
- 5mm LED Assorted Pack of 5
- 5V Passive Buzzer
- LM393 LDR Light Sensor Module
- Flame Sensor Module
- SW-420 Vibration Sensor Module
- Breadboard
- Jumper Wires
- Resistors
11. Related Tutorials
Explore these electronics learning topics:
- How to Use an IR Obstacle Avoidance Sensor with Arduino
- How to Build an Obstacle-Avoiding Robot
- How to Connect an IR Sensor to ESP32
- How Does an Infrared Proximity Sensor Work?
- Understanding IR Transmitters and Receivers
- How to Adjust IR Sensor Detection Distance
- IR Obstacle Sensor vs Ultrasonic Sensor
- How to Build an IR Object Counter
- How to Connect an IR Sensor to Arduino Nano
- How to Build a Sensor-Based Robot Alarm
12. Frequently Asked Questions
What is an IR Obstacle Avoidance Sensor Module?
It is an electronic sensor module that detects nearby objects using reflected infrared light.
How does the IR obstacle sensor work?
An infrared transmitter emits IR light towards an object. The receiver detects reflected infrared light, and a comparator circuit produces a digital signal.
What is the operating voltage of this module?
Comparable LM393-based IR obstacle sensor modules commonly operate at 3.3–5V DC.
Does the sensor have an adjustable potentiometer?
Yes. The blue PCB version includes an onboard potentiometer for adjusting the obstacle detection threshold.
What is the detection range of the sensor?
Comparable modules commonly advertise approximately 2–30cm under suitable conditions. Actual distance depends on the object, lighting and adjustment.
Can this sensor measure the exact distance of an object?
No. It provides threshold-based obstacle detection rather than a calibrated distance measurement.
Does this sensor provide analog output?
No. The supplied three-pin MH-B module has a digital OUT connection.
What happens when an obstacle is detected?
On many modules of this type, the OUT pin changes to LOW and the detection indicator LED activates.
Can I use this sensor with Arduino Uno?
Yes. The sensor can be connected to Arduino using VCC, GND and a digital input pin.
Can I use this IR sensor with ESP32?
Yes, provided the supply and digital output levels are compatible with ESP32’s 3.3V GPIO pins.
Can this module detect black objects?
It may detect black objects, but detection distance is often reduced because dark surfaces can absorb more infrared light.
Does the sensor work in darkness?
Yes. It uses its own infrared transmitter, although environmental conditions can still affect detection performance.
Can sunlight affect the sensor?
Yes. Strong ambient infrared light, including sunlight, can interfere with detection.
Can I build an obstacle-avoiding robot with this sensor?
Yes. It can provide obstacle detection input to a microcontroller controlling the robot’s motors.
Is this sensor the same as an ultrasonic distance sensor?
No. An IR obstacle sensor uses reflected infrared light, while an ultrasonic sensor measures reflected sound-wave timing.
Can this sensor be used for line-following robots?
It can be used in certain reflectivity-based experiments, but dedicated downward-facing line tracking sensors are generally better suited to following lines accurately.
Does this module include a potentiometer and indicator LEDs?
Yes. Your blue PCB version has an adjustable potentiometer and two indicator LEDs.
Where can I buy an IR Obstacle Avoidance Sensor Module in Surat?
You can buy the IR Obstacle Avoidance Sensor Module online from Yagobotix with same-day delivery and pickup available in Surat.
13. What Is Included?
- 1 × IR Obstacle Avoidance Sensor Module – 3 Pin, Blue PCB
The assembled module includes:
- Infrared transmitter
- Infrared receiver
- LM393 comparator circuit
- Adjustable potentiometer
- Onboard indicator LEDs
- Three-pin connection header
Arduino boards, jumper wires, motors, breadboards and other accessories are not included.
14. Compatibility
The IR Obstacle Avoidance Sensor Module can be used in suitable projects involving:
- Arduino Uno
- Arduino Nano
- Arduino Mega
- ESP32 Development Boards
- ESP8266 NodeMCU
- Raspberry Pi
- STM32 Development Boards
- Other compatible microcontrollers
- Custom robotics control circuits
For Arduino Uno, the sensor can typically be connected to a 5V supply and digital GPIO input.
For ESP32, ESP8266 or Raspberry Pi, verify that the output voltage does not exceed the GPIO input rating. Use a supported supply voltage or suitable level shifting when necessary.
The sensor is not designed to measure calibrated distances or replace safety-rated collision detection systems.
15. Buy IR Obstacle Avoidance Sensor Module Online in India
Build smarter robotics and automation projects with the IR Obstacle Avoidance Sensor Module – 3 Pin (Blue PCB) from Yagobotix.
Featuring infrared object detection, an onboard LM393 comparator, an adjustable potentiometer and a digital output interface, this module is ideal for Arduino, ESP32, obstacle-avoiding robots and educational electronics projects.
Whether you are developing a robotic car, building an object detection alarm or experimenting with contactless sensing, this module provides a convenient way to detect nearby obstacles.
Why Choose Yagobotix?
- Compact blue PCB IR obstacle sensor
- Adjustable detection threshold
- Ready-to-connect three-pin interface
- Components for Arduino, ESP32 and robotics
- Shipping across India
- Same-day delivery available in Surat
- Same-day pickup available in Surat
Same-day services are subject to stock availability, delivery location and applicable order cut-off times.
Add the IR Obstacle Avoidance Sensor Module to your cart and start building your next robotics project with Yagobotix!






There are no reviews yet.