Arduino Laser Range Finder

Great work...will you be selling these?? How much? When? Cheers :slight_smile: //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... :wink:

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... :smiley:

more to follow...

Laser,
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. :confused:

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

Thanks,
-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. :frowning:

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! :wink:

Gerber files showing the four layers of the PCB.

TESTING123.zip (2.87 KB)

Optics

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

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...

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! :slight_smile:

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)?

cr0sh,

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. :frowning:

Laser_Developer:
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.

Laser_Developer:
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...

Laser_Developer:
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. :frowning:

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:

http://xv11hacking.wikispaces.com/LIDAR+Sensor

...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...

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

Very interested in this. Let me know how i can get my hands on one of these!

the1cyrus:
Very interested in this. Let me know how i can get my hands on one of these!

For further information about the Arduino Laser please contact Tracy at: info@lightware.co.za

I'm very interested in using this for my master's thesis - your site says that the AL_01 is in production. How long after ordering would it take to get one of these to the southeast united states?

Thanks,
Tyler

Laser_Developer:
Optics

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

Hi it is good and you should sale a kit! :slight_smile:
How accurate it is in closer range 10 cm to 2M? What is the power consummation?

We've been hacking around with two AL_01 kits for a few weeks now in my research group and have enjoyed them immensely. I wrote a short post on our early experiences here: research group blog

The rangefinding works quite well enough for our purposes, esp. once we configured averaging = off by default in the EEPROM. We're using one of the kits to scan for movement at high relative speeds (30-50mph), so we learn more about the passing object from non-averaged data. Good times are experienced with 20+ Hz sampling rate.

We have, however, hit the memory ceiling for the UNO board (32k) and want to switch to a Mega 2560 for the extra headroom (256k), but the SPI pin mapping is different (Mega = 50-53 vs. UNO = AL_01 = 10-13). Is there a way to change the pins the laser board is looking for? This isn't a design problem with the AL_01 kit at all, it is primarily an Arduino programming question, so, OK to punt if you need to.

So far we have found in constants.h from the AL_01 Arduino sketch files:

// SPI Hardware
#define SPI_CHIPSELECT_PIN        10
#define DATA_READYN_PIN           9

I should note that our setup is Mega2560 --> Wireless SD shield (for datalogging) --> AL_01 board all snugly stacked on the header pins.

I also want to note that Tracy has been OUTSTANDING on support over email over the past month. I thought other folks on the fence about buying these AL_01 kits should know that. It is rare to get decent support these days but Lightware has really treated us well. I have no commercial connection to them so I can say that without bias. :slight_smile:

You may find a pretty good market for these LRFs in the small UAVs to be used for landing aids some of the smaller UAVs land by a controlled crash method as they do not have a reliable idea of how high above the landing surface they are. A controlled crash from 5 feet is much preferable to one from 50 feet.