Pew Pew! An Arduino Based Laser Rangefinder

Arduino Laser Rangefinder
Lasers are some of the coolest devices around. We can use them to cut things, create laser light shows, and also as a rangefinder.[Ignas] wrote in to tell us about [Berryjam’s] AMAZING write-up on creating an Arduino based laser rangefinder. This post is definitely worth reading.

Inspired by a Arduino based LIDAR system, [Berryjam] decided that he wanted to successfully use an affordable Open Source Laser RangeFinder (OSLRF-01) from LightWare. The article starts off by going over the basics of how to measure distance with a laser based system. You measure the time between an outgoing laser pulse and the reflected return pulse; this time directly relates to the distance of the object. Sounds simple? In practice, it is not as simple as it may seem. [Berryjam] has done a great job doing some real world testing of this device, with nice plots to top it all off. After fiddling with the threshold and some other aspects of the code, the resulting accuracy is quite good.

Recently, we have seen more projects utilizing lasers for range-finding, including LIDAR projects. It is very exciting to see such high-end sensors making their way into the maker/hacker realm. If you have a related laser project, be sure to let us know!

23 thoughts on “Pew Pew! An Arduino Based Laser Rangefinder

  1. There is just one problem with the “OSLRF-01”: “error, this product is no longer available”. Grrr…

    If you want to “bare-metal” reproduce this, consider the STM32F334. You can buy it on the cheap on a “Nucleo-f334r8”. It has a fancy “high resolution timer” that has a resolution of up to 4.6GHz, about 6.5cm at the speed of light (3.25cm round trip).

    1. I did not know that a super-fast timer peripheral like that existed. Is it a counter-timer, or just a timer? What I mean is, can you gate the timer so as to measure an input pulse, or can it only be used to generate output pulses from numerical settings?

    1. And how exactly are you planning to modulate the frequency of a diode laser?
      There was a post about an amplitude modulated laser range finder not long ago, but using AM instead FM comes at a cost…

      1. .. by using an AOM (acusto-optic modulator) to frequency shift the light. You don’t get much frequency shift (a few tens of MHz), but it’s enough to be applied in interferometric measurement systems that rely in heterodyne detection of orthogonally polarized, frequency-shifted beams.

      2. I meant: power the laser diode from a frequency sweeping generator. Then you add the signal from the generator and from the photo detector, detect the beat frequency which lets you calculate the distance. The advantage is that you do not have to work with GHz/ns cirtuits and detect single events but rather you work with MHz frequencies which is a bit easier (and probably possible even on a bread board).

        1. Most diodes are capable of this, though it all depends on the detection method. I was speaking more about heterodyne interferometry, which ultimately yields beat frequencies in the MHz range.

    2. Excellent idea. That is how OTH-B works. Sometimes on the ham bands in Alaska you can hear it sweep by. For a laser I think the modulation would have to be in continuous pulses. Long enough strings of uniqueness that the receiving detector and computer could lock in on the distance. Single pulses seem like child’s play.

  2. I didn’t understand this article at all, nor the explanation above. The time difference between real signal and reflected return needs to be measured to fractions of nanoseconds. That’s not what is happening, as the time being measured is milliseconds in the so-called “return”. OK, I finally found the principle here It is really a sweep adjustment of a slight phase delay of sub-nanosecond edge in a sampling period that produces the difference in signal– an alias of the return edge. As the system sweeps through the delay in the sampled periodic signal, the resulting summed differential input creates the pulse that looks like an ultrasonic delay. I still don’t really understand.

    A synchronous sample and hold amplifies the difference between random background light and the synchronous swept phase delayed signal. The circuitry doesn’t have the many GHz bandwidth needed for ps resolution, but averaged over many cycles there will be a difference in the slow sample and hold averages.

    If anyone has a better explanation of the operation of the circuitry in the schematic given in the arduino forum, please post it.

    1. Carl, you must have been paying attention in school. The synchronous sample and hold does indeed help. But you always need a range gate or the raw pulses might come back after receipt of the first then a subsequent transmission of another pulse.

      This is a beginning effort. Now it is up to us. sub-nanosecond monitoring of the upswing of the received pulse is not child’s play.

      I want to see a product made available that does this.

  3. The OSLRF-01 was designed as an educational and experimental kit for electronics enthusiasts who didn’t have the experience in dealing with extremely high speed signals. The idea was to offer those parts of a laser range finder that are hardest to design – laser driver, detection amplifiers, optics, time conversion circuits etc. Whilst this is still not a full LRF, it only requires knowledge of conventional electronics and software to make a complete system.

    After six months of small scale production, we haven’t been able to justify the cost of making the OSLRF-01. We lose money on each unit, which is not a bad thing in itself since it gives more people the opportunity to play with LRF technology, but without a critical mass of units going through the production process it becomes an increasingly expensive and time-consuming product to make. Sadly, we finally decided to pull the OSLRF-01 from production this month. LD

    1. It’s really a very clever design. Is there a document that explains the theory of operation? I can figure it out somewhat reading the schematic, but it would be nice to get an explanation from the original designer. It looks like there are 2 VCXOs, I presume tuned to slightly different frequencies, so there is a gradual change in the phase between the two, and so slightly changing delay before the sample FF is clocked after the fire FF is clocked. The SYNC shows when the 2 XOs are in phase, then opposite phase. But I didn’t quite follow the purpose of the counter or how the schmidt triggers change the signal, or how setup times on the D input of the FF affect the output transition.

      It would be interesting to see a diagram of the timing of all the signals with respect to the SAMPLE signal and how they are created with the logic gates in the schematic.

      It seems that the BOM on the page is for a different version of the schematic with different IC numbers.

      [If you didn’t want to go into too much detail, I’d understand.]

  4. Inexpensive as in priceless because it’s no longer available…. And looking at what else they have to offer, I don’t see any modules thats terribly affordable. This has happened more than once on HaD. I don’t blame the editors, but if they could please make an effort to vet their post a little better to make sure stuff is current, that would be awesome. Although that site does have the 70W OSRAM 905nm pulsed laser diodes at a decent price. It’s just coming up with a proper driver for them :\

  5. Nice post,Rangefinders are very neat technology. They’re useful on the golf course to help you make the best shot you can at any distance. And lasers have a greater magnification. They can also measure distance accurate to more than a thousand yards.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

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