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

teckel:
It appears the ping trigger process is working if you're getting activity on the echo pin. Does it look like a nice square wave? Is the pulse width measured high, low, or are both the same? NewPing waits up to MAX_SENSOR_DELAY for the echo pin to go high and then measures the time it's high. If the distance measurement is on the low state instead of high, it would obviously be wrong. Also, if you modify the sketch to trigger just one ping, how long will the echo pin give the PWM distance?

I'd try set the MAX_SENSOR_DELAY to a very large number, maybe a million. Also, set the ping rate to be very slow, like once every 5 seconds.

Tim

Yes nice square wave as per the snapshot I sent to your e-mail..

From the scope, the URM37 PWM pin is ALWAYS HIGH (5V) and when it is activated, it goes low instead... that is where I got my above measurements....

Codes from the URM37 using PWM passive mode :-

unsigned long DistanceMeasured=pulseIn(URPWM,LOW);

Mode 3: PWM passive control mode
Under this mode, a low pull on pin COMP/TRIG will trigger a sensor reading. The width of the pulse is proportional to the servo rotating degree. After a successful sensor reading, Pin PWM will output pulses, every 50us represents 1cm. If the reading is invalid, a 50000us pulse will be returned.