B6: Obstacle Detector using IR Sensor

AR-B6: Obstacle Detector using IR Sensor

This entry is part 6 of 13 in the series Arduino Basic Circuits

This code is used to beep the buzzer when obstacle is detected by the IR sensor in front of it. When there is no obstacle, the buzzer remains OFF.

Required Material

Arduino UNO Board – 1, data cable – 1, IR Sensor – 1, Buzzer – 1, Jumper wires – 5.

Working

After uploading the code in Arduino UNO board, place your palm near the IR sensor. This will make output of IR sensor LOW and the buzzer will be ON. When you remove your palm, the buzzer will be OFF.

The Code

This code detects the obstacle in front of IR sensor. First upload the following code in Arduino UNO, construct the circuit using following connection diagram and then test the results.

Signup or Login to view remaining content. It's Completely Free!
Share on your network!
Dattaraj Vidyasagar
Dattaraj Vidyasagar

Author on this website. He is veteran of Core Electronics since last 36+ years. ATL Mentor of Change, Niti Ayog, Govt. of India, Google Certified Educator, International Robotics Trainer and author of 18 books on electronics, robotics, programming languages and web designing... ➤➤

Leave a Reply

Your email address will not be published. Required fields are marked *