Page 1 of 1

Obstacle Detecting Glasses

Posted: Tue Nov 05, 2024 9:05 pm
by ShivanshSingh
I ade the obstacle detecting glasses from science buddies project.however,the buzzer in my project is still giving small beeps when any obstacle is not there.it makes a louder noise when an object is there but I want to remove the small beeps when obstacle is not there.How do I do this?


[Admin note: Project url: https://www.sciencebuddies.org/science- ... ng-glasses ]

Re: Obstacle Detecting Glasses

Posted: Thu Nov 07, 2024 8:58 am
by bfinio
Hi - please follow these steps:

1) Open the example code.
2) Uncomment the Serial.begin(9600); line in the setup function (delete the two backslashes).
3) Uncomment the Serial.println(cm); line in the loop function.
4) Re-upload the code to your Arduino.
5) Select Tools->Serial monitor from the menu in the Arduino IDE.
6) Look at the numbers that print out in the serial monitor. They should change when you move your hand back and forth in front of the sensor.
7) What is the number when there is no object in front of the sensor?
8 ) What do you have the threshold variable set to? Did you keep the default value of 30 or change it to something else?

The buzzer will beep if any object is detected closer than the threshold variable. However, the sensor works by detecting reflected sound. Even if there is no object directly in front of the sensor, sound could still be reflecting off another object (the wall, furniture, your computer, etc). The steps outlined above will help you determine whether the sensor is detecting another object. If it is accidentally detecting other things, you can try decreasing the threshold value so the buzzer only activates starting when objects are closer, or repositioning your sensor so it is not aimed at other objects that reflect sound.

Please let us know if that works.