Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LM565 as phase comparator/detector

Status
Not open for further replies.

Mr CCE

New Member
Hi there,
im currently trying to calculate the phase difference between two signals:
One that im receiving from a remote location-wirelessly- and the other is locally generated.

my question is:
- can i use the LM565-PLL's phase comparator(pins 2 and 3 as the two inputs and pin 5 as the output voltage) to find the phase difference in the form of variable voltage?

thx in advance!;)
 
Yes, bear in mind you don't get a DC output, it's a variable width pulse, the smoothing components convert this to DC - and need to be carefully selected, as detailed on the datasheet.

You might also consider the 4046 PLL, it's a cheap CMOS device with a VCO and two different phase comparators.
 
Or you can condition the two signals to be CMOS logic levels. Feed them into the two inputs of an EX-OR gate. Pass the resulting output through a low-pass filter, and you will have a voltage proportional to the phase difference.
 
Or you can condition the two signals to be CMOS logic levels. Feed them into the two inputs of an EX-OR gate. Pass the resulting output through a low-pass filter, and you will have a voltage proportional to the phase difference.

One of the 4046 phase comparators is an XOR gate.
 
Or you can condition the two signals to be CMOS logic levels. Feed them into the two inputs of an EX-OR gate. Pass the resulting output through a low-pass filter, and you will have a voltage proportional to the phase difference.

Look at this
 

Attachments

  • PhaseComp.gif
    PhaseComp.gif
    90 KB · Views: 1,376
about the XOR gate with low pass filter

hi again,
first thx for the reply,
second:

- i want to ask Nigel Goodwin about the smoothing components: do U mean timing resistor/ timing capacitor? and if so how to choose them?

- and about the XOR with the low pass filter: R= ?, C = ? n' would it give me variable DC according to variable phase difference ?

thx a lot in advance!;)
 
Look at my sim again. The varying phase is simulated by having the frequency of the A signal slightly different than the B signal. Note the PWM output at output of the XOR. Note the "averaged" output at Out1.

The RC time constant of the low-pass needs to balance "ripple" output vs how rapidly the phase of the two inputs can change. In a PLL, the filter output cannot have hardly any ripple, so an aggressive low-pass is used. For most applications, the low-pass filter is usually implemented as a multiple-pole active filter, such as a unity-gain Butterworth Sallen-Key filter.
 
about the replies...

Hey guys i really can't thank U enough.Really.

you've been the most helpfull resources so far.I'm gonna experiment a bit and tell U how it turns out.

Thx again n' keep up the good work fella's:D
 
Don't forget that the apparent phase-shift depends upon accurately converting each signal to a square-wave with the transitions at (or very near) the zero crossing point of each waveform. Depending upon the frequency, you may need high-speed, low offset, analog comparators for this conversion.
 
Next step

hey guys,

After calculating phase difference if the form of variable voltage; how to interpret this voltage as distance?? in meters say?

thx in advance:rolleyes:
 
To Mr. "probably doomed to failure"

- First of all, it's not like it's never been done before; Distance measurement through RF is used in many applications.

- Second of all, have U ever tried it? i don't so. If I were able to get an indication that two objects are distant from each other by a variable x, then this variable can absolutely be used or perhaps utilized in such a way to estimate, up to a certain accuracy, the distance in question.

- Third and last, "probably doomed to failure" has no equivalent in my dictionary.

thx a lot!
 
Considering that you didn't state your distance range, it might be unfair to say it can't be done by a student. If you want the distance to/from the moon to the nearest kilometer, then your project certainly has been done and you could probably repeat it with a little bit of luck.

Since you're asking about the LM565, which has a maximum operating frequency of 500 kHz, you appear to be working in the realm of microsecond precision. At the speed of light, (and radio waves), a kilometer is three microseconds.

I confess my prejudice when I read of such projects comes from all the students who want to measure distances to the nearest millimeter using radio waves in a school lab. They express total shock and dismay when someone leads them to discover that a picosecond is 1/1000000th of a microsecond as a millimeter is 1/1000000th of a kilometer.

Distance measurement with RF has been done; hams do moon bounce all the time. On a student budget you might find their results difficult to reproduce, but good luck.
 
Last edited:
to mneary

Hi there and thx for the reply,

i didn't want my reply to be like my last but i hate it when someone, eventhough undirectly, tells me that it just won't work.

thx again for the reply.now to get to business.I'm using an RF module that is capable of reaching 100 meters, and im doing this Project at the University, so im giving it 100% of my time and effort, and as such im gonna demonstrate it on campus and on a relatively small area(a couple of meters!!)

The data that im sending is a bitstream (a byte actually) at the rate of 2.4KHz. The carrier of the RF module is 433MHz (ASK).

for phase difference im gonna try XOR with low pass filter to give me phase difference in the form of variable voltage: 0V < phase difference < 5V

If U have any suggestions, please don't hesitate.
thx in advance.;)
 
- First of all, it's not like it's never been done before; Distance measurement through RF is used in many applications.

Not using licence free radio modules it isn't.

- Second of all, have U ever tried it? i don't so. If I were able to get an indication that two objects are distant from each other by a variable x, then this variable can absolutely be used or perhaps utilized in such a way to estimate, up to a certain accuracy, the distance in question.

If you think it's so easy, feel free to do it :D

Do the maths, and work out the speed and precision you need.
 
About the RF distance measurement thing..

hey there everyone,

I've been trying with my project lately and I came up with these results:

1- My first approach was to use Signal power as a parameter to be utilized to determine distance.This did not go well since I'm using a ready made RF transmitter with a range of 3000 Km!! so obviously no change in power would be detected.

2- Second, I tried the phase detector consisting of an XOR + RC(low-pass filter) but I got a constant reading so I need someone to tell me how to choose the values of R and C (probably I chose wrong values:().

3-Now I'm planning on calculating the round trip time to figure out distance as follows:

TX1 ----> RX2
RX1 <---- TX2

where I will use a Microcontroller to start a timer as soon as TX1 sends the data and the timer will stop as soon as RX1 receives a confirmation signal.

but I need some advice to pull this off so it would be greatly appreciated, and I know that all of U guys are professionals, so any advice would really help.

thx in advance.;)
 
Your data is 2.4kHz, and you're running the sent and received signals through a phase detector. The propagation (wavelength if you will) is about 12 km. One eighth of that (round trip, 90 degrees) is 40km. So your phase detector gives you 0-Vcc from a measured distance of 0-12km.

2) Using 5V as Vcc, and assuming your timing on the phase detector is set to maximize the slope, your phase detector should give you a voltage delta of (5V/12km) or about 400 microvolts for a one meter distance change. Can you consistently measure 400 microvolt changes? It would require a 4-1/2 digit multimeter, for example, to measure to the nearest meter. Your phase detector power supply should be stable to 100 parts per million to avoid introducing spurious results.

3) Using a timer, assuming a 10MHz clock rate, each tick of the timer equals a round trip distance of 30 meters (round trip 15 meters). That's your basic resolution, assuming a perfect transmitter/receiver..
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top