Ultrasonic sensor not responding

TheWave:

teckel:

TheWave:
Hello, i recently purchased an hc-sr04 sensor an dam trying to get it to work with my arduino... I am using this sketch

No matter where i move my hand in front of the sensor. Any ideas? Also i am 99.9% sure they are hooked up right. Cant say 100 because you guys always figure something out...:wink: thanks!!

First, that library may not work with your sensor. Use the NewPing library which is designed for the HC-SR04 and has a multitude of other advantages. Also, be sure not to use pin 13 (see the NewPing example sketch).

Tim

Ok, just downloaded and checked it out. Now it seems to be doing something ( i can here little clickish sounds coming form the sensor) but now i get

Ping: 0cm
Ping: 0cm
Ping: 0cm
Ping: 1149cm
Ping: 0cm
Ping: 0cm
Ping: 0cm
Ping: 1149cm
Ping: 0cm
Ping: 0cm
Ping: 1149cm
Ping: 0cm
Ping: 0cm
Ping: 0cm
Ping: 1149cm
Ping: 1149cm
Ping: 0cm
Ping: 1149cm
Ping: 0cm
Ping: 1149cm
Ping: 0cm
Ping: 1149cm
Ping: 0cm
Ping: 0cm
Ping: 1149cm
Ping: 1149cm
Ping: 0cm
Ping: 1149cm
Ping: 0cm
Ping: 0cm
Ping: 0cm
Ping: 0cm
Ping: 1149cm
Ping: 0cm
Ping: 0cm
Ping: 0cm
Ping: 0cm
Ping: 0cm
Ping: 0cm
Ping: 1149cm
Ping: 0cm
Ping: 0cm

etc...hmmm...Any other ideas? Or have you seen this before?

Are you using the sample NewPing sketch? What pins are you using? Be sure to NOT use pin 13. What kind of delay do you have between pings? Maybe post your sketch, just to be sure.

Tim