I’m using arduino UNO, I did a program in which I use an ultrasonic sensor (“SR-04 Ultrasonic Ranging Module Hc - Sr04 for Arduino”) (which measures the distance) and a buzzer. I can provide you the fritzing diagram and code.
Now, my Sensor is attached on the breadboard. When I open the Serial Monitor, It gives me the values as I want,
but the moment I rotate it ( on the desk - different direction) The values start to differ like fluctuation from 210 to 0 to 208 again , this zero for a second creates the problem with the buzzer.
The buzzer beeps at that time. after Every 3 to 4 values, this zero comes. I tried cleaning the sensor , but nothing worked, When I attach these things to a stick, the sensor gives this problem. So What can I do ?]
Find the photo of the serial monitor’s difference from the attachment.