Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

need help.. frequency to voltage converter using PIC

Not open for further replies.


Newbie level 4
Oct 1, 2009
Reaction score
Trophy points
Activity points
my project is frequency to voltage converter using PIC.
but i dont know suitable PIC for my project..
i am also dont know how to complete this project..

the project is to read input frequency and give the output in voltage..

for example like below..

input (hz) / output (v)
100 / 0.1
200 / 0.2
300 / 0.3

i hope you all can help me..
thanks to all..

Added after 22 minutes:

can i use 16f887a?

If you want to capture the frequency digitally and produce analog voltage output, you would need an analog to digital converter. One simple way to produce analog voltage would be to generate a PWM signal and run in through a low-pass filter. So, in this case you would need a PIC that has two CCPs: one to capture the frequency, the other one to produce PWM output.

thanks for information given...
can you explain it in more details?
do you has done it before this?
if yes, can you share in detail how to complete my project?
i hope you can help me...

You can use timer of PIC to calculate the distance of two conservative edges of frequency. You will get a time, inverse the time to get the frequency, you may also need to do some more math to get the frequency. Now for the voltage part. It's upto you, as how to transmit the signal out from controller, there are many ways.

It depends on the nature of the signal you wan't to measure. If its a digital signal with ttl/cmos level you can just connect it directly to an I/O (conf. as input) port and threw a simple polling program you can monitor the pin incrementing a timer each time the input changes. You could then generate a timer interrupt with a known timout value (much lower frequency than the measured signal). The frequency would then be the number of changes divided by two (period) times the timer timout value.

For the analog output you would be better of with a DAC with a serial interface.

What is the maximum amplitude that we can apply to the adc port of pic for measuring frequency...

thanks all...

umery2k75,,can u explain detail how to produces the output as you wrote here...

my question now is, the output is in PWM, but how it will range the voltage from 0-10 because the amplitude of the PWM is still same..if i use 10v amplitude, and then 1 will use low pass filter, it is can give the output 1 volt?
what the value of R&C and delay to get 1 volt?


natasyaeva said:
my question now is, the output is in PWM, but how it will range the voltage from 0-10 because the amplitude of the PWM is still same..
Yes, the amplitude remains the same. However, the average voltage is different for different duty cycles. If you can generate 1V output with 10V PWM, the PWM duty cycle should be 10% (i.e. 10% of the period at 10V and 90% of the period at 0V).

natasyaeva said:
what the value of R&C and delay to get 1 volt?
RC value depends only on the frequency of PWM. It doesn't depend on the duty cycle and output DC voltage. The RC constant of the low pass filter should be, 10 times the frequency of PWM or greater.

TC9402 is a V/F converter, but a chip module.

thanks for all the information..
mr kender..if i want the maximum frequency are 100khz, that mean RC must 100K x 10 right?

any body can explain how low pass filter change square wave voltage to dc voltage..i had try in simulation but dont get the result,,,

natasyaeva said:
how low pass filter change square wave voltage to dc voltage.
Suppose we have a square wave between 0 and 5V. In frequency domain it will have components at: DC (0 Hz), then fundamental frequency (the frequency of the square wave), then harmonics. Low pass filter attenuates the fundamental and harmonics leaving the DC practically intact.

natasyaeva said:
i had try in simulation but dont get the result.
What results are you actually getting? What is the frequency of the simulated square wave? What kind of filter are you simulating (type and component values)?


    Points: 2
    Helpful Answer Positive Rating
i have set up the period is 100ms. if the time high is 1ms, how can i get the dc 0.05V? the voltage is average right?? (1ms/100ms) x 5V(amplitude of PWM)

it is right i was use rc low pass filter with 100Mohm n 10mF?

how to do it?please help me...

Added after 15 minutes:

my pwm amplitude is 5V.
T cycle is 100ms.
Thigh are from 1us to 99.999ms
i want a circuit can give the voltage 0.00005V for 1us and will increasing follow increasing the value Thigh. and at the end, the Thigh is 99.999ms will result 5V.nevermind if it not 100% accurate.

thanks all..

Not open for further replies.

Part and Inventory Search

Welcome to