Best IR Sensors and Obstacle Avoidance Modules for Arduino & Robotics (Buying Guide)

⚠️ Affiliate Disclosure: This post contains Amazon affiliate links. If you purchase through our links, we may earn a small commission at no extra cost to you. We only recommend products we have thoroughly researched and verified. Prices change frequently, so we don’t list them here — always tap through and confirm the live price on Amazon before buying.
Ultimate Buying Guide 2026

📡 Best IR Sensors & Obstacle Avoidance Modules

7 IR sensors and obstacle avoidance modules ranked for makers, students and roboticists — from basic 3-pin reflective modules to long-range tubular photoelectric sensors — with real specs, honest verdicts, and direct Amazon links.

✅ 7 Modules Reviewed ✅ Verified Amazon ASINs ✅ Updated July 2026 ✅ Honest Pros & Cons

An IR (infrared) obstacle avoidance sensor is one of the most essential components in any robotics or embedded systems project. These compact modules use an infrared LED and a photodiode receiver to detect nearby objects — when an obstacle reflects IR light back to the sensor, the output pin goes LOW, giving your Arduino, ESP32, Raspberry Pi, or STM32 an instant digital signal to react. That simplicity makes them perfect for robot collision avoidance, line-following cars, object counters, automated conveyor belts, and countless other applications.

Choosing the right IR sensor, however, isn’t always obvious. Detection range, output type (3-pin vs 4-pin), chip technology (reflective photoelectric vs TCRT5000 vs tubular photoelectric), operating voltage, and pack size all vary significantly across products. This guide cuts through the noise: we’ve reviewed 7 of the best IR sensor and obstacle avoidance modules available on Amazon in 2026 — across every budget and use-case — so you can buy with confidence.

💡 Reality check before you buy: Most basic IR obstacle avoidance modules have a detection range of only 2–30 cm — they are short-range reflective sensors, not sonar. The sensitivity potentiometer lets you tune the trip point, but you cannot extend range far beyond spec. They also struggle with black surfaces (which absorb IR instead of reflecting it) and direct sunlight (which saturates the photodiode). For longer range (up to 80 cm), choose a tubular E18-D80NK-style sensor. For line-following or floor detection within ~25 mm, use a TCRT5000 module. And always decouple your 5V supply with a capacitor — inrush current from multiple modules can glitch a USB-powered board.

📡 Quick Comparison — All 7 IR Sensor Modules

ModuleTypeDetection RangeVoltageBest ForBuy
🥇 OSOYOO 10-PackReflective · 3-pin2–30 cm3–5VBest OverallBuy Here →
🏅 HiLetgo 10pcs 3-WireReflective · 3-pin2–30 cm3.3–5VBest ValueBuy Here →
📦 Frienda 20-PackReflective · 3-pin2–30 cm3.3–5VBest Bulk PackBuy Here →
🔴 ACEIRMC TCRT5000TCRT5000 · 4-pin1–25 mm3.3–5VBest Line TrackingBuy Here →
📏 HiLetgo E18-D80NKTubular · NPN3–80 cm5VBest Long RangeBuy Here →
🔧 HiLetgo 5pcs 4-PinReflective · 4-pin2–40 cm3–6VBest with Enable PinBuy Here →
💎 WWZMDiB 6-PackReflective · 3-pin2–30 cm3.3–5VBest Compact PackBuy Here →

Detection ranges are approximate and vary by surface color, reflectivity, and ambient light. Always confirm the live price on Amazon before buying.

🔍 What to Look for in an IR Sensor Module

📏

Detection Range

Standard reflective IR modules cover 2–30 cm — ideal for obstacle avoidance in robot cars. Need more? The tubular E18-D80NK reaches 3–80 cm. For floor and line detection within ~25 mm, use a TCRT5000.

🔌

Pin Count (3-pin vs 4-pin)

3-pin modules (VCC, GND, OUT) are simplest — just connect and go. 4-pin modules add an enable pin that lets you power down the sensor in firmware, saving current and avoiding false triggers in multi-sensor setups.

Operating Voltage

Most modules accept 3.3–5V, making them compatible with both 5V Arduinos and 3.3V ESP32/Pico boards. Always check: some tubular sensors require 5V only. Mixing voltages without a level shifter can damage 3.3V MCU pins.

🎚️

Sensitivity Adjustment

Most modules have an onboard potentiometer to tune the detection distance. Turn clockwise to increase range, counterclockwise to decrease it. This adjustment is critical for reliable performance — don’t buy modules without it.

🌞

Ambient Light Immunity

All reflective IR sensors struggle in bright sunlight or near IR-rich light sources. Tubular E18-style sensors with enclosed optics offer much better ambient light rejection than open PCB modules — important for outdoor projects.

🏆 Detailed Reviews — All 7 IR Sensor Modules

🥇 BEST OVERALL

OSOYOO 10-Pack IR Sensor

⭐ 4.6/5 · Best All-Round IR Module
2–30 cm
DETECTION RANGE
3–5V
VOLTAGE
35°
DETECT ANGLE
10-Pack
QUANTITY
Buy on Amazon →
OSOYOO 10-Pack IR Obstacle Avoidance Sensor Module for Arduino

The OSOYOO 10-Pack is the go-to IR obstacle avoidance module for anyone building their first robot car or stocking up for a classroom kit. With 260+ reviews and a 4.6-star rating, it consistently delivers reliable reflective sensing at 2–30 cm with a 35° detection angle. The output can drive a 5V relay directly — no transistor needed. A convenient indicator LED lights green when an obstacle is detected, making bench testing trivially easy. The adjustable potentiometer lets you fine-tune the trip point for your specific surface, and the wide 3–5V range plays nicely with Arduino, ESP32, and Raspberry Pi without any level shifting.

✅ Pros
  • 260+ reviews, proven reliable
  • Drives 5V relay directly
  • Wide 3–5V compatibility
  • Visual LED indicator
  • Solid community support
❌ Cons
  • Struggles on black surfaces
  • 30 cm max in ideal conditions
  • Open PCB, no sunlight shield
🎯 Verdict: The best all-round pick. Proven reliability, wide voltage range, and enough modules for any robotics project.

👉 Check Price on Amazon →

🏅 BEST VALUE

HiLetgo 10pcs 3-Wire IR

⭐ 4.2/5 · Best Price-Per-Module
2–30 cm
DETECTION RANGE
3.3–5V
VOLTAGE
317
REVIEWS
10-Pack
QUANTITY
Buy on Amazon →
HiLetgo 10pcs IR Infrared Obstacle Avoidance Sensor Module 3-Wire Arduino

With 317 reviews, the HiLetgo 10-pack 3-Wire IR Sensor is the most battle-tested option here. It’s a classic 3-pin (VCC, GND, OUT) reflective photoelectric module with a sensitivity-adjusting potentiometer and dual indicator LEDs — power and obstacle detection. The 3.3–5V operating range covers virtually every popular MCU. HiLetgo’s modules are commonly used in HiLetgo Arduino starter kits and have extensive tutorial coverage across YouTube, Instructables, and microcontrollerslab.com. If you want the biggest library of community resources and the lowest risk of “no tutorials for this exact module,” this is your pick.

✅ Pros
  • 317 reviews — most tested here
  • Dual indicator LEDs
  • Huge tutorial library
  • 3.3V & 5V compatible
❌ Cons
  • 4.2★ — some QC variance
  • Same 30 cm ceiling as others
  • No enable pin for power saving
🎯 Verdict: The best value for prototypers. Most community resources of any module here — tutorials everywhere.

👉 Check Price on Amazon →

📦 Best Bulk Pack · ⭐ 4.4/5
Frienda 20-Pack IR Sensor
20 modules · 2–30 cm · 3-pin · 270 reviews
Buy on Amazon →
Frienda 20 Pieces IR Infrared Obstacle Avoidance Sensor Module

When you’re outfitting a whole classroom kit or building a multi-robot setup, the Frienda 20-Pack makes more economic sense than buying two 10-packs. You get 20 standard 3-pin reflective IR modules with onboard indicator LEDs and adjustable sensitivity potentiometers. Each module uses a matched IR transmitter/receiver pair and an LM393 comparator for a clean digital output. The modules are fully compatible with Arduino, Raspberry Pi 3, and smart car robot kits. Frienda’s 270 reviews at 4.4 stars show consistent quality — a solid choice for educators and classroom robotics builds.

✅ Pros
Best per-module cost · 20 pack for classrooms · LM393 comparator · 270 reviews · Wide MCU compatibility
❌ Cons
Same 30 cm range limit · No 4-pin enable · Slight variation between units
🎯 Verdict: Best for classrooms and bulk builds. 20 modules for the price of fewer elsewhere.
🔴 Best Line Tracking · ⭐ 4.7/5
ACEIRMC TCRT5000 10pcs
1–25 mm · TCRT5000 chip · 4-pin · 3.3–5V
Buy on Amazon →
ACEIRMC TCRT5000 IR Reflective Sensor Line Tracking Module Arduino

The TCRT5000 is a fundamentally different sensor type from the standard reflective IR module — it’s a precision short-range reflective sensor with a detection distance of just 1–25 mm, making it the right choice for line-following robots, floor color detection, and encoder-style rotation sensing. The ACEIRMC 10-pack uses the Vishay TCRT5000 component on a compact PCB with an LM393 comparator, potentiometer for sensitivity adjustment, and both analog and digital output pins. The rated 4.7 stars reflect how consistently these perform for their intended use-case. This is not a substitute for a longer-range obstacle sensor — it’s a specialist tool for close-range surface sensing.

✅ Pros
4.7★ top-rated · Analog + digital output · Perfect for line-following · Compact PCB · LM393 based
❌ Cons
Only 1–25 mm range · Not for general obstacle avoidance · Must be close to surface
🎯 Verdict: The only pick for line-following robots. Nothing else here works at 1–25 mm with this precision.
📏 Best Long Range · ⭐ 4.6/5
HiLetgo E18-D80NK 3pcs
3–80 cm adjustable · NPN · 5V · Tubular
Buy on Amazon →
HiLetgo E18-D80NK Infrared Photoelectric Switch Long Range Obstacle Sensor 3-80cm

The E18-D80NK is the module to reach for when you need serious range. Its enclosed tubular housing bundles the IR emitter and photodiode receiver together in a sealed barrel — delivering 3–80 cm of adjustable detection range with dramatically better ambient light rejection than open PCB modules. The NPN normally-open output connects directly to a microcontroller digital pin. You adjust range by rotating the cap on the sensor barrel. This style of sensor is commonly found on conveyor lines, industrial counters, and autonomous robot platforms that need to detect objects at arm’s length rather than centimeters. The HiLetgo 3-pack gives you spares for a fraction of industrial pricing.

✅ Pros
3–80 cm range · Enclosed optics · Better sunlight immunity · Industrial-style housing
❌ Cons
5V only — not 3.3V native · Bulkier than PCB modules · Higher cost per unit
🎯 Verdict: The only pick for range beyond 30 cm. Tubular housing gives far better outdoor/bright-light performance.
🔧 Best with Enable Pin · ⭐ 4.7/5
HiLetgo 5pcs 4-Pin IR
2–40 cm · 4-pin · 3–6V · Enable control
Buy on Amazon →
HiLetgo 5pcs 4-Pin IR Infrared Obstacle Avoidance Sensor Module Smart Car Robot

The HiLetgo 4-Pin IR sensor adds one critical feature over the standard 3-pin module: an enable pin (EN). By toggling EN high or low in firmware, you can turn individual sensors on and off without cutting power — essential for multi-sensor setups where you want to interrogate sensors sequentially to avoid crosstalk, or power them down to save current between readings. The 2–40 cm range is slightly extended vs standard 3-pin models, and the 3–6V operating range is the widest here, covering Li-ion/LiPo-powered systems directly. If your design has 4 or more IR sensors polling simultaneously and you’re seeing false triggers, switch to these.

✅ Pros
Enable pin for sequencing · 2–40 cm (wider range) · 3–6V (widest voltage) · 4.7★ rating
❌ Cons
Fewer reviews (11) · Only 5-pack · Enable pin requires extra GPIO
🎯 Verdict: Best for multi-sensor builds. Enable pin prevents crosstalk and saves power in dense sensor arrays.
💎 Best Compact Pack · ⭐ 4.5/5
WWZMDiB 6-Pack IR Sensor
2–30 cm · 3-pin · 3.3–5V · 35° angle
Buy on Amazon →
WWZMDiB 6Pcs IR Infrared Sensor 3-Wire Reflective Photoelectric Module for Arduino

The WWZMDiB 6-Pack hits a sweet spot for small projects that don’t need 10+ sensors. Six modules, each with the standard 3-pin reflective photoelectric layout, a sensitivity potentiometer, and a 3.3V-recommended wide-voltage input (3.3–5V). The 35° detection angle and 2–30 cm range are on par with competing 3-pin modules, but WWZMDiB’s 4.5-star rating with 79 reviews suggests slightly tighter quality control than generic HiLetgo or Frienda packs. This is a good middle-ground pick when you need enough sensors for a 4-wheeled obstacle-avoiding robot (one per side, plus extras) without paying for a 10-pack you won’t fully use.

✅ Pros
4.5★ good QC · 6-pack right-sized · 3.3V recommended · Competitive price
❌ Cons
Same 30 cm ceiling · Fewer reviews than OSOYOO/HiLetgo · No enable pin
🎯 Verdict: Best 6-pack option. Right-sized for single robot builds with quality that’s a notch above generic packs.

🛒 How to Choose the Right IR Sensor

🤖

Building an obstacle-avoiding robot?

Get the OSOYOO 10-Pack — reliable reflective sensing, 2–30 cm range, 5V relay output, and plenty of community tutorials.

🏎️

Building a line-following robot?

The ACEIRMC TCRT5000 is the correct sensor — 1–25 mm short range for floor detection. Standard IR modules won’t work for this.

📏

Need detection beyond 30 cm?

The HiLetgo E18-D80NK reaches 3–80 cm in an enclosed tubular housing with excellent ambient light rejection.

🔢

Running many sensors simultaneously?

Use the HiLetgo 4-Pin module — its enable pin lets you poll sensors sequentially to prevent IR crosstalk.

🎓

Stocking a classroom or makerspace?

The Frienda 20-Pack or HiLetgo 10-Pack give you the most modules for the budget. Both have 250+ reviews.

⚙️ Key Specs Compared — Side by Side

SpecOSOYOO 10-PackHiLetgo 10pcsTCRT5000E18-D80NKHiLetgo 4-Pin
Detection Range2–30 cm2–30 cm1–25 mm ⭐3–80 cm ⭐2–40 cm
Operating Voltage3–5V3.3–5V3.3–5V5V only3–6V ⭐
Pin Count3-pin3-pin4-pin (A+D out)3-wire (NPN)4-pin + EN ⭐
Output TypeDigitalDigitalAnalog + Digital ⭐Digital NPNDigital
Ambient Light ImmunityLowLowLowHigh ⭐Low
Amazon Rating4.6★ ⭐4.2★4.7★ ⭐4.6★4.7★ ⭐
Best Use CaseObstacle avoidanceGeneral / learningLine followingLong-range / outdoorMulti-sensor arrays

⭐ marks the best cell per row. Specs are approximate — confirm on the live Amazon listing before purchasing.

❓ Frequently Asked Questions

What is the difference between an IR obstacle avoidance sensor and an IR line-tracking sensor?

They work on the same principle — emit IR, detect reflection — but at very different distances. Obstacle avoidance sensors (standard 3-pin reflective modules, E18-D80NK) detect objects 2–80 cm away and output LOW when something is in front. Line-tracking sensors (TCRT5000-based) work 1–25 mm from the surface, distinguishing between a white floor (high reflection) and a black line (low reflection). Using an obstacle sensor for line tracking won’t work because it’s designed for much longer range. Always match the sensor to the application.

Can I use IR obstacle sensors with an ESP32 or Raspberry Pi (3.3V systems)?

Yes, for most modules reviewed here. The OSOYOO, HiLetgo 3-Wire, Frienda, TCRT5000, and WWZMDiB all operate at 3.3–5V. Connect VCC to 3.3V, GND to GND, and OUT directly to a GPIO pin — the output logic is compatible with 3.3V MCUs. The exception is the E18-D80NK tubular sensor, which requires 5V for its emitter. If you use it with an ESP32, power the sensor from 5V but use a voltage divider or level shifter on the output signal line to protect the 3.3V GPIO.

Why does my IR sensor trigger randomly or fail to detect obstacles consistently?

The most common causes: (1) Black or dark surfaces absorb IR instead of reflecting it — the sensor won’t detect them reliably. (2) Bright ambient light or direct sunlight saturates the photodiode receiver. (3) Incorrect sensitivity setting — use a small screwdriver to adjust the potentiometer with an obstacle at your target distance until the indicator LED just switches. (4) Supply noise — if multiple sensors are on the same power rail with motors, add a 100µF capacitor across the 5V rail near the sensors. (5) With 3-pin sensors, using several in parallel can cause IR crosstalk — switch to 4-pin enable-controlled modules and poll them sequentially.

How do I connect an IR obstacle avoidance sensor to Arduino?

For a standard 3-pin module: connect VCC → 5V, GND → GND, OUT → any digital pin (e.g. D2). In your sketch, set that pin as INPUT_PULLUP (or just INPUT) and read it with digitalRead(). The output goes LOW (0) when an obstacle is detected. For the TCRT5000, the digital output pin (DO) works the same way; the analog output (AO) can go to an analog pin for distance-proportional readings. For the E18-D80NK, the NPN output connects through a 10kΩ pull-up resistor to 5V on one side and to the Arduino digital pin on the other — when the sensor detects an object, it pulls the pin LOW. Full tutorials with wiring diagrams are available at microcontrollerslab.com.

What is the maximum detection range of IR obstacle avoidance sensors?

Standard reflective PCB modules typically cap out at about 30 cm under ideal conditions (bright white, highly reflective surface, no ambient IR interference). Many perform more like 20 cm reliably in practice. The E18-D80NK tubular sensor extends this to ~80 cm. If you need detection beyond 80 cm, IR reflective sensors aren’t the right technology — consider an HC-SR04 ultrasonic sensor (up to 4 m), a Sharp GP2Y0A21YK0F IR distance sensor (10–80 cm analog output), or a LiDAR module for the longest ranges. We have tutorials for all of these at microcontrollerslab.com.

🏁 Final Verdict — Best IR Sensor for Every Build

The right IR sensor module for every project and budget:

🥇 Best OverallOSOYOO 10-Pack: 2–30 cm, 4.6★, 260+ reviews, drives relay directly
Buy →
🏅 Best ValueHiLetgo 10pcs 3-Wire: most tutorials, 317 reviews, 3.3–5V compatible
Buy →
📦 Best Bulk PackFrienda 20-Pack: lowest cost per module, perfect for classrooms
Buy →
🔴 Best Line TrackingACEIRMC TCRT5000: 1–25 mm, analog + digital output, 4.7★
Buy →
📏 Best Long RangeHiLetgo E18-D80NK: 3–80 cm, enclosed tubular, best outdoor performance
Buy →
🔧 Best Multi-SensorHiLetgo 4-Pin: enable pin prevents crosstalk, widest voltage 3–6V
Buy →
💎 Best Compact PackWWZMDiB 6-Pack: 4.5★, right-sized for single robot builds
Buy →

No single IR sensor is perfect for every build — but every pick above earns its place. For most obstacle-avoiding robots, the OSOYOO 10-Pack is the one to buy first. Need a massive stock for a classroom? Grab the Frienda 20-Pack. Building a line-follower? The ACEIRMC TCRT5000 is the only correct answer. Working outdoors or beyond 30 cm? Step up to the E18-D80NK. Ready to get building? Browse our full library of Arduino, ESP32, STM32, and Raspberry Pi tutorials — including complete wiring diagrams and sample code for IR sensor projects.

💬 Have a question about which IR sensor fits your project? Tell us what you’re building in the comments below and we’ll point you to the right pick!

All Amazon links above use our affiliate tag (microlab05-20). Purchasing through them supports microcontrollerslab.com at no extra cost to you. Prices and availability change frequently — always confirm the current price on Amazon before buying.

Arduino ComponentsAmazon Links
Arduino Starter KitBuy Now
Arduino Development KitBuy Now
Arduino Smart Robot Car Kit V4Buy Now
Arduino Sensors KitBuy Now

Leave a Comment