Obstacle avoidance sensor

The emitter on the infrared obstacle avoidance sensor emits infrared radiation and if an obstacle is in front of the sensor, some of the radiation is reflected back and picked up by the receiver. If no object is in front of the sensor then the radiation will dissipate, and the receiver will not receive anything back.

The pins on the sensor are clearly marked with OUT, GND, and VCC, from left to right. The GND pin is connected to the ground rail and the VCC pin is connected to the power rail of the breadboard. The OUT pin is connected directly to a digital pin on the Arduino. If the signal from the OUT pin is LOW, ...

Get Mastering Arduino now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.