EmbeddedRelated.com
Forums

FREQUENCY TO VOLTAGE CONVERTER using ADC?

Started by electro April 6, 2006
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!

On 6 Apr 2006 08:55:41 -0700, "electro" <electromagnetic377@yahoo.com>
wrote:

>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?
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
electro wrote:
> 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!
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.