Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Voltage to frequency converter

Status
Not open for further replies.

Markley02

New Member
I am a total idiot when it comes to this stuff. What I have is a sensor that puts out 0-5 volts (Ford MAF), but my cars ecu reads Hz. I need to turn the 0-5 volts into 5 volts 0-3000Hz. From reading around I think I need a voltage to frequency converter or a voltage-controlled oscillator. Can anyone here help out an idiot?

Thanks
 
Markley02 said:
I am a total idiot when it comes to this stuff. What I have is a sensor that puts out 0-5 volts (Ford MAF), but my cars ecu reads Hz. I need to turn the 0-5 volts into 5 volts 0-3000Hz. From reading around I think I need a voltage to frequency converter or a voltage-controlled oscillator. Can anyone here help out an idiot?

Thanks

hi,
Look here:

**broken link removed**

and the other way!
**broken link removed**
 
First of all.... Thanks!

I know it is probably annoying to have people that have no clue come on here and ask for help.

What is the difference between the LM331N and the LM331AN?

As for the pins

1. Current output - If I am looking for a frequency output would I even use this pin?

2. Reference Current - I can guess that this would be my 0-5 volt wire.

3. Frequency output - This would be my final output for the 5 volt 0-3000 Hz wire.

4. Ground - I got that one under control

5. R/C - What the hell is this?

6. Threshhold - This is where I tell it to limit to 3000 Hz right? How do I do that?

7. Comparator Input - Huh? Maybe a 5 volt line since that is how many volts I want the output to have?

8. Vs - Huh?
 
hi Markley,
If no one else steps forward, I'll look thru the spec sheet for the V2F and give some answers.

Ref your PM, I dont take on jobs for money, many thanks for the offer.:)

At this time I have a number of other projects running, so I dont have much free time.

EDIT:
This composite taken from the datasheet should help for starters.

EXTRACT: for LM331 versus LM31AN
The LM231/LM331 family of voltage-to-frequency converters are ideally suited for use in simple low-cost circuits for analog-to-digital conversion, precision frequency-to-voltage conversion, long-term integration, linear frequency modulation or demodulation, and many other functions. The output when used as a voltage-to-frequency converter is a pulse train at a frequency precisely proportional to the applied input voltage. Thus, it provides all the inherent advantages of the voltage-to-frequency conversion techniques, and is easy to apply in all standard voltage-to-frequency converter applications. Further, the attain a new high level of accuracy LM231A/LM331A level of accuracy versus temperature which could only be attained with expensive voltage-to-frequency modules.
Additionally the LM231/331 are ideally suited for use in digital systems at low power supply voltages and can provide low-cost analog-to-digital conversion in microprocessor-controlled systems. And, the frequency from a battery powered voltage-to-frequency converter can be easily channeled through a simple photo isolator to provide isolation against high common mode levels.

The LM231/LM331 utilize a new temperature-compensated band-gap reference circuit, to provide excellent accuracy over the full operating temperature range, at power supplies as low as 4.0V. The precision timer circuit has low bias currents without degrading the quick response necessary for 100 kHz voltage-to-frequency conversion. And the output are capable of driving 3 TTL loads, or a high voltage output up to 40V, yet is short-circuit-proof against VCC.
 
Last edited:
So..... I have read through most of the data sheet and studied what it says about figure 3. That doesn't mean I understand it though. I do undertand now that Vs is just the power needed for the chip. Anything from 5 to 40 volts, which will either be 5 or 12 volts depending on which wire I use.

That is really the only added thing I understand from earlier though.

What are pins 1 and 6 for? The figure just shows them coming together with a capacitor and some resistors then leading to a ground and something "optional" for a Offset Adjust (that I have no clue what one is or how to use it)

For pin 7 it shows the resistor and a capacitor (which I don't understand why they are even there) and a "V in" which I am guessing is my variable voltage input . Does it matter that mine will only go to 5 instead of the 10 in the figure? What will that mean in relation to the frequency output as I need it to go to 3K instead of 11K anyway.

Since I am putting 5 or 12 volts into the "V s" for pin 8, does that mean I need to change the resistor or capacitor for pins 5 and 8?

Now I got deffinitly that pin 3 is is my f out. Why is there another line with a resistor that says "V logic" though?

What is the point of pin 2? I can see that it has the variable resistor and then to ground, but what effect will that have on my output?
 
Markley02 said:
So..... I have read through most of the data sheet and studied what it says about figure 3. That doesn't mean I understand it though. I do undertand now that Vs is just the power needed for the chip. Anything from 5 to 40 volts, which will either be 5 or 12 volts depending on which wire I use.

That is really the only added thing I understand from earlier though.

What are pins 1 and 6 for? The figure just shows them coming together with a capacitor and some resistors then leading to a ground and something "optional" for a Offset Adjust (that I have no clue what one is or how to use it)
Pins 1 and 6 enable you to ZERO the output frequency for a 0Vin signal.
The closest you can get to Zero will be about 10Hz


For pin 7 it shows the resistor and a capacitor (which I don't understand why they are even there)
Pin 7 res/cap are a simple filter network, used to suppress any electrical noise on the Vin.


and a "V in" which I am guessing is my variable voltage input . Does it matter that mine will only go to 5 instead of the 10 in the figure?
Not, really.
If you set the R/C values to suit a Vin of 0 thru +5v, you could still get 0 to 3KHZ out


What will that mean in relation to the frequency output as I need it to go to 3K instead of 11K anyway.

Since I am putting 5 or 12 volts into the "V s" for pin 8, does that mean I need to change the resistor or capacitor for pins 5 and 8?

Now I got deffinitly that pin 3 is is my f out. Why is there another line with a resistor that says "V logic" though?
This pin is connected to the LOGIC supply of the device the 0 to 3KHZ is connected to, so they are compatible in voltage
What is the point of pin 2?
Pin 2 is for setting the SPAN [Gain] ie: Vin= +5V.... gives 3KHz output.
I can see that it has the variable resistor and then to ground, but what effect will that have on my output?

Hope this helps.

Get the lower cost device, wire it up as per the diagram shown, get in working according to the datasheet, then change the R/C to suit your application. I would make part of the 'R' an adjustable resistor, so that you can trim the frequency. eg: 4K7 and a 5K pot.

EDIT:
On the drawing I posted I had msiread the 3KHz as 30KHz.
So just increase the R/C , cap to about 0.33uF, that will reduce the frequency limit.
 
Last edited:
Hi Markley,
You will see some components marked with a '*' this indicates a good quality component is required at that location.
eg: high stabilty resistors and low leakage capacitors.
If you use standard components the V2F will work, but the frequency will alter with time and temperature.

With regard to the 0 to +5Vin limit of your input signal.
Consider you choose the R/C values to give 6KHz at +10Vin, then you will get 3KHz for +5Vin.
[use the formula shown in the data clip to calculate the R/C]

Its IMPORTANT that you find out the logic level voltage in the ECU and connect the 10K resistor on pin 3 to THAT ECU logic supply voltage.
That will ensure that the voltage level from the V2F is compatible with the ECU.
 
You are so AWESOME!!! Now I am down to 4 questions.

Since the wire going to the ecu needs to be a 5 volt 0-3000 Hz that means my V LOGIC goes to a 5 volt line correct?

I am still confused about the "(optional) Offset Adjust" thing. Since I just want that to be as close to zero as possible I really dont want the offset adjustment. Does that mean I can just drop that and the 22k resistor?

What cap do I use for Cin? 0.1 or 1? I read the paragraph about it, but I dont understand it.

I am totally confused about that formula. Something just isn't working for me. Is the .33 cap for Ct based on the Vs value being 15v? Right now I think my Vs value is going to be 5v. What cap would I then need?
 
Markley02 said:
You are so AWESOME!!! Now I am down to 4 questions.

Since the wire going to the ecu needs to be a 5 volt 0-3000 Hz that means my V LOGIC goes to a 5 volt line correct?
Ideally to the +5V line in the ECU, [if possible]

I am still confused about the "(optional) Offset Adjust" thing. Since I just want that to be as close to zero as possible I really dont want the offset adjustment. Does that mean I can just drop that and the 22k resistor?
No, dont drop the any components, with the typical spread in component values due to their tolerances, you made find without the ZERO adjustment the low end frequency [ ie: no Vin] could be miles off the ideal 10Hz.
For the pennies it costs for res/caps it worth avoiding any hassle.

What cap do I use for Cin? 0.1 or 1? I read the paragraph about it, but I dont understand it.
I would use a 0.1uF

I am totally confused about that formula. Something just isn't working for me. Is the .33 cap for Ct based on the Vs value being 15v?
I will look thru the formula again.

Right now I think my Vs value is going to be 5v. What cap would I then need?
It sounds as though you are going to fit a 5Vregulator, ???

hi,
A circuit as shown as typical would be my starting point, as I suggested, build it on the bench.
Use a variable resistor say 10K from +5v to 0V with the wiper of the pot acting as a test Vin.
Connect the 10K on Fout to +5V and set it up on the bench.

You will have to calibrate the V2F using the Zero/offset and the Span/gain pots anyway.:)
You can then alter the value of the R/C [cap] to get 3KHz at +5Vin

EDIT: added gif

REDIT:
My calculation gives (5 /2.09)*(17000/100000)*(1/6800*.047*1000) = 0.002811HZ

Cap = 0.047uF for 2800HZ, use the Zero and Gain to get 3000HZ
 
Last edited:
Now I am getting most of it. Still a little confused about the Offset Adjustment. If my Vs is +5V then how do I get -5V?

This is the background of why I am trying to do this:

I have an aftermarket turbocharger on my car that is much larger than the stock turbo. The car measures the air by a Karmen Vortex MAF and a baro/temp input. After a certain point the Karmen Vortex MAF starts giving erratic measurements. The Karmen Vortex MAF puts out a steady 5 volts that varies from 0-3000 Hz which it starts giving erratic readings above 2000Hz. We have figured out that the ECU understands at least 3000 Hz so that is why I am giving the figure of 3000 Hz. How it works is it creates little vortex's in the intake and it moves an oscillator back and forth that makes the square waves in a 5 Volt line. The stock MAF has a 12V input, 3 5V inputs (which all come from the ECU), 1 ground, 1 5V 0-3000Hz output from the MAF and a 0-5V output for the Baro/Temp.
I am replacing this with a Hotwire Ford MAF. Which simply puts out 0-5 volts depending on airflow. The way it reads air is effected by baro and temp therefor there is no separete Baro and temp sensor on this unit. One 5 volt will go to the V2F and one will be limited to 3.9V so the car reads a constant Baro/temp input (which does not need to vary because the new sensor compensates for that).
With that being said, the stock sensor puts out 37Hz at idle so the ECU will never need to read 0 Hz (10Hz is plenty low enough) as there is always some air movement. I can tell the ECU how to interpret the Hz readings (i.e. 1000Hz is X amount of air and 2000Hz is y amount of air) at 20 different points, so I dont nessesary need it to go all the way to 3000Hz, but I would like it to have as many variable readings as I can.

Sorry for the long explanation.
 
hi,
I think I follow that OK.
Ref the -V for the offset, normally you would require a negative [low current]
voltage supply. This could be achieved with a capacitive pump switcher.

Not having the -Voffset will affect the very low end of the frequency range, the Span/Gain sets the top frequency.

Again, I would suggest building the board, without the -Voffset, and try it on the bench.
If the lack of Zero/offset gives problems, a semi-con device., like a 7660 ic could be added to give about -5V for the offset.

Hope this helps.:)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top