ashR
Junior Member level 3
Ultrasonic sensor HC-SR04 always returns 0cm
I am trying to interface Ultrasonic sensor HC-SR04 with arduino. I am providing the circuit diagram and the related code along.
What is bothering me is that it always returns 0cm(Title mentions 1 instead of 0cm, please ignore). I did search online and got to know that there are many people facing the same problem. People are just uploading new complex codes to solve the problem and no one has provided the reason behind the sensors behaving this way.
I can guarantee that my sensors are working fine since i have tried doing the same with new sensors. Sometimes when i burn the code onto the controller, initially it works properly, but then starts returning 0.
I am trying to interface Ultrasonic sensor HC-SR04 with arduino. I am providing the circuit diagram and the related code along.
What is bothering me is that it always returns 0cm(Title mentions 1 instead of 0cm, please ignore). I did search online and got to know that there are many people facing the same problem. People are just uploading new complex codes to solve the problem and no one has provided the reason behind the sensors behaving this way.
I can guarantee that my sensors are working fine since i have tried doing the same with new sensors. Sometimes when i burn the code onto the controller, initially it works properly, but then starts returning 0.