Pages: [1]   Go Down
Author Topic: convert frequency to voltage? help me pls  (Read 836 times)
0 Members and 1 Guest are viewing this topic.
Prague
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi people,
Please help me.

I have a frequency from 0% = 6.045KHz to 100% = 23.133 kHz, and i need this convert to the voltage = 0V = 0% and 100% = 5V. It is a gradually in 63 steps.

Can someone of you please help? I would be very grateful to you .. thank you very much
Logged

Andry

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 596
Posts: 33283
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to build a circuit where the input frequency triggers a monostable. Then you take the monostable output and smooth it like a PWM signal.
Logged

Offline Offline
Edison Member
*
Karma: 32
Posts: 1282
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've never used one, but they actually make frequency-to-voltage chips (example).    With your specific requirements, you'd probably need an op-amp circuit to calibrate & "scale" the output.  (I'm just assuming that the chip will put-out zero-volts at zero-Hz, and you'd need to compensate to get 0V@ ~6kHz, etc.)

Typically, a frequency counter works by counting the number of cycles (or the number of positive zero-crossings, etc) over a period of time.    You first need a comparator circuit to convert your AC input into nice pulses. 

Then, you just need a counter circuit to count the pulses over a fixed-known period of time.  So far, none of this needs a microcontroller.   It's actually better if you can do the counting & timing without relying on software which might not be able to keep-up.    A microcontroller would be helpful for calculating the frequency (if your time reference isn't 1 second) and for storing the result, etc. 

Then, you can use a digital-to-analog convert to make an analog voltage.   (Or, the PWM features of the Arduino.)
« Last Edit: January 04, 2012, 05:36:30 pm by DVDdoug » Logged

0
Offline Offline
Shannon Member
****
Karma: 199
Posts: 11639
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Another technique (overkill for this though) is to use a phase-locked-loop (PLL).  You arrange a voltage-controlled oscillator that covers the frequency range linearly for your voltage signal and let the PLL lock onto the input signal.  It's control voltage to the oscillator becomes your analog voltage output...  As I said over-complex smiley-wink

Or put another way a PLL converts a voltage->frequency converter into the inverse frequency->voltage converter (hiding a lot of detail).
Logged

[ I won't respond to messages, use the forum please ]

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 514
Posts: 26260
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Arrange a simple low pass RC filter to smooth it to DC. Add some offset via op-amp so that the lower voltage results in 0 and some gain so the upper voltage is 5V.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 596
Posts: 33283
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Arrange a simple low pass RC filter to smooth it to DC
That won't work as you get the same smoothed voltage out no matter what the frequency.
Logged

Prague
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello

this is middle scale = step 35


this is low scale = step 0



full scale = step 63

I used this connection


Uploaded with ImageShack.us

now frequency is expanding and narrowing can be this used for PWM input?

thank you
« Last Edit: January 05, 2012, 06:42:22 am by andry » Logged

Andry

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 596
Posts: 33283
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
now frequency is expanding and narrowing can be this used for PWM input?
Is this a question?
If it is I can't understand it.
That circuit does little, it is just an AC coupled switch.
Logged

Prague
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok, sorry. This signal is ready for PWM input??
Logged

Andry

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 596
Posts: 33283
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

To do what?
If you feed PWM into it you will get PWM out of it.
Logged

Offline Offline
Edison Member
*
Karma: 64
Posts: 2448
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Set up your/an Arduino to determine the frequency and then, based on that, knock out 8 bits (using port manipulation or a shift register) to a DAC.
Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Offline Offline
Edison Member
*
Karma: 43
Posts: 1550
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have a frequency from 0% = 6.045KHz to 100% = 23.133 kHz
Where does this "frequency" come from?
Quote
i need this convert to the voltage = 0V = 0% and 100% = 5V
Why?
Pete
Logged

Where are the Nick Gammons of yesteryear?

Pages: [1]   Go Up
Jump to: