Proximity Basic: IR Obstacle Detection
The IR Obstacle Sensor is the workhorse of industrial automation and DIY robotics. Unlike ultrasonic sensors that measure exact distances, IR sensors provide a blazing fast binary "Yes/No" response to whether an object is in front of them.

How Infrared Works
The sensor module has two main components:
- The Emitter: A clear LED that constantly blasts invisible Infrared light forward.
- The Receiver: A black photodiode.
- The Bounce: If there is no object, the light travels forward and dissipates. If an object is present, the IR light bounces off the object and hits the black receiver.
- The Output: An onboard LM393 chip immediately flips a digital pin LOW to alert the Arduino.
Necessary Parts
- Arduino Uno/Nano: To read the digital output.
- KY-032 / IR Obstacle Sensor Module: The detection unit.
- LED or Buzzer: For immediate verification that an object was seen.
Limitations and Uses
IR sensors are heavily dependent on color. They easily detect white (reflective) objects up to 10cm away but will completely fail to detect "Vantablack" or very dark, matte objects because the light is absorbed. This exact principle is used in "Line Follower" robots to differentiate between the white floor and the black tape!