laser/ultrasonic range finder

Thread Starter

nick.dellimuti

Joined Aug 30, 2010
3
i understand how a range finder circuit it self works however i find it very difficult to find any info on how to interface it to a digital circuit for calculating the distance if some one could point me in some kind of direction i would really be thankful
 
Last edited:

retched

Joined Dec 5, 2009
5,207
If you use the digital circuit to perform the ranging operation, it is self explanatory.

The uC (microController) sends the pulse from a transmitter and starts a timer.
The receiver, connected to the uC, stops the timer when the pulse is received.

So now you have the amount of time that the signal took to fly TO the object and BACK.

So you divide by 2, to get the amount of time TO the object.

Depending on what type of transmitter you are using, i.e. ultrasonic or laser etc., you can now divide by the speed that the signal travels in a millimeter.

That results in the distance in mm the object is away from the device.
 

tom66

Joined May 9, 2009
2,595
In theory that would work retched, I was thinking of doing something like that myself. But, the problem is, the speed of light is 299,792,458 m/s, so if you had a 1 MHz processor clock (say a PIC with a 4 MHz xtal), your resolution would be 299 meters.
 

retched

Joined Dec 5, 2009
5,207
In theory that would work retched, I was thinking of doing something like that myself. But, the problem is, the speed of light is 299,792,458 m/s, so if you had a 1 MHz processor clock (say a PIC with a 4 MHz xtal), your resolution would be 299 meters.
You better be using it for astral distancing. :)

1 ghz would be .29 meters.. thats not..too...bad.
 

hgmjr

Joined Jan 28, 2005
9,027
In theory that would work retched, I was thinking of doing something like that myself. But, the problem is, the speed of light is 299,792,458 m/s, so if you had a 1 MHz processor clock (say a PIC with a 4 MHz xtal), your resolution would be 299 meters.
Retched,

I think the point that tom66 is making with his comment is based on the fact that using the microcontroller with the parameters he has given would be limited by its sample rate. The microcontroller could not sample the returned signal fast enough to resolve time-of-flight signals that took less than several tens of microseconds to travel out and back.

hgmjr
 

Wendy

Joined Mar 24, 2008
23,429
This is the problem using µC, they can't and shouldn't be expected to do everything internally.

In the case of a LASER rangefinder it should be a self contained unit, feeding the completed measurements to the µC. This means using a internal high speed clock and fast logic.
 
I see this thread has been dead for a while, but thought I'd chip in anyway. I believe the way that a commercial laser distance sensor would work is by parallax. That is to say that the optical sensor would be at some known distance away from the laser source and the sensor would see the dot off centre by varying amounts depending on the distance, which could then be worked out by trigonometry.
 

WBahn

Joined Mar 31, 2012
30,076
The first thing to keep in mind is that the effective speed of light is cut in half because you are not measuring time of flight to the target, but time of flight to the target and back. Thus, instead of 1ns per foot of resolution desired, you only need 2ns/ft (rough numbers to keep things simple). So to get one meter resolution we are only talking about a timer that is running at about 150MHz. The next thing to keep in mind is that you don't need to run the MCU at 150MHz, only the timer. And the timer only has to run at that speed while a measurement is being made, so the fact that it will probably be a bit of a power hog is not a big concern unless measurements need to be made continuously (or with a very high duty cycle) -- but under those conditions you have to deal with the power needed to run the laser in the first place, anyway.

Direct time-of-flight is not the only way to make the measurement and, even with time-of-flight measurement, a high speed oscillator is not the only option. One way to get high time-resolution from low-frequency signals is to use two sine waves in quadrature synched to a relatively low speed counter. Your counter gives you your course measurement and your find measurement is obtained by capturing the amplitude of the two sine waves. Even with just an 8-bit resolution on this measurement you can extend the resolution of the timer considerably. Another approach is to modulate the transmitted signal and then phase lock another signal to the received signal and measure the phase offset between the two.

But getting back to the OP's request. He talks about it being difficult to find info on interfacing "it" to a digital circuit. What is "it"? A generic range finder? A particular brand of range finder? A specific model range finder? I would expect that how to interface anything to it is going to be highly dependent on the range finder in question and what protocol(s) it supports.
 

WBahn

Joined Mar 31, 2012
30,076
Oops, I didn't catch that this is a resurrected thread that has been dead for over two years.

@Milamberinx: It's one thing to resurrect a thread when you basically have the same question as the OP and are trying to move the thread to a more complete conclusion, but there isn't much point in churning up old threads just to add a comment, especially when the comment isn't related to the OPs quest. If you want a new discussion to start, it is better to start a new thread (then it is YOUR thread, instead of a hijacked thread belonging to someone else) and refer to the old one.
 
Top