Sensor Digital

Infrared Obstacle Avoidance Sensor

An infrared obstacle avoidance module sends IR light and watches for a reflection from nearby objects.

Part images

KY-032 Module Photo. Module Photo for the KY-032 Infrared Obstacle Avoidance Sensor. Image source: Joy-IT SensorKit KY-032 module documentation
KY-032 Pinout / Module Diagram. Pinout / Module Diagram for the KY-032 Infrared Obstacle Avoidance Sensor. Image source: Joy-IT SensorKit KY-032 module documentation
KY-032 Reference Diagram. Reference Diagram for the KY-032 Infrared Obstacle Avoidance Sensor. Image source: Joy-IT SensorKit KY-032 module documentation

What it is

An infrared obstacle avoidance module sends IR light and watches for a reflection from nearby objects.

How students use it

Students use it for robot bump avoidance, hand-wave triggers, object counters, and reflective-surface experiments.

Pins and power

OUT signal, GND, VCC, and sometimes EN depending on the board.

KY-032 boards are commonly powered as modules; verify VCC and output voltage before Pico wiring.

OUT changes state when reflected IR crosses the module's threshold. Onboard trimmers may adjust range or sensitivity.

Voltage and safety

Confirm OUT does not exceed 3.3V before connecting it to Pico GPIO.

Educational proximity sensor only; do not use it for safety-critical collision avoidance.

Module internals

Main component: IR emitter and IR receiver pair with comparator circuitry.

IR LED, photodiode/phototransistor, comparator, potentiometers, indicator LED, and header pins.

Datasheet notes

Reflectivity, angle, sunlight, and dark materials can all change detection range.

Common libraries

Use machine.Pin for the digital output.

Common mistakes

Testing on black or angled surfaces, using it in bright sunlight, setting the trimmer too far, and trusting it as a precise distance sensor.