Measuring water flow

I have a solenoid valve in a watering system, opened and closed by an Arduino board, through a relay. Now I would like to measure the amount of water flowing through the valve as well, but I have no idea about how this is done. I imagine some kind of tube with a propel, where the throughput is calculated based on number of turns of the propel, but I might be totally wrong here.

Is there any standard, affordable products for measuring water throughput, that can be easily hooked up to a MCU, on the market?

this one could work for you. Even if it has not been identified I guess you could to some tinkering and find out how it works.

I can see what looks like a paddle wheel in the picture in jcgalvezv's link. I would guess the IR photodetector provides pulses proportional to the rotation of the wheel. Your Arduino sketch would count the pulses which you can calibrate by measuring how many pulses it takes to fill a known volume of water. For $3.50 I suggest you go for it!

Thank your for bringing me closer to a solution.

I have now got my hands on a flow meeter from SwissFlow which looks like just what I need. The meeter output 6000 pulses per liter of water passing through.

My next qyestion is; How do I count those pulses with the Arduino? Do I have to add some extra hardware or can I connect the pulse output directly to the Arduino board?

My next qyestion is; How do I count those pulses with the Arduino? Do I have to add some extra hardware or can I connect the pulse output directly to the Arduino board?

That depends on the details of the output circuit of the flowmeter.

Often these things will have an open collector to ground - all you will need is a pull-up resistor to the Arduino supply (or use the internal pull-up resistor on the input pin).

Can you point us to a datasheet of the flowmeter you are using?

edit . . .

Is this the flowmeter:

http://www.swissflow.com/en/SF800/Flow_Meter_Specifications

If so, there is no mention of output circuirty - I think it reasonable to expect 5V pulses if you power it with 5V, no extra circuitry needed.

Mike

Also, have a look at attachInterrupt http://www.arduino.cc/en/Reference/AttachInterrupt for an easy place to increment a counter on each pulse

Is this the flowmeter:

http://www.swissflow.com/en/SF800/Flow_Meter_Specifications

If so, there is no mention of output circuirty - I think it reasonable to expect 5V pulses if you power it with 5V, no extra circuitry needed.

Thats the one yes.

I think you are right that it output 5V pulses, but I will check this to be sure. Does this mean that I simply hook the output pulse wire to one of the digital input pins on the Arduino and use attachInterrupt as a method for counting the pulses? Sounds too easy to be true :slight_smile:

Another question; I see from the flow meeter spec that it output the pulse at a rate of up to 2000Hz. Is the Arduino capable of reading state changes on the digital input pins at such rate?

If your flow rate is towards the lower end then you could count pulses in the interrupt handler (see the link above).

For the higher rates, if the flow rate is changing relatively slowing (with respect to the time between pulses) you could also use pulseIn to calculate flow rate as the flow rate is proportional to the period between pulses.

But if you are expecting pulse rates of 2000hz and you need ultra-accurate readings then you may want to look at using the hardware counting capability of timer1 and sample the count at regular intervals to get the exact flow rate.

Is this the flowmeter:

http://www.swissflow.com/en/SF800/Flow_Meter_Specifications

If so, there is no mention of output circuirty - I think it reasonable to expect 5V pulses if you power it with 5V, no extra circuitry needed.

Thats the one yes.

I think you are right that it output 5V pulses, but I will check this to be sure. Does this mean that I simply hook the output pulse wire to one of the digital input pins on the Arduino and use attachInterrupt as a method for counting the pulses? Sounds too easy to be true :slight_smile:

Another question; I see from the flow meeter spec that it output the pulse at a rate of up to 2000Hz. Is the Arduino capable of reading state changes on the digital input pins at such rate?

Hey sta,
Did you get to test out attaching the output pulse to an interrupt pin and counting the pulses? If you did, it would be great to know how it turned out because I'll be working on something similar.

I haven't had the time to look into this yet, but I think I will do it later this week. I will keep you posted.

I'm not sure what approach to take though. I want to accomplish two things:

(1) Measure the current amount of water flowing through
(2) Keep track of the total amount of water that have gone through the meter

The plan is to send the results, through an XBee module, to a remote host, that put the values into a database that is accessible from the internet.

My plan so far is to use attachInterrupt to execute a pulseIn, once a second. Based on the pulseIn value I can estimate the amount of water currently parsing through in a second. The value is send to the remote host, which take care of aggregating and storing it.

Any comments about this? Is it doable, and will it be accurate enough?

Sorry to revive this old thread, but I am wondering about the same thing. How much did the flowmeter from SwissFlow cost? Did this ever work?