NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.7

Stanley:
I thought if the library read a high pulse whereas the URM37 reads a low pulse, a "simple" #if define URM37 would change the codes whereas all the other codes and timing would remain the same...

*** I could be wrong or it just sounded too simplified...

You're right, that would be all that's required to read a LOW pulse instead of a HIGH pulse. It's a little more complicated as it waits and makes sure the signal is LOW before it times the HIGH pulse. But, it's still shooting in the dark without the sensor in front of me.

You can try the following changes to NewPing.cpp, which just changes the pulse measurement from HIGH to LOW:

	while (!(*_echoInput & _echoBit))                   // Wait for the ping echo.
	while (!(*_echoInput & _echoBit) && micros() <= _max_time) {} // Wait for echo pin to clear.
	while (*_echoInput & _echoBit)                                // Wait for ping to start.
	if (*_echoInput & _echoBit) {    // Ping echo received.

Give it a go. Keep in mind that this is just a guess, and we're still assuming a lot. But, it's a simple thing to try. There's other issues as well, like this could give a reading, but it may not be consistent or accurate due to timing issues.

Let me know what happens.

Tim