HC SR04 stopped working


Yesterday, I set up the HCSR04 with my Arduino REV3 to simply measure the distance to an object. I got it to work properly showing just about the right distance.

After that I incorporated a server control, targeting to turn the servo when the distance was less than a certain value. The servo is a Luxorparts S3003 4,1 kg . The servo was supplied from a separate power adapter 6 V, 0,45 A, while the HCSR04 was supplied by the Arduino 5V supply. I also interconnected the ground for the servo and Arduino as should.

This set up I never got to work, so I removed all the servo connections and went back to test the original pure HCSR04 sensor setup again. Now the feedback in the Arduino Serial Monitor, from the HCSR04 was only zero!!

Furthermore, I noted that when I was touching the Echo cable from HCSR04 to Arduino, the HCSR04 started sending other (wrong) values than zero! When I released the cable it started sending zero again.

I should also mention, that I now that the servo control does work, since it was tested separately.

I understand that there is a bug (??) in the HCSR04 and it is recommended to use the new PING library, which I will do, but my question is if there is any one else that has had a similar problem, having the HCSR04 functioning and then all of a sudden stop working? Could it be that the HCSR04 has been damaged?

Thanks in advance for feedback.


I think you have a wiring problem. If you touch a wire and get signals, then it is likely that the Arduino input is "floating", i.e. is not actually connected to the sensor.

Redo the wiring and make sure that you have good connections. Use a multimeter to check for continuity.