Laser Rangefinder Brought to Life With Arduino

Range finders are amazing tools for doing pretty much anything involving distance calculations. Want to blink some lights when people are nearby? There’s a rangefinder for that. Need to tell how far away the next peak of a mountain range is? There’s a rangefinder for that. But if you’re new to range finders and want one that’s hackable and configurable, look no further than the SF02/F rangefinder with the Arduino shield, and [Laser Developer]’s dive into what this pair can do.

Once the rangefinder and shield have been paired is when the magic really starts to happen. Using USB, the Arduino can instantly report a huge amount of raw data coming from the rangefinder. From there, [Laser Developer] shows us how to put the device into a “settings” mode which expands the capabilities of the rangefinder even more. The data can be dumped into a graph, for example, which can show trends between distance, laser strength, and many other data sets. [Laser Developer] goes one step further and demonstrates how to use this to calculate the speed of light, but from there pretty much anything else is possible as well.

And while you can just buy a rangefinder off the shelf, they are fairly limiting in their features and can cost exponentially more. This is a great start into using a tool like this, especially if you need specific data or have a unique application. But, if laser range finding isn’t for you or if this project is too expensive, maybe this $5 ultrasonic rangefinder will work better for your application.

17 thoughts on “Laser Rangefinder Brought to Life With Arduino

    1. i tried to use the red bricks, by scamming a teensy in the battery compartment and having a teensy in the battery compartment. Observation A) there seems to be a massive current requirement for fireing the laser, even with an external power supply I had resets of the microcontroller. B) The protocol seems to have changed a bit. Its a project that became so frustrating that its unfinished.

      1. I don’t think you can blame the hardware, if something you connect to it, doesn’t work.

        The microcontoller inside the unit must be able to withstand the spike otherwise the unit wouldn’t work.
        Like @AKA the A says…

        You need to add come capacitors etc to decouple the supply of the Teensy to withstand power fluctuations
        (actually you may need more than just caps but unless you are saying the internal microcontroller runs on a lower voltage than the Teensy — which may be true — you should be able to get it to work on the same battery.

    1. You can buy surplus military HW…
      If you live in Europe, for a reasonable price you can get your hands on a LPR-1, a fairly old Soviet rangefinder, that while officially is realiable to about 5km, under ideal conditions and with a large target it is said to go up to 20km…
      They are starting to become rare, the Bulgarian versions are cheaper, but much worse…(still over 4km reliable readings though)

      That being said, these old tend to be fairly powerful and not eye-safe, so careful about that…

    2. For long range perhaps a different approach is better? For example two cheap telescopic gun sights with Raspberry Pi cameras attached. One sight is fixed and the other is on a servo, with a known distance between the pivot points, you then use OpenCV to keep the images aligned on whatever you are tracking and a magnetic compass module on the moving (rotating) sight tells you the angle required to use trigonometry to determine the distance. Such a set-up has the advantage of being passive, however is would need to be larger to work accurately.

      Another variation would use a single sight that is moved sideways and the two or more measurements are integrated to find the distance. This is the same as finding the z-depth of a single pixel when using multiple images to reconstruct a 3D scene, so it is simple enough to do in real time.

        1. Shop around, you could be right depending on how you implemented it, but you need one set of optics fixed and the other rotates in relation to it. It is that angle, plus the known separation that you use to find the distance. Angle A is 90, B is variable but less than 90, and you have one known edge on your triangle D, the separation between the scopes. This is why the bigger D is greater B angle is for a distant object, therefore the easier it is to get an accurate angle calculation. I suggested compass modules, but even an encoder and some step up gearing should let you get useful numbers.

          1. The required precision would kill you on cost…there are very good reasons why nobody uses stereoscopic range finders any more, speed of measurement is just one of them…

            I was referring to the fact that you could (at least theoretically*) take a cheap laser range finder and bolt it onto a pair of better binoculars, that way you would get much better optics…

            *binos are for people and don’t have the AR coatings for the NIR band that the laser uses, military ones will probably even block the NIR bands to protect eyes from laser range finders…but with reasonably priced binos the gain would probably overpower the losses from the uncoated glass…

          2. How are you going to recalibrate the range-finder to account for the change in range if you add more optics in front of it, and why to you think it would be better when that method also multiplies the error by the same factor?

            The 2 scope method would not be slower than a standard laser range finder as it is taking continuous readings, it is just a lot bulkier due to the need to have D as large as possible. By tracking I mean this fast, https://www.youtube.com/watch?v=1IHmzQ_mGAo

  1. you can get surplus speed enforcement Lidar units for as much as that thing costs and most of them have serial ports for dumping data, and a little poking around in them could yield all sorts of data to play with. All the ones I own do range finding as well as speed.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.