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

Stanley:

teckel:
Reading the documentation, it appears that it will work with the NewPing library. It does appear that you would need to change the US_ROUNDTRIP_CM to 50 and US_ROUNDTRIP_IN to 127 for the distance calculations to be correct.

With that said, if you don't already have the URM37 and there's not a good reason why you need to buy this specific one, I would suggest getting one that's known to work with NewPing. As a bonus, they're also cheaper than the URM37.

Further, if it was me, and I already had this sensor or was required to use it for another purpose, I would use the serial interface instead of the trigger/PWM interface. There's many benefits of using the serial interface, including setting up automated pings, not waiting for ping echos, getting temperature, etc. They've also created a serial library for the sensor so you don't need too much effort to get it working in this way.

If you do get the sensor working with NewPing, let me know. I'd like to hear your experience.

Tim

Thanks for the reply...

I could not get it to work with the NewPing libraries after making the changes to the header file... :~

Instead I use the serial library for the URM37 but still have some issues on using two sensors at once....

I'm using this as a people counter sensor to be mounted at the ceiling of retail store...

Did you wire it to use PWM passive control mode instead of the serial? Also, it's possible it needs a longer MAX_SENSOR_DELAY or trigger length. Anyway, if you can't get it to work correctly with 2 sensors using the serial method, you could send it to me and I'll try to get the PWM mode working with NewPing and then send you the sensor back. It seems as though with a little tweaking it would work. And if so, when you got the sensor back you could implement both sensors. I'd like to add support for this sensor so it's worth my time to try to get it working for you.

Let me know.

Tim