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.

  • please delete the wifi and bluetooth tags .... those two technologies are not for measuring distance and are not related to your question – jsotola Dec 19 '18 at 23:18
  • the wifi and Bluetooth tags are there as they are possible means of wireless communication that I would have liked to explore to coming to the solution for the specification I am outlining here. Bluetooth and wifi can and have been used to measure the distance between two objects. However, I have not found one to the spec I have mentioned – mon potato Dec 20 '18 at 0:34
  • people researching wifi or bluetooth problems will get your question as containing a possible solution ... do you honestly believe that an accepted answer to your question will actually be of use to them? – jsotola Dec 20 '18 at 0:43
  • No, you're right that people searching for wifi or bluetooth problems will probably not have any use with this topic. However, the topics of wifi and bluetooth are related to this topic, and is that not what tags are for? Because I imagine people researching wifi or bluetooth problem are likely not going to find answers in a majority of the topics tagged with those subjects here (briefly looking through the list of tagged questions that is). – mon potato Dec 20 '18 at 0:47
  • maybe you could use an optical sensor from a mouse ..... it appears that you want to measure the total distance traveled ..... note: distance in reference to starting point is different from distance traveled, if the travel path is curved – jsotola Dec 20 '18 at 0:55

Try to take a look to Lidar sensors.

Here an interesting guide by SparkFun.


Look at Ping sensor also. Ultrasonic, way less expensive than Lidar.

Ultrasonic ranging module HC - SR04 provides 2cm - 400cm non-contact measurement function, the ranging accuracy can reach to 3mm.


Give it a shot, see if the $4 solution meets your needs.

  • Thanks for the suggestion, however, my specification would require the object in question to work reliably without any nearby walls to reflect the ultrasonic sensor back to it. – mon potato Dec 18 '18 at 17:53
  • So sound won't bounce back - will light (LIDAR?) Are you looking for some mechanical means of measurement? – CrossRoads Dec 18 '18 at 18:14
  • Light wouldn't work unless it was targeted to the device in question (ultrasonic would work in such a manner as well, but i'm not sure if either is capable of this). 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. – mon potato Dec 18 '18 at 18:32
  • Maybe you could use call back method with a beacon. Target sends out a request, beacon sends it back. Target calculates how far away based on time. Have the target send it out in several directions while rotating in place to determine where the shortest direction is. Course, radio waves travel at the speed of sound. So sound may work better, give you a chance to measure more than just the response time of the beacon. Or put the Tx unit on a servo and pan it around so you're not changing the target's orientation all the time. – CrossRoads Dec 18 '18 at 19:17
  • Yes, that sounds like it might be possible, any recommendations/ideas on specific hardware? – mon potato Dec 18 '18 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.