Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 1st October 2009, 10:37 AM   #1
Default need help.. frequency to voltage converter using PIC

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

can i use 16f887a or 16f873??
i hope you all can help me..
thanks to all..
natasya is offline  
Old 1st October 2009, 01:58 PM   #2
Default

there a easy way to do this and it works with any pic you check for frequency say on porta,0

Then output a voltage on portb using it as voltage divider like in the pic
Attached Thumbnails
need help.. frequency to voltage converter using PIC-like_this.png  
be80be is offline  
Old 1st October 2009, 02:05 PM   #3
Default

Quote:
Originally Posted by be80be View Post
there a easy way to do this and it works with any pic you check for frequency say on porta,0

Then output a voltage on portb using it as voltage divider like in the pic
To be a little clearer, it's an R2R DAC - not just a 'voltage divider'. It's also pretty essential to feed it through a high impedance buffer, unless the load is already a high impedance.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 1st October 2009, 03:20 PM   #4
Default

Nigel I'm not as smart as you I don't know whats it proper name but it works i used with the stamp. This gives greater details http://www.allaboutcircuits.com/vol_4/chpt_13/3.html
be80be is offline  
Old 1st October 2009, 03:42 PM   #5
Default

Natasya, what is the output supposed to do?
How are you going to read the output voltage?
__________________
Mike
My website: www.ElectroBird.net
birdman0_o is offline  
Old 2nd October 2009, 02:36 AM   #6
Default

There's an easier way to do it. Everytime an input pulse / edge is detected you just get the PIC to make a fixed-period output pulse. Then average the output pulses into an RC filter.

So if you want 100Hz = 0.1v (ie 1000Hz = 1v)
just generate a 1000Hz/5 output pulse. Or 200uS.

The benefit of this is that you can use the very bottom end PICs for it, like 10F or 12C series.
Mr RB is online now  
Old 5th October 2009, 01:30 AM   #7
Default

thanks all...

actually i dont want use voltage divider...

can i use the output in PWM and convert it to voltage???


MR RB, can yo explain in more detail what was you wrote here??

Thanks..
natasya is offline  
Old 5th October 2009, 01:41 AM   #8
Default

Quote:
Originally Posted by natasya View Post
thanks all...

actually i dont want use voltage divider...

can i use the output in PWM and convert it to voltage???


MR RB, can yo explain in more detail what was you wrote here??

Thanks..
It's an R2R DAC - not just a 'voltage divider'
And you have the idea you test for 100hz then send a higher 1000hz
which would give you 1 volt peak put a 10uf cap on it and it will look like 1 volt

Last edited by be80be; 5th October 2009 at 01:44 AM.
be80be is offline  
Old 5th October 2009, 02:15 AM   #9
Default

Bebe, do you have a schematic handy you could show the OP, what you said is a little confusing.
__________________
Mike
My website: www.ElectroBird.net
birdman0_o is offline  
Old 5th October 2009, 02:38 AM   #10
Default

Something like this would work your testing for 100hz if a 100 hz in you send back out a 1khz which with a filter capacitor looks like 1 volt
If you want .1 volt send a 10khz out
Attached Thumbnails
need help.. frequency to voltage converter using PIC-likethis.png  

Last edited by be80be; 5th October 2009 at 02:39 AM.
be80be is offline  
Old 5th October 2009, 03:40 AM   #11
Default

Why not use an LM2917 frequency-to-voltage converter? Is it strictly PIC-based?
__________________
-The kinda guy who would improvise so much that you'd say "Here's 50 bucks for your Gigantron"
http://vortexelectricaz.blogspot.com
Vizier87 is offline  
Old 5th October 2009, 03:44 AM   #12
Default

Quote:
Originally Posted by Vizier87 View Post
Why not use an LM2917 frequency-to-voltage converter? Is it strictly PIC-based?
He can I was just letting use what he had
be80be is offline  
Old 5th October 2009, 05:02 AM   #13
Default

Quote:
Originally Posted by natasya View Post
thanks all...

actually i dont want use voltage divider...

can i use the output in PWM and convert it to voltage???
MR RB, can yo explain in more detail what was you wrote here??

Thanks..
What I suggested is that you program the PIC to send out a fixed length pulse, every time it detects an input pulse. Then the PIC output pin goes into a RC filter of 1 resistor and 1 cap.

The beenfits are that it is very simple, you onlt need a simple PIC (no ADC or DAC or timers needed) and it has infinite resolution, which is impossible to get with a R2R DAC or any 8bit DAC.
Mr RB is online now  
Old 5th October 2009, 09:52 AM   #14
Default

MR RB, has you done this project??
can u help me by sending the program and circuit...
thanks...
natasya is offline  
Old 6th October 2009, 01:01 AM   #15
Default

This is all the help you should need. The code goes something like this;

Code:
 ; Super simple freq - voltage converter. RomanBlack Oct 2009
 ; connect input to PIC pin RA0
 ; connect output RC filter from PIC pin RB0
 ; 200uS delay means 1000Hz input = 1v DC output
 start

 btfsc PORTA.0 ; first wait for input to be low
 goto $-1

 btfss PORTA.0 ; now wait for input to go high
 goto $-1

 bsf PORTB.0  ; set output high
 nop ; enough nop's here to make 200uS delay
 nop ; or use your own 200uS delay code
 nop ; (etc)
 bcf PORTB.0  ; set output low again

 goto start
Mr RB is online now  
Reply

Tags
converter, frequency, pic, voltage

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
constant dc output voltage for frequency to voltage converter nnb29 Electronic Projects Design/Ideas/Reviews 13 6th September 2009 01:03 PM
Voltage to Frequency Converter km General Electronics Chat 39 3rd March 2009 11:54 AM
Voltage to Frequency Converter viju General Electronics Chat 3 27th October 2008 09:19 AM
Voltage to frequency converter with PIC Andy_123 Micro Controllers 25 6th April 2004 02:19 AM
Voltage to frequency converter with PIC Andy_123 Electronic Projects Design/Ideas/Reviews 0 23rd March 2004 12:44 AM



All times are GMT. The time now is 06:13 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker