Laser Measurement (SF02) Setup & Library

Hi guys, I thought I’d share some experimenting we’ve been doing with the Lightware SF02. It’s a time of flight laser that performs exceptionally well in various environmental conditions.

For this project we used the Arduino Uno to query distances from the SF02, and for anyone interested in replicating this you can take a look at what we did in our setup here. I’ve also included the library we’ve written for easy interfacing with the SF02.


Terminal program to monitor Arduino output.


Wiring diagram between the Uno and SF02.

We’ve also written a super simple library that makes it very straightforward to query the SF02 for distance results.

// This is all you need to setup and get a distance
SF02.begin();
float distance = SF02.getDistance();

Of course this is just the very beginning of what can be achieved, and next we’ll be looking into some form of 2D environment mapping (With the goal of developing a navigation system for ground based robots). I’ve seen some very creative ideas with this type of technology before and I’d love to hear thoughts from you guys on its possible applications.

SF02.zip (3.31 KB)

My first thought was to rotate the laser range finder (LRF) in a plane that id parallel to the ground and make measurements of the range as a function of rotation angle to build a low budget LADAR system. I looked at the data sheet and the max sample rate was 12 Hz so the system would have to rotate very slowly to get a reasonably good picture from the LADAR. You would not have to rotate the system through the entire circle if you only need it for guidance because you only need to get a picture of where you are going not where you have been, in this case 12 Hz may be fast enough.

Thank you for your response wwbrown. Agreed, we also think that the speed of the laser module needs to be improved, and that is in fact the next objective we plan to look at for this project. We do have a few tricks we'd like to try, to see how far we can push the unit speed-wise. We understand that would sacrifice the maximum range of the unit (currently 40m), but in this case we believe that is a perfectly acceptable trade-off.

I'll be sure to post our methods and results here as soon as we have something.

Let me just add that we plan on taking small steps in this project, documenting each step in these forums as we go. So please keep an eye out for many more, hopefully, exciting progress posts! :slight_smile:

Hey hackers!

So we got a bit more time to work on this project and we have some pretty exciting updates to give you! Our objectives this time around were to improve our SF02 laser module's sample rate, make an initial attempt at mapping part of an interior area, and see how small an object we could detect in a relatively quick scan.

This is of course being done once again through the Arduino Uno, where we collected and stored our data in a packed format, which was then dumped to a PC for use in creating graphs. We plan to tackle data analysis and such things within the Arduino in the near future.

OK, so onto our results! Firstly, with regards to sample rate, we hacked around with the SF02 and eventually after modifying some code, were able to achieve a sample rate of 50Hz at a maximum range of 15m, up from the previous rate of 12Hz!

We then took a simple 90 degree scan of a room over ~5 seconds, giving us around 270 points. This can be seen in the image below. There are various walls, and a passage in the top left.

Our next scan was of the same room, also at 90 degrees, but done over ~1 second and with an obstacle. The results can be seen in the image below. As you can see we were able to pick up a 2cm wide object at 3.10m away (visible as the highlighted point below).

Hey again forum!

I'm back to report the results of our latest experiments with the Arduino and SF02/F laser module. This time around our goal was to see if we were able to track the movement of an object within an area. In this case the object we were tracking was the Arduino Robot! :smiley:

The addition to the top of the robot is an extended target for the scanner.

What we did first, was take an initial mapping of the static area, this would serve as our environment data set and be used to tell whether a point we read during tracking was part of the static area, or was in fact the object we were tracking. This scan was done at a high resolution, ~4 seconds over 90 degrees. You can see both the room and the mapping of the room below:

Once we had our environment data set, we ran our tracking scan, which was done continuously in a sweeping motion at a lower resolution, ~1 second over the same 90 degrees. In the screenshots below you can see the results of the robot moving through the area. The yellow poles represent scanned samples that are not part of the original environment data set.

With this information you can determine the movement path for an object in the scanning area:

There is potential here to use multiple scanners to achieve higher frequency tracking or even map an area that has obstructions.

keith1024:
Hey again forum!

I'm back to report the results of our latest experiments with the Arduino and SF02/F laser module. This time around our goal was to see if we were able to track the movement of an object within an area. In this case the object we were tracking was the Arduino Robot! :smiley:

hi! im interested to this topic. but i cannot see the linked images...
can you upload again?

thanks!