time difference of arrival help

Status
Not open for further replies.

wowowee

New Member
i need help. i want to ask what is the equation for computing the time difference of arrival of infrared and ultrasonic signals. i'm using a 40kHz ultrasonic module and i used the gp1u52x as infrared receiver.
 
You know the speed of both, it's just simple maths!.

However, you can ignore the speed of light, as it's essentially instantaneous (compared to the speed of sound) - any minute difference it might make will be massively swamped by varioations in the speed of sound (due to air pressure, temperature, humidity).

BTW - while you can ignore the speed of light, there is a delay associated with the modulated IR reception, you would need to measure that with a scope.
 
yeah, i know the speed of the two signals and i'm planning to use this equation:
d = (Ssound - Slight) * T
where: T = time difference of arrival the two signals.

can i apply this equation? BTW im using pic16f877 for computing the TDOA of signals.
 
Like I said, there's no point using the speed of light, it's far too fast to make any difference - although the response time of the IR receiver may be long enough to have an effect?, you would need to measure it.

Why are you wanting two signals anyway?.
 
i use two signals because the ir signal is supposedly used as a trigger for the timer of the pic in the receiver. and when the ultrasonic signal arrives the timer stops. then i'm gonna use that time and use the equation to get the distance. but i get your point that the speed of light is ignorable. so i can just use the speed of sound, multiply it with the time obtain. right?

and what if i use phototrans as the ir receiver, will there still be a delay in the response?
 
Have a look at the datasheet. Photodiodes are generally faster so you might be better off using one.

How accurate do you want this to be?

You might want to include a temperature and pressure so you can compensate for the speed of sound changing under varying conditions.
 
yeah. but i read that phototransistors have very small range about 2inch. is it true? because i'm planning to place the modules 1-2 meters apart.
 

I still see no reason for the IR?, you start timing after you've sent the transmitted ultrasonic pulse (plus a delay to avoid direct reception) - there's no need (or use) for an IR system as well. Don't forget the flight time is BOTH ways, so will be double the distance.
 
i'm trying to implement trianulation using 1 transmitter and 2 receivers which. the transmitter has its own pic and another pic for the 2 receivers.

**broken link removed**

i need the ir signal to start the timer of the pic at the receiver and when that timer will stop when the us signal is received.
 
now my problem is that the us signal will arrive first than the ir signal. can you help me with this? is it okay to use phototransistor for this? my arena is about 2 meters long. is the phototrans capable of that range?
 
wowowee said:
now my problem is that the us signal will arrive first than the ir signal. can you help me with this? is it okay to use phototransistor for this? my arena is about 2 meters long. is the phototrans capable of that range?

You simply need to amplify it's output, then it's range can be the same (or more) than a receiver IC. However, it's not a trivial task to produce a system anywhere near as good as a receiver IC.

Have you measured the response time of the IR receiver IC's?.

You also don't seem to be thinking 'micro-controller' very much? - the IR is 'instantaneous', so can be ignored - but the response of the receiver needs to be known (easily measured with a scope). Simply delay the ultrasonic pulse by the response time of the IR receiver.

So:

1) Send IR pulse.
2) Delay IR response time.
3) Send ultrasonic pulse.

This means the ultrasonic pulse is transmitted at the correct time for the receiver timer to be started.

I would also suggest measuring the response time of the ultrasonic TX/RX path as well!.
 
okay. actually all the testing i've done was purely analog. what are the possible problems that i may encounter when i test my circuit using a microcontroller? do you have good suggestions?
 
wowowee said:
i need help. i want to ask what is the equation for computing the time difference of arrival of infrared and ultrasonic signals. i'm using a 40kHz ultrasonic module and i used the gp1u52x as infrared receiver.
There is absolutely no way you will EVER use a PIC to measure the 1nS/ft speed of light.

Triangulation is a not a good method for a hobbyist since due to the output power required to be useful at a distance.

A much better direction/range determination is achieved with a radar beacon style system. A focused beam gives you the range, the direction the beam is pointing gives you the direction, and the transit time of the echo give you the distance.

As far as a hobbyist not being able to measure the transit time of light...hogwash! There are through hole parts that would allow you to do it. Take it from one with experience in design as opposed to some who only lead you to believe they do...I have done designs that measure 0.02nS in hardware economically, a relative term in this case, and repeatably to my surprise...and could have done better.

With this part $12 part hung off any 10MHz counter you can effectively measure distance with light to an accuracy of 1 foot by comparing the time that the subdivided counter runs out to the time the light returns. Successive approximation finds which foot within the 100 foot resolution of the 10MHz counter you are actually looking at. Having more than double the number of steps in the delay line allows you to easily calibrate the delay line to the main oscillator by running the master clock in to the delay line and finding two rising edges.

Of course accuracy will then depend on your main oscillator... I my case it was a 100MHz osc at 1PPM/DegC and an overall of 5PPM at 10 years and only 3PPM of phase noise. A nice $260@25pc component that was a good idea 3 years ago for a precision test instrument but a tad overkill for a hobbyist! Today I would use a $6 20MHz one with similar stability and a PLL sacrificing noise performance, that can be filtered out, for price.

Don't let the less knowledgeable tell you otherwise!

Dan
 

Attachments

  • DS1023-DS1023S.pdf
    251.7 KB · Views: 185
i got this link and they used pic16f84 to get the the TDOA of ir and us signals.

**broken link removed**
 
cadstarsucks said:
There is absolutely no way you will EVER use a PIC to measure the 1nS/ft speed of light.

No one has ever suggested he could, nor is he wanting to, perhaps you should read the thread before you jump in?.

Don't let the less knowledgeable tell you otherwise!

Do you have special wide doors to allow your head through?.
 
Nigel Goodwin said:
No one has ever suggested he could, nor is he wanting to, perhaps you should read the thread before you jump in?.
Actually the original question WAS about the speed of light and the speed of sound. Later in the thread was the actual application of triangulation was brought up.

My post, which I am sure your only purpose here was to try to discredit, explained how he actually could measure the transit time of a light pulse to measure distance.

Dan
 
cadstarsucks said:
Actually the original question WAS about the speed of light and the speed of sound.
But that was ruled out on the second post, the rest of the thread was purely about the speed of sound and taking into account for the response time of the infrared sensor.

All Nigel is saying is that it's a good idea to read the whole thread first rather than blindly jumping in.
 
i'm really sorry guys, i'm kinda new to microcontrollers. but in the link below they transmit the two signals simultaneously and uses the same modules that i'm using. i'm really worried now.

**broken link removed**
 
hi wowowee,

As Sam says you cannot measure the speed of light using a PIC, you have to use external circuitry.

My commercial pulsed laser range finder measures to an accuracy of 0.1mtr upto 500mtrs. Max range is 5000mtrs, but accuracy becomes a percentage of the range over 500mtrs.

In your case, as it says in OP, its not the speed of light that your interested in, just the 'response time' of the circuits, emitters and detectors.

For the very short ranges you are working over, forget about radiated IR transit times, its instantaneous as far as your application is concerned.

The IR pulse is just a sync/trigger for the remotes detector timing logic.

The easiest solution to get the 'overall delay' is to position the TX and RX units, say, exactly 1mtr apart and measure the 'apparent' range in the RX.

In your PIC program you can deduct the 'apparent over' range/distance value from the known 1 mtr calibration distance to give you 1mtr.

The problem is that the response time of the RX detectors is a function of the signal strength they receive. ie: the stronger the received signal the shorter the response time and the 'apparent' distance is shorter.

The further apart the TX and RX units are, the weaker the signal, so the 'apparent' range will increase with distance.
If you determine the response delay for a TX/RX pair over say, calibration distances of 0.5/1.0/1.5 mtrs, it is possible to apply some correction to the apparent range within the PIC program.

If you have 3 remote RX units, its most likely that they will have different RX response times.

Eric
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…