Go Down

Topic: HC-SR04 does only 5cm (Read 1 time) previous topic - next topic


Hello to you all,

I have a HC-SR04 hooked up on my MEGA, i did it with the trig and echo pin together as described at http://code.google.com/p/arduino-new-ping/wiki/NewPing_Single_Pin_Sketch
Now when i run it i only read 5cm but there is much more space in front, when i used this on a other arduino it work as a charm.
Also when i touch the sender, receiver or xtal it sometimes respond.
I have three HC-SR04's but the all do exactly the same.

Any one is familiar with this problem?



Maybe it's hearing the transmitter side ringing down.  Are there library calls you could do to set a blanking period?  Try putting a divider between the sending and receiving side to block direct sound from making it over.
Experience, it's what you get when you were expecting something else.


I have the same basic thing. Once the trigger pin is raised and lowered you wait for echo to go high at which point you start timing until echo goes low and that's your range.

Nick Gammon on multitasking Arduinos:
1) http://gammon.com.au/blink
2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts

Go Up