

The Obstacle Detector (IR Module), manufactured by Arduino, is a compact and efficient sensor designed to detect obstacles in the path of a moving object. It uses infrared (IR) technology to sense the presence of objects within its detection range. This module is widely used in robotics, autonomous vehicles, and other applications where collision prevention is critical. Its simple design and ease of integration make it a popular choice for both hobbyists and professionals.








The following table outlines the key technical details of the Arduino IR Module:
| Parameter | Specification |
|---|---|
| Operating Voltage | 3.3V to 5V DC |
| Operating Current | 20mA (typical) |
| Detection Range | 2cm to 30cm (adjustable via potentiometer) |
| Output Type | Digital (High/Low) |
| IR Wavelength | 940nm |
| Dimensions | 3.1cm x 1.5cm x 0.7cm |
| Operating Temperature | -10°C to 50°C |
The IR Module has a 3-pin interface, as described in the table below:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply pin (3.3V to 5V DC) |
| 2 | GND | Ground pin |
| 3 | OUT | Digital output pin (High when no obstacle, Low when obstacle 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 on your microcontroller (e.g., Arduino UNO).OUT pin will go LOW when an obstacle is detected.Below is an example code snippet to interface the IR Module with an Arduino UNO:
// Define the pin connected to the IR Module's OUT pin
const int IR_Sensor_Pin = 2; // Digital pin 2
// Define the onboard LED pin (for testing purposes)
const int LED_Pin = 13;
void setup() {
pinMode(IR_Sensor_Pin, INPUT); // Set IR sensor pin as input
pinMode(LED_Pin, OUTPUT); // Set LED pin as output
Serial.begin(9600); // Initialize serial communication
}
void loop() {
int sensorValue = digitalRead(IR_Sensor_Pin); // Read the sensor output
if (sensorValue == LOW) {
// Obstacle detected
digitalWrite(LED_Pin, HIGH); // Turn on LED
Serial.println("Obstacle detected!");
} else {
// No obstacle
digitalWrite(LED_Pin, LOW); // Turn off LED
Serial.println("No obstacle.");
}
delay(100); // Small delay for stability
}
Sensor Not Detecting Obstacles:
VCC and GND pins are connected properly.False Positives or Erratic Behavior:
Output Pin Always HIGH or LOW:
By following this documentation, users can effectively integrate the Arduino IR Module into their projects and troubleshoot common issues with ease.