

The IR Obstacle Sensor Module is a compact and versatile sensor designed to detect obstacles using infrared (IR) light. It emits IR light and measures the reflection to determine the presence and distance of nearby objects. This module is widely used in robotics, automation systems, and proximity detection applications due to its simplicity and reliability.








Below are the key technical details of the IR Obstacle Sensor Module:
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V to 5V |
| Operating Current | 20mA (typical) |
| Detection Range | 2cm to 30cm (adjustable) |
| Output Type | Digital (High/Low) |
| IR Wavelength | 940nm |
| Dimensions | ~3.1cm x 1.5cm x 0.7cm |
| Adjustable Sensitivity | Yes (via onboard potentiometer) |
The IR Obstacle Sensor Module typically has three pins:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (3.3V to 5V) |
| 2 | GND | Ground connection |
| 3 | OUT | Digital output pin (High when no obstacle, Low when an obstacle is detected) |
VCC pin to a 3.3V or 5V power source and the GND pin to the ground of your circuit.OUT pin to a digital input pin of your microcontroller or directly to an external circuit.OUT pin. The onboard LED will also light up when an obstacle is detected.Below is an example of how to connect and use the IR Obstacle Sensor Module with an Arduino UNO:
VCC pin of the sensor to the 5V pin on the Arduino.GND pin of the sensor to the GND pin on the Arduino.OUT pin of the sensor to digital pin 2 on the Arduino.// IR Obstacle Sensor Module Example Code
// This code reads the sensor's output and prints the status to the Serial Monitor.
const int sensorPin = 2; // Digital pin connected to the sensor's OUT pin
const int ledPin = 13; // Onboard LED pin for visual feedback
void setup() {
pinMode(sensorPin, INPUT); // Set sensor pin as input
pinMode(ledPin, OUTPUT); // Set LED pin as output
Serial.begin(9600); // Initialize serial communication
}
void loop() {
int sensorValue = digitalRead(sensorPin); // Read the sensor's output
if (sensorValue == LOW) {
// Obstacle detected
digitalWrite(ledPin, HIGH); // Turn on the LED
Serial.println("Obstacle detected!");
} else {
// No obstacle
digitalWrite(ledPin, LOW); // Turn off the LED
Serial.println("No obstacle.");
}
delay(100); // Small delay for stability
}
The sensor is not detecting obstacles:
VCC and GND connections).False detections or erratic behavior:
The onboard LED does not light up:
Q: Can the detection range be extended beyond 30cm?
A: No, the detection range is limited to approximately 30cm. For longer ranges, consider using other sensors like ultrasonic modules.
Q: Can this module detect transparent objects?
A: The module may struggle to detect transparent or highly reflective objects due to the nature of IR reflection.
Q: Is the module compatible with 3.3V systems?
A: Yes, the module works with both 3.3V and 5V systems, making it compatible with a wide range of microcontrollers.
Q: Can multiple sensors be used together?
A: Yes, but ensure proper spacing between sensors to avoid interference from overlapping IR signals.
By following this documentation, you can effectively integrate the IR Obstacle Sensor Module into your projects and troubleshoot common issues with ease.