FREQUENCY TO VOLTAGE CONVERTER using ADC?

i have a certain sine wave input in the 480 khz range.i would like to make a pseudo frequency to voltge converter by using the ADC of my pic16lf876a..

any reaction?is this possible?

thanks!

Reply to
electro
Loading thread data ...

Yes it's possible. Depending on numerous unstated requirements, using an ADC might be overkill.

JJS

Reply to
johnspeth

thanks.. assuming an 8-bit resolution,how will it relate to my input freuquency?

my application is a metal detector. i have an lc tuned copitss oscillator where my loop antenna acts as my variable inductance..the common practice is beating this with a certain frequency and extract the difference.. for my part, i would like simply to have some ways to translate the frequecny change in to a voltage change the simplest way.i tried f>v converter but they have low frequency input...

Reply to
electro

You can use the ADC if you put a frequency to voltage converter in front of it. What I'd use is a phase lock loop.

Or just run the signal through a signal conditioner and comparator into an interrupt pin and measure the wave period. If you count a decent number of cycles over a fixed time period you should be able to get your frequency measured as accurate as you want.

Peter

Reply to
Peter

And what do you want to do with the voltage? Drive a meter? produce a tone? or use the signal in the digital domain. I suspect that just want the frequency shift a a numerical value in which case feeding the osc into a counter sampled regularly to get a frequency number, then just subtract base frequency. You could have a push-botton that tells the micro to take the current measured frequency as the base. Just make sure the micro has a stable clock source i.e use a crystal not an RC osc or ceramic resonator.

As for analog output - an DAC, PWM or counter driven square wave (for freq out).

Peter

Reply to
Peter Dickerson

Sure. For example, you could trigger a 1us monostable from the input waveform, low-pass filter the CMOS output and feed that to your ADC. Only a few parts, depending on the input amplitude.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
 Click to see the full signature
Reply to
Spehro Pefhany

i would like to use the voltage as an indication of a change in ambient frequency due to a close metal... my initial idea was to full rectif the sine wave signal and extract its dc content... but since i wil be using a pic with adc capabilities..im now looking for ways to use that.. do i really need an interface between my instanteanous analog 478khz or say 296khz sine wave and the ADC port of my pic?isnt it it is an analog to digital converter?so why still need an interface?

thanks!

Reply to
electro

The ADC measures analog voltage, not frequency. Which do you want?

You can also measure the frequency directly with a PIC using on-chip counter/timer hardware, but I fear you are in well over your head on this one.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
 Click to see the full signature
Reply to
Spehro Pefhany

Looking at some of his other posts on the topic I think it's critically dependent on input aptitude, which I fear is low :-)

--
Nobby Anderson
Reply to
Nobody Here

The short answer to your question is that you need circuitry to provide a proper electrical (signal) interface between the signal source and the ADC. The ADC has specific requirements of what it expects to be driven with, and if these requirements are not met, you will get, at best, erroneous results.

I agree that, based on some of the questions you are asking, it appears that you are in over your head on at least some portions of this design. It happens even to the best sometimes. You might, however, wish to see if you can find a consultant who may be able to help you along with some of the portions you are having trouble with.

Reply to
Noway2

thanks!

how about using the built-in comparator? since i have a sine wave with zero dc offset, can i simply measure the time interval between the zero crossings? that is using a reference voltage of o volts? and use the time difference to determine my frequency...

or can you think of other?

thanks!

Reply to
electro

You have to sample at least twice the Nyquist frequency, in this case you would need to take over 1 Msample/s. I haven't looked at the PIC specification, but I very much doubt that it would go that high :-).

However, there are several ways to interface to the ADC. As already mentioned, the 1 us monostable and a low pass filter would be an option.

Assuming that the input signal has a constant amplitude (or driving preamplifier into saturation) and assuming a relatively large frequency change, just put a steep low pass filter after the signal source, rectify the signal and feed the DC signal to the ADC. The rectified signal voltage is now inversely proportional to the frequency due to the low pass filter. With a high pass filter, the voltage is proportional to frequency. How strong the dependency is, depends on the order of the filter.

Apparently the frequency does not change very fast due to the manual movement of the inductor, so it would be practical to divide down the frequency, with say a 12 bit CMOS divider chain down to about 100 Hz and run this into the ADC or preferably to some digital input pin and from there determine the period and frequency.

Paul

Reply to
Paul Keinanen

That might work. I would suggest that if you approach the problem this way, that you use a couple of comparitor / opamps with sufficient hysteresis to avoid false triggers. The limiting factor you may run into with this approach is the input resolution of the digital inputs on your PIC. I believe I read in another post to consider using a divide by counter. That would be a good idea.

Another approach would be to use a PLL, possibly with a divide by circuit. The PLL would be a lot more noise immune than a comparitor and input capture circuit.

Reply to
Noway2

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.