The module consist of a red laser and a very small camera. It emits a pulse, grabs a frame and calculates the distance to the reflected laser dot. It has four interface pins. Power, ground and two serial communication lines. Sending the command ‘R’ will tell the module to take a reading and send the data back.
I decided to test mine on an Arduino and build a setup that could be mounted to the back of my vehicle as a backup proximity warning device. Something that would readout the distance on a dash mounted LCD and sound an audible warning below a given threshold. I had a 16 x 4 reflective LCD on hand from Element 14 that I needed to review anyway so I used that as my readout display. I got some help with the Arduino code from my friend Roy Eltham. He was a great help in this project so here’s a shout out to Roy! “Thank You!”
Breadboarding the project took a couple hours and after uploading and tweaking some code, it worked! I could get readings as close as 150 mm and as far as 2.4 meters! It was time to put it all in some enclosures. I found two plastic projects boxes at Radio Shack that suited my needs and set to work. After about 8 hours of build time over two evenings it was complete. The Laser Range Finder (LRF) was in one box and the Arduino and LCD were in another, The two were linked via a length of twisted pair CAT5 cable. I hardwired to the LRF and put an RJ-45 connector on the main display box. With the help of some 3m two sided mounting tape I attached everything to the vehicle and I was ready to test!
The first thing I tried was backing up to my white garage door. It was mid day so it was very bright outside. This would be a good test of blob detection. The bright light would make it more difficult to find the bright spot from the laser. This was a beta test after all. Why not test the boundaries. I started out about one meter from the door, turned the unit on and got a reading of 0000 which meant that it couldn’t find the blob. So, I slowly backed up and at 547mm it showed a reading. It was evident that the bright light was hindering blob detection.
So, what to do? I remembered from my photo experience that a filter might help. Since the laser is emitting red light, how about a red filter? The camera would see everything in shades of red and the laser dot just might stand out as the brightest. I had covered the LRF box with a piece of clear acrylic. I removed it and with a red Sharpie marker, colored both sides red on the half that covered the camera and left the laser side clear. I installed the acrylic and went back to testing. I started out at about one meter again, turned the unit on and YES! I had a reading! The red filter worked. I slowly moved the car forward and I was able to get distance readings all the way out to 2.3 meters. Success!! The LRF also has a command to adjust the exposure to current lighting conditions. This is done by sending ‘E’ to the LRF. I implemented this in the code and it also helped with blob detection outdoors.
This is a great piece of hardware. Joe really did his homework on this one, and it will only get better before final release in the next month or two on the Parallax website. I can see this being used on robots as a distance sensor, which a few beta testers have indeed done. I plan on using it on another robot project in the near future as a forward looking edge sensor.
Great job Joe Grand! Thanks for letting me beta test!
Keep On Hackin…