HC-SR04 not working properly.

Hello Everyone!

I have a HC-SR04 sonic sensor powered by a standard 9v battery and a regulator which regulates the voltage to 5v. From this regulator, I have VCC going to +, gnd going to -, I have a wire attached to an oscilloscope from echo, and another wire which I plug into + (from the regulator) for trig. This is a basic circuit I am using just to test the sensor - the wire from trig is plugged into 5v to activate the sensor.

My understanding of these devices is that the HC-SR04 should not produce a digital signal out of echo, unless a signal is first sent to trig. This is not what is happening with my sensor. I get a digital pulse out of echo when trig is connected to nothing and when I do connect trig to 5v, the noisy pulse goes away and I do not see any output from my oscilloscope. I am wondering if I have a bad set of sonic sensors? I ordered several of these in a pack - when I tried another sensor, I got the same result.

Do you guys have any suggestions on how to solve this problem? Is there some sort of noise that could be interfering with the correct operation of this sensor?

A couple of other notes:

This circuit is completely removed from any other circuit. In other words, the 9v battery is ONLY powering the sonic sensor.

The pulse I do get from echo (without any trigger) does change some when I change the distance of an object in front of the sensor. A pulse continuously comes from echo unless I plug trig into 5v or stop the battery from sending power to the sensor.

I have tried a different battery - 7.4v lithium polymer. I still have the same problem.

Any ideas as to what could be causing this problem?

If the sensor works when using USB power ? read this post

And watch my YouTube video #17 about Ultrasonic range finders which may also help you understand more about what is going on. And whilst you’re there you can see if any other of the beginner-targeted videos are of use to you :slight_smile:

URL is in the signature of this post.

If you still get problem don’t forget to post back on this same thread.

I have a HC-SR04 sonic sensor powered by a standard 9v battery and a regulator which regulates the voltage to 5v.

What sort of a regulator? Post a circuit diagram (hand drawn, not Fritzing).