Small-distance measuring

I would like to develop a small-distance measuring device that will be primarily used in indoor scenarios to measure a distance with cm accuracy (mm if possible). The device would be in a small form factor and would calculate the distance it has moved in reference to the starting position. However, upon doing more research I have found that this is a bit harder than I thought it would be. My initial idea was to utilize an accelerometer and take the double integral to determine displacement, however, I learned that this is primarily impossible with consumer grade accelerometers.

My current idea for implementation would utilize a small stationary external device that sends signals constantly back and forth measuring the difference in time it takes the wave of information to be received. I have looked online to find similar projects to this, but could not find any. Perhaps I haven't looked hard enough, but does anyone know if projects like this exist (preferably Arduino based)? If not then, would a simple consumer-based IR sensor work for this situation? Maybe I'm overthinking it and there's an even easier solution for measuring small distances with an external device. I could use some guidance on this. Thank you.

What you want to do is very difficult. It is a common request but I have not seen a satisfactory implementation of the many ideas that have been mooted.

A commercial system exists but it is expensive https://www.pozyx.io

Measurement Range: ~50mm to 2,000mm
Precision: +/-10%

This, of course, restricts the movement of the device being measured to a direct line in front of the measuring device. If that restriction applies to your unspecified application then go for it.

Can you put a camera over the top and observe the movement of the device from there?

An Arduino can’t do the necessary image processing on a camera but something like the Pixy can do it and send the result to an Ardiino or other device.

Grumpy_Mike:
What you want to do is very difficult. It is a common request but I have not seen a satisfactory implementation of the many ideas that have been mooted.

A commercial system exists but it is expensive https://www.pozyx.io

Ah yes, this does look like what I had in mind, thank you for the link. However, I suppose I was more looking to develop a system like this.

charliesixpack:
https://www.sparkfun.com/products/14539
Measurement Range: ~50mm to 2,000mm
Precision: +/-10%

Grumpy_Mike:
This, of course, restricts the movement of the device being measured to a direct line in front of the measuring device. If that restriction applies to your unspecified application then go for it.

Thank you for the suggestion, but yes, this restriction does not quite apply to the application I had in mind. Ideally, the object being used to measure the distance should be operatable without the reliance of any external walls. I was thinking of having a device that could move in any direction within a 3-axis plane and the displacement would be measured in reference to an external object that is within line of sight. So more like a transmitter-receiver scenario where the transmitter and receiver are each connected to different devices.

MorganS:
Can you put a camera over the top and observe the movement of the device from there?

An Arduino can’t do the necessary image processing on a camera but something like the Pixy can do it and send the result to an Ardiino or other device.

Thank you for this suggestion, however, ideally, the object I’d like to measure distance with would be operatable in a 3-axis plane with as little external devices as possible. So, I suppose one camera could work for 2-axis provided it has the processing power, but it wouldn’t work quite right moving it in the third axis without another separate camera at the very least.

Grumpy_Mike:
What you want to do is very difficult. It is a common request but I have not seen a satisfactory implementation of the many ideas that have been mooted.

A commercial system exists but it is expensive https://www.pozyx.io

Looking at the site, they have sort of "rebranded" the "DW1000 UWB-chip from Decawave"
They are about £20 a piece! But I guess 3 is all you need (1 tag and 2 masts?).

Digikey DW1000

There are a few datasheets there...I don't really get how the system works, but I am sure maybe having a look at the datasheet you may get something.

The maths looks a bit hard for an arduino maybe to do quickly? Maybe an ESP32 (240MHz) for example could help?
Youtube Maths for UWB

2 metre piece of string wound on a spring loaded drum, attached to the output shaft of an encoder.

3 pieces of string for 3D?

There have been other projects come through here which hacked the regular ultrasonic rangers to use one to transmit and one to receive. With careful measurement of the delays on a simple wireless transceiver, this even worked wirelessly.

If you can have a number of emitter stations with known, stable positions then it should not be too hard to do 3D within the normal range of these rangers. Maybe up to cubic-meters size with the accuracy you asked for.

Another solution is to hack a Microsoft Kinect. They seem to be relatively easy to work with. I don't know about cm accuracy.

You can try using geometry. An IR led emits a cone at some angle, can you measure the width of illumination on a surface and check against the height (surface may not be normal to the axis of the IR cone, won't get a circle) ?

Somewhat the same; if you split a laser beam to make two parallel beams that hit a surface, will you not get an interference pattern -at the target surface-. And again. what if the target is not flat and normal to the beams?

Your spec is so wide open that very few conditions to take advantage of don't have a host of spoilers. With the right objects you might use capacitance or EM field, for example.

Johnny010:
Looking at the site, they have sort of "rebranded" the "DW1000 UWB-chip from Decawave"
They are about £20 a piece! But I guess 3 is all you need (1 tag and 2 masts?).

Digikey DW1000

There are a few datasheets there...I don't really get how the system works, but I am sure maybe having a look at the datasheet you may get something.

The maths looks a bit hard for an arduino maybe to do quickly? Maybe an ESP32 (240MHz) for example could help?
Youtube Maths for UWB

Thank you very much for this link, this more or less looks like exactly what I'm looking for. I will look more into this as a potential solution.

bluejets:
2 metre piece of string wound on a spring loaded drum, attached to the output shaft of an encoder.

I'm not entirely sure how this works or quite honestly what it is, is there any documentation or website I can examine that can explain how this setup works/functions?

MorganS:
3 pieces of string for 3D?

There have been other projects come through here which hacked the regular ultrasonic rangers to use one to transmit and one to receive. With careful measurement of the delays on a simple wireless transceiver, this even worked wirelessly.

If you can have a number of emitter stations with known, stable positions then it should not be too hard to do 3D within the normal range of these rangers. Maybe up to cubic-meters size with the accuracy you asked for.

Another solution is to hack a Microsoft Kinect. They seem to be relatively easy to work with. I don't know about cm accuracy.

I'll look into projects that have hacked ultrasonic sensors to work in the manner I am seeking, thank you for the tip. But ultimately yes, in my scenario I would have a number of emitter stations with known stable positions. I don't know too much about the kinect, but it seems as though it might not lead to the most efficient solution for what I am looking for. But thanks for this tip as well, I'll look more into it.

GoForSmoke:
You can try using geometry. An IR led emits a cone at some angle, can you measure the width of illumination on a surface and check against the height (surface may not be normal to the axis of the IR cone, won't get a circle) ?

Somewhat the same; if you split a laser beam to make two parallel beams that hit a surface, will you not get an interference pattern -at the target surface-. And again. what if the target is not flat and normal to the beams?

Your spec is so wide open that very few conditions to take advantage of don't have a host of spoilers. With the right objects you might use capacitance or EM field, for example.

Hmm, this sounds interesting, but a bit more complicated than what I had in mind with measuring the time between waves of signals. But thanks for the tip, if some of the avenues I attempt don't work out I will definitely try it out/look more into it

In another thread the subject of industrial laser parallax sensors came up.