Measuring small distances

I want to measure distances between two sensors.
The distances would be under like 4 feet, with an accuracy of 2 inches.
I would need a signal 6-10 times a second.
Can you please recommend devices for me?

Thanks!

The ultrasonic range finder HC-SR04 can easily do this distance and accuracy (distance 2-300 cm, accuracy 1-2 cm), but don't know about its sampling frequency. I think it can do.

But this sensor doesn't measure the distance between two sensors, it measures the distance between itself and the nearest rigid object in "view".

What two sensors? Post links.

It would probably be easier if you told us what you were actually trying to measure.

That would answer lots of questions like are the two sensors always in sight of one another, are both moving or is just one moving, are they also turning? When you say "under like 4 feet" do you mean zero to 4 feet or what is the range variation? Are there any constraints on the size of the sensors?

Steve

I would try to do a pedometer, so both are moving, and at first it would be enough for each to fit on the top of a shoe. They wouldn't really turn, just move. the minimum distance between them would be around 4 inches. Thanks,
Patrik

Oh, a real pedometer that actually measures the size of each step, not just multiplying the number of steps by a constant. Nice!

Tough to do, since you want to measure both in front of and behind each shoe. You would need to put a sender or receiver on both the toes and the heels. Measuring small 'shuffle' steps may or may not be a problem, depending on the sensor chosen.

Regular ultrasonic sensors send out a 'ping' and then listen. Distance is measured by the time taken for the first echo to come back. The pings aren't special, so nearby sensors can hear the pings of others. Usually this is a disadvantage but it might be useful for you. Have sensor A send a ping but listen at sensor B. You would probably have to use wires up and down the legs as doing it wirelessly shoe-to-shoe is more difficult. (Not impossible, though.)

There's also a minimum distance because you can't send a ping of zero width. The ping has some duration and then you have to switch over to listen mode. That duration may be the amount of time that the sound travels 4cm, or something like that. Once again, this may not be a problem for this application.

I would say definitely get four ultrasonic sensors like HC-SR04 at Sparkfun and try it out on the bench. Ping one, listen at another.

Accelerometer can work here I think - so long as you correct for drift by detecting when the foot
has stopped accelerating (ie is on the floor), and reset the velocity variable to zero. The drift for an
accelerometer over the 1/3rd second or so of a step shouldn't be too huge (for long periods its
horrendous due to the double integration).

You need proper 6DoF device really, the gyro to understand the various rotations so that the acceleration
vector can be integrated in the right direction and gravity subtracted out.

This sort of thing, basically: