Pages: [1]   Go Down
Author Topic: Reading Water Flow Rate from a flow meter.  (Read 29440 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is part of a project I have been working on and I thought I would share it here . The flow meter I am using is the  Water Flow Sensor found in the Seeed Studio Depo. It uses a simple rotating wheel that pulses a hall effect sensor. By reading these pulses and implementing a little math, we can read the liquids flow rate accurate to within 3%.  The threads are simple G1/2 so finding barbed ends will not be that hard. I found some at lows for $1.89 each.


You will need
    Seeeduino / Arduino
    Water Flow Sensor
    10K resistor

Wiring up the Water Flow Sensor is pretty simple. There are 3 wires: Black, Red, and Yellow.
    Black to the Seeeduino's ground pin
    Red to Seeeduino's 5v pin
    The yellow wire will need to be connected to a 10k pull up resistor.and then to pin 2 on the Seeeduino.

Here is a fritzing diagram I made to show you how to wire it all up.

Once you have it wired up you will need to upload the following code to your Seeeduino. Once it is uploaded and you have some fluid flowing through the Water Flow Sensor, you can open the serial monitor and it will display the flow rate, refreshing every second.

Code:
// reading liquid flow rate using Seeeduino and Water Flow Sensor from Seeedstudio.com
// Code adapted by Charles Gantt from PC Fan RPM code written by Crenn @thebestcasescenario.com
// http:/themakersworkbench.com http://thebestcasescenario.com http://seeedstudio.com

volatile int NbTopsFan; //measuring the rising edges of the signal
int Calc;                              
int hallsensor = 2;    //The pin location of the sensor

void rpm ()     //This is the function that the interupt calls
{
  NbTopsFan++;  //This function measures the rising and falling edge of the

hall effect sensors signal
}
// The setup() method runs once, when the sketch starts
void setup() //
{
  pinMode(hallsensor, INPUT); //initializes digital pin 2 as an input
  Serial.begin(9600); //This is the setup function where the serial port is

initialised,
  attachInterrupt(0, rpm, RISING); //and the interrupt is attached
}
// the loop() method runs over and over again,
// as long as the Arduino has power
void loop ()    
{
  NbTopsFan = 0;      //Set NbTops to 0 ready for calculations
  sei();            //Enables interrupts
  delay (1000);      //Wait 1 second
  cli();            //Disable interrupts
  Calc = (NbTopsFan * 60 / 7.5); //(Pulse frequency x 60) / 7.5Q, = flow rate

in L/hour
  Serial.print (Calc, DEC); //Prints the number calculated above
  Serial.print (" L/hour\r\n"); //Prints "L/hour" and returns a  new line
}


I hope this helps someone out! Thank's to Seeed Studio for hooking me up with a sensor so I could develop this tutorial.
« Last Edit: August 29, 2010, 02:00:49 am by TheMakersWorkbench » Logged

Netherlands
Offline Offline
Sr. Member
****
Karma: 0
Posts: 414
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Interesting and nice write up.

What are you going to use it for?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using it to measure the flow rate of the liquid cooling system in my PC. If the flow level were to drop below a certain level an alarm will sound and an LED will flash on the front of the case.

This is just part of a much larger project. I made this tutorial because there were some threads about using this sensor over on the seeedstudio.com forums. So I thought I would post it here too. I also put a link in the playground to this tutorial on my site.

Thanks for the props!
Logged

Taschereau, Quebec, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

TheMakersWorkbench: Are you saying that you found water flow meter at 1.89$ ? If yes, can we order them online, I'm in Canada?

Thanks!

kb
Logged

Jax Florida
Offline Offline
Jr. Member
**
Karma: 1
Posts: 93
Electronics Addict
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The 1.89 was the price of misc fittings i believe.

He mentioned the flow sensor came from seeed studio depot. They sell it for $9.50 us

http://www.seeedstudio.com/depot/g12-water-flow-sensor-p-635.html?cPath=84_87

According to the description its just a rotor with a hall sensor reading its speed.
« Last Edit: August 29, 2010, 08:35:58 pm by tweakd » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes the $1.89 was what the solid brass G1/2 barbed fittings cost. The flow meter is from Seeedstudio.com and cost $9.50 USD.

It's a typical magnetic flow meter which outputs an electrical pulse with every revolution. The signal is a simple square wave so its quite easy to log and convert into liters per minute using the following formula.

Code:
Pulse frequency (Hz) in Horizontal Test= 7.5Q, Q is flow rate in L/min. (Results in +/- 3% range)

The flow meter is silent wen in operation and from what I can tell, does not introduce any noticeable restriction in flow. I am pumping a cooling fluid mixture through it that is similar to common automotive antifreeze so its slightly thicker than water.

Using a CPX Pro (jingway 1200) pump from Dangerden.com I am getting an output of about 400lph on average which is consistent with testing from other independent testing labs.  

I have tested this setup on another pump (Thermaltake 500lph) and the results from it are also consistent with other results I have seen.

I really hope some of you use this in your projects. If you do please email me (charles gantt at themakersworkbench dot com) a link to your project.
Logged

Darlington, UK
Offline Offline
Full Member
***
Karma: 0
Posts: 125
Shaamo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Very interested in the circuit, however, I am wanting to use it to measure fuel flow rate in a vehicle.  I have been unable to find a suitable, economical 12v flow meter, GAH.  Any tips anyone?
Logged

Carbondale Illinois
Offline Offline
Full Member
***
Karma: 1
Posts: 104
Making digital rivers.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@Makersworkbench, have you tested to verify the 3% accuracy, and if so, over what flow range?  That's very good for such an inexpensive meter.  And could you post Seeed studio link for those forum discussions.  We've looked around a bunch for inexpensive meters like this, and the one you have, and also a couple available from Jaycar, seem to be about it.  Next step up is over US$200.

If you're also driving a pump, you may be able to use voltage to the pump to measure flow and leave out the meter; as long as your hydraulic loop doesn't change.  See our work here:  http://lrrd.blogspot.com/search?q=meter[url][/url]

thanks,

Steve
Logged

Melbourne, Australia
Offline Offline
Full Member
***
Karma: 1
Posts: 226
Cyborg-in-progress
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@gravelbar, it's cool to see your progress with the controller since the first version using the Jaycar flow sensor. Looks like you've gone much further than just measuring flow now!

@TheMakersWorkbench, nice write-up. Also, for reference:

http://www.practicalarduino.com/projects/water-flow-gauge
--
Jon
Check out our Ethernet Shield with PoE support: www.freetronics.com/ethernet-shield
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@gravelbar  The 3% came from the data sheet on the flow meter. I can link to the seeedstudio forum post I mentioned but they are just 1 post topics asking for info on using this meter. No actual discussion.

That is a pretty cool project you have going on there! Can't believe I missed it.

@ Jonathan Oxer  I actually got the idea for my whole project from that one project in practical arduino. I searched for months for a cheap flow sensor that was small enough to fit in a PC case.

I am working on my board layout now and should have some complete Water Cooling System control boards ready by November.
« Last Edit: September 08, 2010, 12:32:21 am by TheMakersWorkbench » Logged

Carbondale Illinois
Offline Offline
Full Member
***
Karma: 1
Posts: 104
Making digital rivers.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Workbench; if you just want a "flow or no flow" condition, there are other options, too, like leaving a bubble in the top  of your loop and using an optical sensor to see it it's there or not.  There are also simple flow switches that do this.  But probably you want the cool option, and actual flow rate :-)
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was trying to use this with pachube.

But also I am trying to simulate a normal digital water meter. Do you know how I can get from flow rate to actual metering (adding the cubic meters to the already registered ones) ?

Or to put it otherwise, how many pulses makes a liter (or a cubic metre)?

As you can see, I am not that good with maths! smiley
I know that 1Liter = 0.001 cubic meters, but that's all.

Logged

Pages: [1]   Go Up
Jump to: