Skip to content
proximity

IR Obstacle Avoidance Sensor Module

Short-range IR proximity sensor with an adjustable threshold — perfect for line-following robots.

A low-cost infrared proximity sensor with an onboard potentiometer for tuning detection distance, the standard choice for line-following and obstacle-avoidance robots. It works by emitting an IR beam and measuring the reflected signal strength bouncing back off nearby surfaces, outputting a simple digital signal when an object comes within the adjustable detection range — an inexpensive way to give a small robot basic 'something is close' awareness without the complexity of an ultrasonic or ToF distance sensor.

Specifications

Sensor typeIR reflectance-based obstacle/proximity sensor with onboard comparator
Operating voltage3.3V–5V DC
Operating current~20-25 mA typical
Detection range~2cm-30cm, adjustable via the onboard potentiometer (exact max range varies by board revision)
OutputDigital output only on most versions — goes LOW when an object is detected within range (active LOW is common but check your specific board)
Sensitivity adjustmentOnboard trimmer potentiometer sets the effective detection distance
Surface dependencyDetection distance varies with target surface color and reflectivity — dark or non-reflective surfaces are detected at shorter range than light/reflective ones
InterfaceSingle digital output pin, read directly as a HIGH/LOW input

Pinout

PinNameDescription
1VCCPower, 3.3–5V DC
2GNDGround
3OUTDigital output — active LOW when an obstacle is detected within the adjusted range

Adjust the onboard potentiometer while testing against your actual target surface (e.g. the specific line-following track or wall material), since detection range shifts noticeably with surface color and reflectivity — a setting tuned against a white wall may under- or over-trigger against a black line-following track. Multiple sensors mounted close together on the same robot chassis can occasionally cross-interfere with each other's IR beams; angling them apart slightly usually resolves this.

Variants

The basic IR obstacle sensor is the cheapest and simplest option for beginner robot kits that just need a binary 'something's there' signal. If the project needs to know how far away an object actually is (rather than just a threshold trigger), a Sharp GP2Y0A21 or, better yet, a VL53L0X gives meaningfully more useful distance data.

VariantTemp rangeHum rangeAccuracyProtocolPrice
IR obstacle sensor (3-pin, digital output)~$0.50-1.50
Sharp GP2Y0A21 (analog IR distance)~$5-10
VL53L0X (laser ToF)~$3-6