Variable reluctance flowmeter- frequency to voltage converter

I haven't begun coding yet as I could do with some advice.
I need to create a frequency to voltage converter to go between my Nixon flowmeter and a Picolog (voltage reader). I think I need to use a combination of the analogread/ analogwrite & millis function. The output of my flow meter is a sine wave between 1-1300Hz and 80-700mV. The picolog can take up to 5V.
My basic pseudocode ideas are as follows:

Low=0
High=0
Time=now

do
Current_val=Analogread(3)
If current_val<low_lim then low=1
If current_val>high_lim and low_lim=1 then high=1
If low=1 and high=1 then
pulse_count=pulse_count+1
low=0
high=0
End if
If pulse count=1000 then
Frequency=1000/(now-time)
Analogwrite(3) = frequency / max_freq * max_voltage
Time=now
End if

loop

Let me know if you have any ideas please! Thank you, Helen

Hi Helen,

A frequency of 1300 Hz can be discerned by regular, high level Arduino programming. So no problems there. On the other hand the output varying between 80 and 700mV requires that the signal be amplified. You could use the adc built into an Arduino, but an external, single op amp can turn this into a signal that an Arduino can easily read as a series of pulses.

As for the output, realize that all Arduino output is digital - it's 5 volts or zero volts (unless you are using one of the cortex M* processors, which are equipped with real analog output on a single pin.) This isn't a problem though, because you can filter the output with an RC circuit (and stay well within the 760 microseconds between pulses.) If you use a dual op amp from above, the second amplifier of the chip can condition the output for your volt meter device.

I haven't dissected your pseudo code, but you should be able to do the necessary conversions to read it out as a flow rate. This is a very doable project with an Arduino and a bit of external circuitry.

Hi,
What model Picolog are you using and does it have a frequency meter facility?

Thanks.. Tom.. :slight_smile: