Let's Make Robots!

Laser Range Finder MkII

This is my second attempt at a homemade laser range finder now with video. I nearly gave up after hearing about the Sharp IR sensors but I think this has potential as it focuses on an area the size of a laser pointer spot. The other sensors work on a much larger area. After a lot of frustration I've finally got all the circuitry working properly and hope to have a video posted as soon as I work out one last difficulty. Click on the photo for a full sized image. This is a work in progress, not a finished product. I hope that by posting this blog I'll encourage you to experiment with the idea and hopefully you can suggest ways for me to improve it. I've now atached the subroutine used to test the scanner. It assumes only one object in scanning range and averages results.

Laser_RF_MkII_PCB__small_.jpgThis is the PCB which is 47mmx72mm (1 and 7/8" x 2 and 7/8"). I've attached the latest schematic for anyone interested. You will see I've crammed a lot into this little board.

Originally I designed this with a Picaxe 08M but have upgraded to a 14M. The increased ability to work 4 servo's makes it a small robot in it's own right and well worth the small increase in price.

This circuit could be made smaller and easier to program and build if you use a servo to aim the laser. You can then eliminate the hall effect sensor, it's amplifier and the laser scan motor control circuit. The down side is your resolution is limited by the servopos command to a range of about 100. This might still be a good place to start and I've included this version of the schematic as well.

I've opted to effectively make my own servo using a hall effect sensor for positional feedback. With its output amplified to give me almost 0V-5V output over the entire range of movement of the laser I effectively get 10x the resolution using the readadc10 command.

Word of warning to anyone making either version, a regulated 5V supply is critical for the phototransistor amplifier. I spent many hours trying to workout why the amplifier worked in the begining but not after I sorted out a few other problems with unrelated parts of the board. My batteries were getting flat and at that stage I was not using a regulator. The 4.7V was fine for the picaxe and all the other circuits but the biasing voltage on the amplifier transistors had dropped enough so that only the strongest signals registered. I recomend using a LM2940CT low dropout regulator, they are more expensive but will give a steady 5V even when your batteries are down to about 5.5V.

While on the subject of the phototransistor amplifier, I should mention that it needs a pulsating laser to register due to the coupling capacitors linking the stages. For this reason I have the laser fired by the same PWM output that drives the scan motor with a frequency of 4KHz. I found this was about as low as the picaxe would go and made it easier in the code to change dutycycle. with the period se to 249, the dutycycle in the code was 10x higher, e.g. 50% was 500.

Because PWM and servo commands use the same timer, you have to turn off the servos while the laser operates and turn the PWM off when operating the servos. Please feel free to suggest any improvements / changes. since the frequency and dutycycle aren't critical for the laser, it just needs to pulse at around 10%-50% duty cycle. I feel there is room for improvement.

Laser_RF_MkII_sensor_head__small_.jpgThis the sensor head for the MkII and my one remaining problem. I've tried to keep this as small as possible. I'm using a turret gearbox and motor from a tabletop remote control tank. I'm using a hall effect sensor (see the component section) and a small magnet (3mm dia. 2mm long) to monitor the angle of the laser.

My current problem is that the laser moves too quickly and when I drop the pwm dutycycle enough to slow it down, the motor stalls.

I'm presently trying to fit a more powerful motor from a toy helicopter so I can keep the small gearbox

For those of you who want to attempt the more complicated version of this, I suggest trying a mini servo such as the Hextronik HXT900 which are quite cheap and have a more powerfull motor.

Convert it to continuous rotation, remove the control circuit so you just have a small motor/gearbox and then mount the laser and hall effect sensor.

No matter what gearbox you use, you need to be able to scan the laser through about 45-60 degrees slow enough for the picaxe to register all 1000+ positions that your ADC/sensor setup is capable of producing. For example, if you are rotating your laser over 60 degrees then 30rpm would still be three scans a second considering you can scan just as well clockwise as anti-clockwise. If your using a faster processor or programming a pic in it's native risc language then you can probably scan a lot quicker.


This is my upgraded gearbox, the new motor should hopefully handle lower RPM without stalling. This huge monster is all of 16mm long compared to the 12mm of the previous motor and a whopping 1mm wider than the 6mm of the old motor. Hmm... that was exciting :(

Good news, the bigger motor can run at about half the speed of the original. Still started with a dutycycle of 8% with the laser mounted. This might work yet.














Make certain your phototransistor is aligned with your laser or your rangefinder will be short sighted. This is how it should look side on.



I think this was a problem I had with the first model and was made worse to some extent when I added a lense because I then had more optical components to align.


Updated 18/11/08


Was doing some test and rediscovered / confirmed that background light improves the sensitivity of the photodiode. I have tried previously to use the base pin on the phototransistor to bias it so as to improve sensitivity but with no success. I'm now looking at using an IR led to boost sensitivity.

I also discovered that a glossy object at the point of most sensitivity caused the oscilloscope waveform to vibrate in response to the slightest sound/vibration. This must be how those spy systems work where they shine a laser onto a window and listen in on conversations. I would have videoed this but my video quality isn't good enough to show the results on the oscilloscope.

I've uploaded two videos, still haven't got them to display properly so I've added the links below and a forum asking for help with the video. This is the first time I've made/posted videos so please be patient.


The first shows the signal from the sensor/amplifier that is feed to the digital input of the picaxe.


The second video shows the laser scaning and an object being detected.


 Updated 19-11-08

I'm not getting the range or resolution hoped for. I think range is an alignment issue so I'm going to build a more precise sensor head with the ability to calibrate the alignment. As for the resolution, some of this is just a matter of calibrating the hall effect sensor amplifier.




I've recently added the datasheet for my phototransistor but I've realised that they are not easy to find and other phototransistors may not work with this circuit. This is where I got my phototransistors from, I believe they do ship internationally although that might be expensive.

Although I'm quite happy with my phototransistor / amplifier my biggest problem is mechanical. Optical alignment is very important but also precision movement / position sensing is critical for accurate range finding with good resolution.

I think the MkII has gotten as far as is worth pursueing but has been very educational.

Thanks to previous work done my Mintvelt on object tracking and BOA's comments on potential flaws in this design I now have a MkIII design to start building which should be able to track an object as well as determine range. Poor Junior and BoozeBot will never get finished at this rate.

Keep an eye out for the MkIII.

laser_scan.BAS1.2 KB
Complete_LRF_Schematic.jpg201.83 KB
Simple_LRF_Schematic_II.jpg142.06 KB
LRF_modified_schematic.jpg202.51 KB
BPV11_phototransistor.pdf114.7 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Has any more work been done on this? I would love to get this as a kit or (gasp) even assembled for purchase. Maybe leaving out the laser part so the user can install their own laser module.

Thanks, I couldn't figure out why it didn't work with the diode, but after you said it should be doable, I tripple checked my circuit and realized that I had inverted the 2nd voltage divider :-(

Now it works fine, but I'll try to amp it - I'm picking up the LED at a max distance of 20cm or so with max sensitivity. I know it will probably be different with the laser, but I still think I should be getting better pickup than that.
When I use a remote control I can get approx. 1m. Will see what happens ones I get the laser.

I've experimented with smaller capacitors which works fine too - what are the math behind your choice of resistors and caps in what I guess is similar to 2 active high pass filters ?

You could try just installing the photodiode in place of the phototransistor (reverse polarity). Assuming your photodiode is sensitive to that frequency of light then the amplifier circuit shown might be enough.

Otherwise you may need to add an Op-amp to boost the signal. Google "photodiode op-amp schematic" and go to images. You will see plenty of different amplifier circuits.

Hi, this is a really interesting project !

I'm trying to build the part of your circuit which receives the modulated signal, using a photodiode instead of a transistor (because that's what I have...). But I can't figure out how to change the circuit for a diode - can you point me in the right direction ?

I'm still waiting for my laser module to arrive, so currently I'm experimenting with a LED which I pulse at 4KHz using my arduinos PWM output (50% duty). For testing I'm placing the LED right in front of the photodiode to make sure the diode picks up the light. 

I just read that thesis, it was incredibly awful. I imagine that guy did not pass his degree! (he did not deserve to,

going by that report).

I'm going to search for some more info too. 




 I don't know if this helps further your project or not but this guy has done a thesis on making a cheap laser range finder.

Might be some info of use in there.



See laser range finder made easy for more info on the phototransistor amplifier.
this may be asking much, but could you scan this schematic and check that everything is ok? I most likely will send this to my PCB manufacturer tomorrow.





Oh and I dont know much about hall effect sensors, but does the placement of these affect the rangefinder's performance,

same thing with the phototransistor amps, should I just scatter them? Or place them randomly?

It looks ok except that you show 3 leds in series with the laser instead of 3 diodes (1N004). These are just to drop the 5V down to about 3V for the laser as each one has about 0.6V drop across it. I'd probably keep the phototransistor amplifier components as close together as possible and away from anything like servos that draw a lot of power and generate noise.

Have you had this working on a breadboard yet? I wouldn't make a board yet unless you have. The results you get from this setup depend largely on the mechanical construction of the sensor head. Range depends on the alignment of optical components as well as power of the laser. Resolution depends on how accurately you can measure the angle of the laser. As I mentioned before a pot (1K-5K) could be  used instead of the hall effect sensor and negate the need for an amplifier. I've decided not to go any further until I can make a better sensor head which will possibly require some machined parts.

I'd like to see a photo of your sensor head or at least the parts you intend to use.

Oh I think I made a mistake, I searched 1n004 everywhere, and could not find anything, so I thought they were something else.

Because I made the things near the motor unit diodes, what are they actually?