I've been working on getting the OSLRF01 (Open Source Laser Range Finder) to provide Distance Readings, using an Arduino Fio, running at 8Mhz. My objective was to create a library to communicate with the OSLRF and make the interface easier for the end user.
After several iterations of my own, I exchanged emails with Tim Eckel, who wrote the NewPing Library for Ultrasonic Rangefinders , and have successfully created a version that will manage the signals from the OSLRF01.
Below are some images of multiple "pings" of the OSLRF sampled through the ADC of the Arduino.
At first, I had a problem with Ghost images. This turned out to be a problem with the way I was managing my timers during interrupts.
Similarly, once I got a handle on the overall timing structure, I found I was still getting some sporadic samples... Time to move away from "Arduino Code". The "price" for digitalRead(PIN) and analogRead(PIN) is many cycles... Tim's NewPing code cured this with converting to bitmasks, and doing bit manipulation of the ports. Significantly faster....
So now, we have a 100 ADC samples of 41 iterations, all neatly stacked on top of one another.
And here is an image of the "Zero" pulse (The outgoing Laser Pulse) superimposed on the Return Echo "Signal".
This represents 64 "pings" of 59 ADC samples. In here you can see I only had two bad samples, which are easy to remove with a median filter.
Now, using a slightly modified version of the NewPingExample Sketch
We get the following result... Very consistent and clean.
Tonight I will take all of my "commentary" out of the Library code, and push it up to Github for anyone else who wants to play with this Wonderful Laser Rangefinder!
Did I mention it's only $100USD !!!
Next up: Writing the code to retrieve and display Cartesian Coordinates of echo returns while scanning.
Next, Next up: Re-work all of this to fit on an ATtiny84 so I can finish my daughterboard I2C version....
LightWare Optoelectronics ...
Open source, TOF laser rangefinder
Google Code: arduino-new-ping
Example of driving ADC and DAC from timer for regular sampling
Advanced Arduino ADC – Faster analogRead()