I picked up an ultrasonic range sensor from Radio Shack... It looks like the same sensor is sold under other names, but basically it has 3 pins -- power, ground and signal...
You send a 5 microsecond pulse onto the signal line and then measure the pulse length that the sensor sends back -- the length of the return pulse is the time it took for the ultrasonic chirp to echo back..
Nice. and for distances up to about 17 inches, it does a good job -- readings are a little off, but repeated readings are stable...
However, if the distance to the closest object is beyond that... it just continually returns pulses indicating 280 inches... Problem is, I'm pointing it at a wall 6 feet away.
Radio shack rates the part to work up to 13 feet on an Arduino.
I've tested it on both an Arduino Yun and an Arduino Mega -- get the same behaviour for both.
I'm trying to get an idea what I can expect from this part.... and trying to come up with explanations for why it can't detect a wall 6 feet away..
In my application -- this may not matter.... right now I just want to make a simple obstacle avoiding robot... 17 inches is probably plenty of advanced warning of an obstacle
But I also would like to use this part, or one like it, in a home automation setting, where it will matter if I can sense objects 6 feet away.