Go Down

Topic: Arduino Laser Range Finder (Read 134650 times) previous topic - next topic


Jun 18, 2012, 03:24 pm Last Edit: Jun 27, 2012, 01:50 pm by Laser_Developer Reason: 1
Getting Started

This post covers some of the design elements of an Arduino Laser Range Finder (LRF) shield and provides links to other resources for anyone who wants more details. The design performance of the LRF is:

Range: >25m
Resolution: ±5cm
Update rate: >20 readings per second

The Arduino Laser shield uses a version of the DS00VQ100 timer/controller chip to handle the firing of the laser, gain control of the receiver and timing of the signals. The optical section is a modified DS00/50 module from LightWare.co.za. It has an Osram SPL LL85 laser running at Class 1 power levels and an S238x APD detector from Hamamatsu.

The Arduino Laser board is 4-layer with solid ground and power plains on the inner layers. This provides better high frequency performance than a 2-layer board, something that's important for an LRF where digital and analog signals are mixed up on the same board. The board material is regular FR4 with 35um copper - nothing fancy. The trick to being able to use this conventional PCB layout is that the highest frequency signals are inside the controller chip, not rushing through the tracks on the PCB.

AL_01 Arduino Laser controller board.

One of the key components in this design is the laser diode. This is an SPL LL85 from Osram which is actually a hybrid made up of a high power, pulsed laser chip, an avalanche FET driver and two capacitors. This compact device produces short flashes of light (about 30ns long) and gives high optical power with very low electrical interference. It is important to understand that whilst the peak optical intensity may be as high as 14W, the average optical power is less than 1mW, making the device safe to use around people.

Osram SPL LL85 hybrid laser.

The hybridization of the SPL LL85 laser means that the high current (10 Amps) and high speed (nanosecond) signals are kept inside the package. This makes the design of the laser driver circuit board much easier and it only needs to be double sided.

Laser driver board.

Another key component in the Arduino Laser design is the optical detector - an avalanche photo diode (APD) from Hamamatsu in Japan http://sales.hamamatsu.com/assets/pdf/parts_S/s2381_etc_kapd1007e09.pdf. I've always found these devices to have astonishing sensitivity to the very weak optical signals that the LRF is going to get from distant target surfaces. APDs behave rather like photomultiplier tubes, giving a flood of electrons for every photon that they detect. As a comparison, a regular photo-diode produces about one electron for every two photons that it "sees", whilst an APD typically produces 100 times this number. You might think that a photo-transistor would do the same thing as an APD but the problem with photo-transistors is that they are far too slow to measure signals that are rising and falling in just a few nanoseconds. The APD looks and works just like a photo-diode but needs to be biased at more than 100V DC to get the "avalanche" effect to work properly. Changing this bias voltage alters the "gain" of the APD making it possible to increase or decrease sensitivity as required.

APD gain as a function of the applied bias voltage.

Laying out a board to carry the APD is a little tricky. The high voltage bias tracks to the APD must be kept well spaced from other components. Also, the track between the APD and the pre-amplifier input mustn't have any ground plain underneath it, otherwise the additional capacitance slows down the return signals.

Receiver board.

In the next post, the boards are assembled and tested...


Jun 22, 2012, 12:19 pm Last Edit: Jul 11, 2012, 05:24 pm by Laser_Developer Reason: 1
Building the Circuit Boards

There are three PCBs that need assembling - the Arduino Laser controller board, the laser driver board and the receiver board. These are going to be soldered by hand, even though they mostly have surface mount components on them. I've avoided QFN and BGA packages so this should be no problem.

The first board is the laser driver. In the picture below you can see that it has an FFC cable header on the left and the laser component on the right. The mounting holes match up with the optical alignment parts which will be discussed later. The laser board was tested by connecting it to a DS00 kit (it's pin-for-pin compatible). The outgoing laser light is invisible to the human eye (IR at 850nm) so to see it I used a florescent card but it is also visible on a webcam or mobile phone camera. Even though the laser light is made up of very short pulses, a camera integrates these pulses over the exposure time so it looks like a steady beam.

Laser board assembly.

The Arduino Laser shield is now complete. Communication between the Laser shield and the Arduino uses the SPI port, a CS line and a Data_ReadyN signal. This leaves the other Arduino ports available for another shield. Along one edge of the Arduino Laser shield there is a row of test points that can be configured to show the laser pulses (outgoing and return). There is also a trigger (falling edge) to synchronize an oscilloscope to the firing of the laser. Without getting into any detail on how the DS00VQ100A chip works, the signals that appear on these test points can easily be seen with a conventional, 10MHz oscilloscope.

Arduino Laser Shield completed.

The most important component on the Arduino Laser Shield is the DS00VQ100A timer/controller chip. This takes care of all the real-time and high speed activities of the laser range finder including: firing the laser, adjusting the APD bias voltage, timing the instant that the laser pulse leaves on its way to a target, timing the instant that the laser pulse returns from the target (the time-of-flight) as well as some housekeeping like adjusting the gain of the amplifier, measuring the noise in the system so that it can be controlled and communicating with the Arduino. The only problem is that this particular chip doesn't exist yet! I'll take an off-the-shelf DS00VQ100 chip and re-map the port pins and some of the internal functions to suit the Arduino Shield. This new version will be called the DS00VQ100A with the A standing for Arduino and I'll try to squeeze it all into an Actel FPGA (update - the chip reconfiguration has gone well and all internal functions test out OK).

The next board is the receiver that carries the APD along with a trans-impedance pre-amplifier (TIA). The APD picks up the weak return flash from the target and converts it into a small current. This is fed into the TIA to be amplified and converted into a voltage signal. For a target at about 10m away, the signal amplitude after the TIA is only a few millivolts so it needs to be further amplified by the main controller board. The most important design consideration for the receiver board is the speed of response to the short laser pulses that get amplified. Full gain bandwidths of more than 200MHz are necessary to preserve accurately the shape and edge steepness of the signals. There are a few layout tricks that help to achieve this goal. For example, most of the signal lines are differential to reduce pickup and minimize high speed oscillations. Also, stray capacitance is kept to a minimum by selectively removing the ground plain around some of the APD and TIA pins.

Receiver board assembly.

All the boards are now finished and the picture below shows them connected together using FFC cables. The cables are to allow the optical section (still to be added) to be "scanned" using a stepper motor whilst the Arduino and its shields remain stationary. All the electronics has been tested and found to be functional - amplifiers, timers etc. Once the optical parts have arrived it will (hopefully) take just a few minutes to assemble the whole thing, after which performance testing can be done. Looking forward to it... :)

AL01 Arduino Laser Shield without optics.


Great work...will you be selling these?? How much? When? Cheers :) //O.


will you be selling these?? How much? When?

No plans yet Oddpxl. I guess if there's enough interest I can make the boards open source or maybe offer a complete kit. The parts I'm using are expensive but it might be possible to swap the APD for a pin diode (losing a lot of range in the process) - I'll test it out. Right now I'm just doing this for fun! I gotta get out more... ;)


Jun 27, 2012, 01:48 pm Last Edit: Jul 03, 2012, 09:45 pm by Laser_Developer Reason: 1
Software Development

Whilst I'm waiting for the optical components to arrive, I've made a start on the software. Please forgive my limited knowledge of programming and especially programing the Arduino. The code has been designed to convert into a library, making it easy to interface with other Arduino code. The main functions are:

hardwareSetup() - defines the port pins to the Arduino Laser shield and starts the SPI bus.
laserStart() - starts the laser measuring.
laserStop() - turns off the laser.
settingsWrite() - writes values to the registers in the DS00VQ100A controller chip.
signalCheck() - checks that a valid return signal is being detected.
noiseCheck() - measures how much noise is being generated by the APD and amplifiers.
distanceRead() - returns the measured distance in meters.

Tests have been done on the software whilst simultaneously running a stepper motor shield (single motor only). The Arduino Laser Shield can be polled or trigger an interrupt if a fast update rate is needed. When running the stepper it is easier to poll the Laser shield so that smooth stepper operation can be maintained.

The Laser software is small (<4k) and easy to integrate into other programs - it just takes a few simple lines of code to initialize the laser and then request results. What makes this process so simple is that the shield has it's own, autonomous control system that handles all the measuring operations, so the software only has to take action once a result is available. In contrast, the stepper motor shield needs constant attention from the software whilst the motor is stepping. I guess this opens up the possibility of designing a chip that handles both the laser range finding AND stepper motor control so that autonomous scanning can take place whilst the Arduino spends its time analyzing the results. Sounds like fun... :D

more to follow...


I'm in a summer internship where we're making an arduino sensor brick to mate to an Android handheld.
(I'm on the hardware side, not the Android side. There's 14 of us altogether.)
I love what you've come up with. I was trying to find a DIY just like this.
You've confirmed my suspicions that it won't be easy.

We've only got a few weeks of this summer left to finalize our work.
I'd love to get a schematic and / or Arduino code for what you've done so far.
There's five of us that work in a local EE type fab facility, but I don't think we can do four layers.
I remember hearing their machines can do two layers.
If worse comes to worse we can just scrub this end of the project, but I'm hoping you can help me out here.

Also, would your design allow for extended use as a long distance break-beam? Or is your laser diode too high power for that application?
According to the datasheet, if it draws 14 W avg, then I can only run it for like 20 minutes constant, not very long. :/

Even if it's not double-duty, I'm interested in just the ranging.

-Ian Wolford
SATE 2012
@Tec^Edge Works


Hi Ian, thanks for your interest in this topic.

It might be a bit short notice for your project. :(

The biggest difficulty in designing your own LRF is that some of the components are really hard to get. The Arduino Laser Range Finder uses custom made optics, a specially designed controller/timer chip and a host of tricks to get the thing small enough and with low enough power consumption. The electrical power requirement is less than 1W even though the laser produces a peak power of 14W (the average laser light power output is just a few milliwatts).

My feeling is that the only way to get this kind of technology into the hands of Arduino users at a reasonable price is to offer a kit containing all the hard-to-get parts and then let the user buy the rest of the parts locally at the best price that she/he can find. In all honesty though, I'm not sure that many people would want to buy an LRF kit.

There's some Arduino test code attached that drives a stepper motor into a particular direction then takes a distance reading from the LRF (sorry, it's not properly documented, we just banged it together in a few minutes to test the principle of operation). This is the starting point for a scanning laser that could be used for obstacle detection on a small robot.

The schematics aren't very interesting I'm afraid because all they show are lots of connections to one big chip (see image below). I'll post them on the lightware.co.za website when I've finished with testing - still waiting for the last mechanical parts. If there is enough interest I'll make the design open source (Creative Commons).

There's no problem in making the device work as a "single ended" beam-break. In this configuration, one end of the beam is the LRF whilst the other end is a retro-reflector (like a car/bike reflector or reflective tape). I guess that 100m range would be quite possible with the existing optics and maybe 300m with larger lenses.

If you give me a bit more warning when you do your next project I'll try to be more helpful! ;)

Gerber files showing the four layers of the PCB.


Jul 10, 2012, 05:28 pm Last Edit: Jul 11, 2012, 05:47 pm by Laser_Developer Reason: 1

The optical components have arrived at last!

The lenses are 25mm diameter on both the laser and receiver. In the case of the laser, the purpose of the lens is to collimate the outgoing flash of laser light. This is necessary because, unfortunately, the light that comes from a semiconductor laser doesn't have a nice parallel beam. Instead, it comes out in a distorted cone shape that needs to be made parallel in order for the laser light to travel as far as possible without getting spread out and becoming too faint. This collimation process is often done with very fancy optics in order to get the maximum theoretical range. In this design however, a single lens element should be enough to get the laser beyond the 25m range specified for the design. The diameter of the laser beam will be the same as the laser lens (25mm) as you can see from the picture below.

The laser beam projected onto a Phosphor card

The lens in front of the receiver serves a different purpose. It acts as a light gathering area that focuses the rather weak return signals from the target onto the APD detector. The bigger this light gathering area is, the greater the distance that the range finder will be able to measure. This makes it very easy to increase the range - just use a bigger lens. For the purposes of this design, the 625 mm2 of the receiver lens should give us the desired range.

Optics - front view

From the picture above you can see that the optical arrangement is very sturdy. This is necessary to ensure that the alignment of the lenses stays absolutely fixed. If this alignment changes then the laser will end up pointing in one direction whilst the receiver points in another - and that means no return signal!

To get the laser and the receiver lined up correctly in the first place there is an alignment and focus mechanism for both the laser and the receiver circuit boards (see below). These mechanisms have three degrees of freedom (the ability to be adjusted independently in three orthogonal axes, X, Y and Z). By adjusting the position of the laser and receiver whilst watching the strength of the return signal on an oscilloscope, it is quite easy to achieve almost perfect optical alignment.

Optics - rear view


Jul 11, 2012, 05:47 pm Last Edit: Jul 12, 2012, 09:59 pm by Laser_Developer Reason: 1
Testing the optical alignment and signal strength at long range

The AL_01 Arduino Laser Range Finder has test points along one edge that can be configured through the SPI port to show various signals that are on the main board or inside the controller/timer chip. In the setup below, the two 'scope probes are connected to the outgoing laser pulse and the return signal. The power supply is delivering 7.5V to the Arduino external power input and you can see that the whole system is drawing 148mA. Running the AL_01 using USB power is not recommended because some of the components need a stable +5V supply from the Arduino's on-board regulators.

Test setup

The outgoing (blue) and return (red) signals can be seen on the high speed PicoScope trace shown below. A measurement on the oscilloscope shows that there is approximately 263.2ns between these two pulses. From this time measurement, the distance to the target surface can be calculated as follows:

         distance  = speed x time / 2

where speed is the speed of light (c = 3 x 108m/s) and time is 263.2 x 10-9s giving

         distance = 39.48m

The "divide by two" in the equation comes about because the light travels to the target and back again, in other words, twice the measured distance.

Outgoing and return signal traces

Using this setup, the AL_01 was able to measure to a wall 40m away. There are a few tricks to getting this extended range. Firstly, the main amplifier has programmable gain so this can be set higher to make really small signals big enough to measure. The penalty in doing this is that the reading becomes less stable because both the signal and any electronic noise are amplified. Another way of boosting the range is to increase the bias voltage on the APD. This also increases the noise but by judiciously cranking up both the amplifier gain and the APD bias voltage it's easy to reach 40m and beyond...


Jul 12, 2012, 10:16 pm Last Edit: Jul 13, 2012, 06:30 pm by Laser_Developer Reason: 1
Checking the accuracy

Measuring distance using the time-of-flight of a laser pulse can be a tricky business as you may already have gathered. So, now that we have an LRF that gets return signals from a target surface some distance away, this signal needs to be timed really accurately because the laser light travels pretty darn fast. Fortunately, the timer/controller chip takes care of this. Unfortunately, it's only as good as the signals that it receives.

Since this Arduino project has been done using the most basic configuration that I could think of, it has some limitations, mostly in terms of the amount of noise that gets superimposed onto the signal from various sources including the Arduino's processor, the firing of the laser and the power supplies. This noise is particularly noticeable right after the laser fires and it moves the return signal around by a few hundred picoseconds from its ideal position. This translates into centimeters or even tens of centimeters error in the distance measurement. The chart below demonstrates this effect, with the signals close up to the LRF being less accurate than signals that are more than a few meters away. In a somewhat counter intuitive twist, the Arduino Laser Range Finder actually gets more accurate as the target to be measured gets further away!

Accuracy chart out to 8m range


And now for the fun part...

Below is a picture of the Arduino AL_01 Laser Range Finder hooked up to an Arduino Uno and a 2.8" TFT display, aiming at a wall 35.0m away. Mission accomplished! :)

So I guess the next question is what to do with it.

It could be used as an altimeter in a UAV. It could measure how deep a hole is or how much material is in a silo or hopper. Add an angle sensor and it could measure the height of a tree.

It could be moved using a servo to generate 2D images used for navigation by a robot.

Connect up two servos and you could make a 3D scanning system to measure the size and volume of large objects. Include a specific gravity calculation and it could tell you how much material is on a stock pile.

Mmm, I'd better go and find a customer...

Thanks for reading. LD


So - how much in parts did this cost (discounting labor/design time, the LCD, Arduino, etc)? Could you offer it as a kit? Would it be competitive with the Parallax LRF (currently the lowest off-the-shelf cost solution out there for laser range finding)?
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.



I'm sure that's a question on the mind of anyone interested in laser range finders or maybe just looking for a better way to measure the distance to something. Before I give a direct answer, maybe we could look for a moment at the other range finding technologies available to an Arduino user and consider them in terms of their price and performance.

Firstly, there's the short range devices made by Sharp that use an LED and optical triangulation to give a proximity signal. These sell for $11 to $30 and have a corresponding range of between 0.8 and 3m. To put price on this technology we could say that it costs between $10 and $14 PER METER of distance measured.

As a comparison, an ultrasonic range finding product like the Ping sells for about $30 and has a range of 3m. This gives it the economical price of $10 PER METER but it is known to suffer from limitations when measuring to smooth surfaces at oblique angles.

Next comes the Parallax LRF with a price tag of $130 and a measuring range of only 1.2m. This gives it the hefty technological price of $108 PER METER. This is a very cool product because it can measure to oblique surfaces (unlike the Ping) and can aim at a target surface with pinpoint accuracy. However, the relatively slow update rate (once per second) and susceptibility to background light put it firmly in the category of "amateur" grade sensor (sorry Joe, no insult intended).

In contrast, "professional" laser range finders such as those made by Loke have a much faster update rate (10x per second or more) and are not susceptible to background light. They can measure out to between 30m and 35m at the exciting price of $2250 to $2465 giving these LRFs a technological price of between $70 and $75 PER METER measured. This is a much better price per meter than the Parallax LRF but is a significant investment for the average user.

Finally, with apologies for my prevarication, I think that the Arduino AL_01 laser range finder could be manufactured as a kit for about $350. With a range of more than 40m this makes it the cheapest technology available at $8.75 PER METER. And it can measure to surfaces at any angle, can update at more than 10 readings per second and is totally immune to background light.

But, just because I think it uses really cool and cost effective technology doesn't mean that it's a commercially viable product. My feeling is that for an LRF to have wide appeal it has to retail below $100 and there is no way to get the parts of AL_01 down to this kind of price level. :(


I'm sure that's a question on the mind of anyone interested in laser range finders or maybe just looking for a better way to measure the distance to something. Before I give a direct answer, maybe we could look for a moment at the other range finding technologies available to an Arduino user and consider them in terms of their price and performance.

That's a great way to answer this question; I'm glad you provided this breakdown, because I did notice that your sensor seemed to be more on par with the professional level sensors, as far as distance, accuracy and update rate capabilities. I'm pretty familiar with the capabilities of the other sensors mentioned, so it was nice to see this breakdown.

Finally, with apologies for my prevarication, I think that the Arduino AL_01 laser range finder could be manufactured as a kit for about $350. With a range of more than 40m this makes it the cheapest technology available at $8.75 PER METER. And it can measure to surfaces at any angle, can update at more than 10 readings per second and is totally immune to background light.

That is very inexpensive for what you would get; I think you would get more than a few takers on that, especially if you marketed toward university robotics students and labs, perhaps. Whether you would get enough to cover overhead, etc though is questionable...

But, just because I think it uses really cool and cost effective technology doesn't mean that it's a commercially viable product. My feeling is that for an LRF to have wide appeal it has to retail below $100 and there is no way to get the parts of AL_01 down to this kind of price level. :(

I definitely understand you there. Right now, it seems like one of the "best" bang-for-your-buck LIDAR sensors for hobbyists is the sensor in the Neato XV-11; according to this:


...it has a maximum distance measurement capability of about 6 meters. Since an XV-11 costs about $400.00 USD, that translates into about $66.00 per meter (which is much cheaper than the Parallax option; I can see why it would be a better investment). Your's is still cheaper by far on that measurement, but the XV-11's sensor also does a 360 degree sweep fairly quickly, is smaller, etc. For most hobbyists this is more than enough. I'm not trying to diminish your accomplishment at all, I'm just trying to illustrate why someone might choose that sensor over other options.

I remember when Neato was first starting up that they had stated that they would release the sensor as a separate part for the hobbyist market at a price-point of around $25.00 a unit; that never happened, but it would have certainly been a coup (~ $4.00 per meter!). Maybe they did a market study or something and even at that level it wasn't worth it. Maybe the market is just too small for such a sensor currently.

There's also the Microsoft Kinect - though that requires an entire computer to use properly, of course; it has a range of about 3.5 meters - costing about $100.00 USD, that translates into about $28.00 per meter of distance (but it is also 3D and has a very fast update rate). It's usefulness is limited, though, to smaller robots, given its limitations.

I do see that as possibly changing - and your sensor might be a leader of the pack in that regard. If the interest in self-driving vehicles continues, we could see a lot more hobbyists and others begging/demanding/developing low-cost LIDAR systems. Your system, mounted in some way on a fast-scanning servo or done in some other means - could allow for a longer distance 2D LIDAR system more ideal for vehicles that need the extra range and update speed, due to vehicle traveling speed.

Something else - how does your sensor cope with full-sunlight outdoor environments? This is one area that I've never seen data on for almost any sensor, but when you start talking about self-driving vehicles, it becomes a necessity. I have no idea how the Kinect or the XV-11 sensor would cope with sunlight...
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.


Jul 15, 2012, 10:33 am Last Edit: Jul 15, 2012, 10:38 am by Laser_Developer Reason: 1
Something else - how does your sensor cope with full-sunlight outdoor environments? This is one area that I've never seen data on for almost any sensor, but when you start talking about self-driving vehicles, it becomes a necessity. I have no idea how the Kinect or the XV-11 sensor would cope with sunlight...

Dealing with sunlight is quite a complex technical issue. As far as I am aware, all the inexpensive sensors (Parallax, Neato etc) tend to lose signal when the background light conditions get too bright. This is due to a combination of detector saturation and an increase in detector noise. The AL_01 eliminates these effects in two steps. Firstly, it removes as much of the unwanted background light as possible by using a very narrow band optical filter in front of the APD detector. This filter has a pass band that closely matches the optical frequency (color) of the laser so that the return signal can get through whilst the stop band blocks the background light. In the picture below you can see that the optical filter casts a shadow that is comparable with that of the tweezers.

The narrow band optical filter in direct sunlight

Whilst the optical filter is a big help in eliminating the background light, there is always a small amount of unwanted light that sneaks through the pass band. This is because sunlight has a very broad, continuous spectrum that contains some light of exactly the same frequency (color) as the laser. This light gets superimposed onto the return signal as a DC offset and whilst this can mostly be removed by AC coupling the optical detector, the additional energy of this light increases the noise in the detector. Managing detector noise, especially in a sensitive device like an APD, can become a major project in its own right. The timer/controller chip in AL_01 has a special hardware function that continuously monitors the noise and warns the host processor (the Arduino) when it needs to adjust the APD bias voltage to bring the noise back to an acceptable level. In the picture below, the background noise and APD bias voltage are represented as 8-bit numbers. The timer/controller chip can tolerate huge amounts of noise before the distance measurement starts to be affected.

Background noise and APD bias voltage shown on the TFT display

Go Up