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

Human:
For me, any loop() delay >= 21ms yielded zero false negatives when testing stationary objects, between 1cm and 50cm from the sensor's emitter.

Is there any reason this should be? Just a variation between specific hardware and the spec? I don't mind using 39ms to be safe, but there seems to be a very harsh cutoff between the behavior at 20ms delay and the behavior at 21ms delay.

Yes, the sensor may very well timeout after at certain amount of time, and that timeout could be different for different sensor manufactures. This is probably why it works at 1ms for me because my sensor probably resets as soon as it gets a ping echo while another model may not.

The limit I suggest using is 29ms, not 39ms. That's based strictly on the speed of sound and the sensor range spec of 500cm. 29ms should be safe for just about every sensor because almost all have a maximum sensor distance spec of 500cm (and in reality in most cases it's less than this). Lower than 29ms may work, but it very well may not work, or give non-reliable results (like what you were experiencing).

Tim