ESP32 CAM WiFi Module with OV3660 Camera Module 2MP
IR (Infrared) Obstacle Avoidance Sensor Module
Couldn't load pickup availability
The IR Proximity Sensor has a distance range of 2cm to 30cm and it is ideal for obstacle detection, line tracking, and more.
It is designed for easy setup and has onboard detection indication to verify its status. A preset knob allows you to fine-tune the distance range for more accurate readings.
This IR Sensor is best for IoT projects, such as creating automatic sanitizer dispensers and home automation systems.
This infrared sensor is suitable for various applications in industrial, automotive, and consumer electronics settings. This sensor offers unbeatable value for money while ensuring optimal accuracy and efficiency in all your projects.
The detection range of the infrared proximity sensor can be adjusted by the potentiometer.
Read our blog proximity sensor working principle.
Enjoy our free shipping on orders above Rs 500/- within India.

The IR proximity sensor circuit diagram consists of the following components:


const int sensorPin = 2; // sensor output pin
void setup() {
Serial.begin(9600);
pinMode(sensorPin, INPUT);
Serial.println("IR Obstacle Sensor Test");
}
void loop() {
int val = digitalRead(sensorPin);
if (val == LOW) {
Serial.println("Obstacle detected!");
}
else {
Serial.println("Clear");
}
delay(500);
}
const int sensorPin = 2;
const int ledPin = 13; // onboard LED on many Arduino boards
void setup() {
pinMode(sensorPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
int state = digitalRead(sensorPin);
if (state == LOW) {
digitalWrite(ledPin, HIGH);
Serial.println("Obstacle!");
} else {
digitalWrite(ledPin, LOW);
Serial.println("All clear");
}
delay(300);
}
| Feature | IR Proximity Sensor | Ultrasonic Sensor |
|---|---|---|
| Detection Method | Emits infrared light and measures reflection from nearby objects. | Emits ultrasonic sound waves and measures time-of-flight to calculate distance. |
| Typical Range | 2–30 cm (depends on module and potentiometer setting) | 2 cm–4–5 m (depending on module like HC-SR04) |
| Accuracy | Good for short distances, less accurate with dark/transparent surfaces. | Moderate to high accuracy over longer distances, generally unaffected by color. |
| Surface Sensitivity | Reflectivity matters; black/dark or transparent surfaces may be poorly detected. | Works with almost any surface type; sound reflects reliably from most objects. |
| Response Speed | Fast response, good for obstacle avoidance in robots at short range. | Slower than IR; small delay due to sound travel, but good for medium distances. |
| Cost & Size | Low cost, very compact, easy to integrate. | Moderate cost, slightly larger, requires both transmitter and receiver elements. |
| Environment Limitations | Sunlight or strong ambient IR light can interfere; close proximity required. | Can be affected by soft materials (fabric, foam), or air turbulence; generally works well outdoors. |
| Best Use Case | Short-range obstacle detection, line following, touchless buttons. | Distance measurement, medium-range obstacle avoidance, level detection, robotics. |
| Specification | Details |
|---|---|
| Main Chip | LM393 |
| Operating Voltage | 3.3 ~ 5 VDC |
| Distance Measuring Range | 8 cm |
| Dimensions | 48 x 14 x 8 mm |
| Weight | 15 grams |