IR Sensor Infrared Obstacle Avoidance Module
IR Infrared Obstacle Avoidance Sensor Module
Reliable Object Detection for Robotics and Automation Projects
Introduction
The IR Obstacle Avoidance Sensor is a reflective photoelectric detection module that uses infrared light to detect objects within 2-30cm. With adjustable sensitivity and digital output, it’s ideal for robot navigation, object counting, and automation systems.
Key Features
Infrared Detection
850nm IR LED with phototransistor receiver
Adjustable Range
2cm-30cm detection (via potentiometer)
Digital Output
TTL-level signal (0V or VCC)
Low Power
Typical current: 15-20mA
Technical Specifications
Operating Voltage | 3.3V – 5V DC |
---|---|
Detection Range | 2cm – 30cm (adjustable) |
Output Type | Digital (High/Low) |
Response Time | <2ms |
IR Wavelength | 850nm |
Interface | 3-pin (VCC, GND, OUT) |
Pin Configuration

Pin | Label | Description | Arduino Connection |
---|---|---|---|
1 | VCC | Power (3.3V-5V) | 5V |
2 | GND | Ground | GND |
3 | OUT | Digital Output | D2 (Digital Pin) |
Note: Blue potentiometer adjusts detection sensitivity
Wiring Diagram (Arduino)
// Basic Connections: // VCC → 5V // GND → GND // OUT → D2 (or any digital pin) // For best results: // - Mount sensor 5-10cm above surface // - Avoid direct sunlight interference
Basic Detection Example
const int IRSensor = 2; // Connected to OUT pin void setup() { Serial.begin(9600); pinMode(IRSensor, INPUT); } void loop() { int obstacle = digitalRead(IRSensor); if (obstacle == LOW) { Serial.println("Obstacle detected!"); // Add your response code here } delay(100); }
Advanced Applications
Analog Reading (Optional)
// Connect OUT to analog pin
int sensorValue = analogRead(A0);
// Higher values = closer objects
// Requires threshold calibration
Multiple Sensors
// Array of sensor pins
int sensorPins[] = {2,3,4,5};
void setup() {
for(int i=0; i<4; i++) {
pinMode(sensorPins[i], INPUT);
}
}
Debouncing
// Software debounce
unsigned long lastDetect = 0;
const int debounceDelay = 50;
if(digitalRead(IRSensor) == LOW &&
millis() - lastDetect > debounceDelay) {
lastDetect = millis();
// Trigger action
}
Robot Navigation
// Simple obstacle avoidance
if(digitalRead(leftSensor) == LOW) {
turnRight();
}
else if(digitalRead(rightSensor) == LOW) {
turnLeft();
}
else {
moveForward();
}
Troubleshooting
No Detection
- Adjust potentiometer clockwise to increase sensitivity
- Check IR LED is emitting (view through phone camera)
- Verify object is within 2-30cm range
False Triggers
- Reduce sensitivity (turn potentiometer CCW)
- Shield from ambient IR sources
- Add software debouncing
Inconsistent Readings
- Ensure stable power supply
- Check for loose connections
- Test with different surface reflectivity
Related Posts
IC 74173 – 4-Bit D-Type Register with 3-State Outputs
IC 74173 - 4-Bit D-Type Register with 3-State Outputs
TTL Quad D Flip-Flop with Asynchronous Clear and Output Enable
...
DIY Metal Detector Kit
DIY Metal Detector Kit
DC 3V-5V Non-Contact Sensor Module with 60mm Detection Range
Introduction
The DIY Metal Detec...
CNC V3 Shield with 4 A4988 Drivers
CNC V3 Shield with 4 A4988 Drivers
Complete Arduino-compatible CNC controller for 3D printers and milling machines
...
CN3791 12V MPPT Solar Charger Module
CN3791 12V MPPT Solar Charger Module
Maximum Power Point Tracking Solar Charge Controller for Lead-Acid/Lithium Batteries
...
CJMCU-TRRS 3.5mm Jack AV Stereo Module
CJMCU-TRRS 3.5mm Jack AV Stereo Module
Compact breakout board for audio/video signal interfacing with TRRS connectors
...
TTP223 Capacitive Touch Sensor Module (Red)
TTP223 Capacitive Touch Sensor Module (Red)
Single-Key Touch Detection with Digital Output for Arduino and DIY Projects
...
Capacitive Soil Moisture Sensor
Capacitive Soil Moisture Sensor
Corrosion-Resistant Humidity Detection for Plants and Agricultural Applications
Intro...
VHM-314 Bluetooth Audio Receiver Board Module
VHM-314 Bluetooth Audio Receiver Board Module
High-fidelity stereo audio receiver with Bluetooth 5.0 and 3.5mm audio output
...
BD243 DIY Mini Tesla Coil Prototyping Kit
BD243 DIY Mini Tesla Coil Prototyping Kit
High-Voltage Wireless Power Demonstration - Build Your Own Spark Gap Tesla Coil
...
BF120-3AA Precision Strain Gauges (120Ω)
BF120-3AA Precision Strain Gauges (120Ω)
High-precision foil strain gauges for load cell applications with 120Ω resistance
...
Recent Comments