Tutorial: Reading Water Flow rate with Water Flow Sensor

Arduino, Seeeduino Serials and mutants. Share your problems and experence on arduino compatible board such as seeeduino/stalker, etc.

Moderators: violet, jessie

azzazza_91
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Fri Apr 26, 2013 9:47 pm

Re: Tutorial: Reading Water Flow rate with Water Flow Sensor

Post by azzazza_91 » Fri Apr 26, 2013 9:52 pm

I believe I have found a mistake in the code!!

It says

Calc = (NbTopsFan * 60 / 7.5); to give the litres per minute.

This line is incorrect as NbTopsFan gives the amount of pulses in the one minute time.
60 is the amount of seconds in a minute
and 7.5 is the litre converter

so at the moment, using units only, the result is min/L

so just change it around to get an appropriate result
Calc = (NbTopsFan * 7.5 / 60) // this will result in pulses(litres)/minute
hey presto all you people wondering why your code didn't work :)

basile.laderchi
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Mon Nov 18, 2013 4:00 pm

How does it have to be mounted?

Post by basile.laderchi » Mon Nov 18, 2013 4:02 pm

I have couple of these YF-S201 flow sensors and I can't find how it has to be mounted.
Some sites say vertical and other horizontal. :?
What is the correct orientation?
Or are both correct?

basile

debidonovan
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Sun Feb 09, 2014 4:41 am

Re: Tutorial: Reading Water Flow rate with Water Flow Sensor

Post by debidonovan » Sun Feb 09, 2014 4:45 am

Hi,

Just a quick question about the figure 7.5 that is used in the calculation. Is this for when the sensor is in a horizontal or vertical position? And if the figure differs on different orientations what would be the respective figure for the pulse frequency be?

Cheers :D

haroon46
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Tue Mar 04, 2014 11:15 pm

Re: Tutorial: Reading Water Flow rate with Water Flow Sensor

Post by haroon46 » Tue Mar 04, 2014 11:17 pm

Guysss..

Have anyone did this sensor coded in python? I am actually stuck with this. Couldnt be able to get any value.

Please help me. I m new to raspberry pi.

akokarski
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Thu Jul 24, 2014 12:27 pm

Re: Tutorial: Reading Water Flow rate with Water Flow Sensor

Post by akokarski » Thu Jul 24, 2014 1:27 pm

Hi,

I know this thread is mostly about interfacing with water flow sensor from Ardruino, but looks like a few folks trying to do the same using raspberry pi. After checking a bunch of tutorials and posts on raspberry pi + water flow sensor this is what I have come up with so far.

This is a very basic program in python which just counts ticks from the sensor. I haven't put any water through it yet to see how accurate this is.

How I have sensor connected to GPIO pins

black to GND
red 5v0
yellow through 560 ohm resistor to #23

here is a code, I have to paste it here as I am too new of a user to link to github.

Code: Select all

#!/usr/bin/env python

import RPi.GPIO as GPIO
import time, sys


FLOW_SENSOR = 23

GPIO.setmode(GPIO.BCM)
GPIO.setup(FLOW_SENSOR, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)

global count
count = 0

def countPulse(channel):
   global count
   count = count+1
   print count

GPIO.add_event_detect(FLOW_SENSOR, GPIO.RISING, callback=countPulse)


while True:
    try:
        time.sleep(1)
    except KeyboardInterrupt:
        print '\ncaught keyboard interrupt!, bye'
        GPIO.cleanup()
        sys.exit()

I am new to raspberry pi/ GPIO and not 100% sure on a few things
  • Do I need a resistor?
    Should I have a bouncetime? Doesn't look like I need to, i've tried to rotate pin wheel 360 degrees and it consistently gave me 3 pulses.
Thanks!
Anton

ordenrahl
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Wed Aug 27, 2014 3:44 am

Re: Tutorial: Reading Water Flow rate with Water Flow Sensor

Post by ordenrahl » Wed Aug 27, 2014 3:52 am

I recently purchased this sensor and I was hoping to use in conjunction with a 1/4 tube used as a straw. Naturally, when you drink from a straw there are pauses each time you swallow. I've read here that this sensor doesn't do well with frequent start/stops. Is this an impractical use of the sensor? The liquid I'm measuring would be water.


Also, on a side note, when putting this together I noticed that it's not quite air tight (maybe you naturally let air in when you drink from a straw?). This results in lots of tiny bubbles and I end up burping for a few minutes after drinking (lol!!). I think this might be solved with a valve similar to the camelbak valves or maybe I need to seal up all the seams on the sensor with some silicone.

Thanks!!

arun.j
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Tue Dec 23, 2014 1:10 pm

Re: Tutorial: Reading Water Flow rate with Water Flow Sensor

Post by arun.j » Tue Dec 23, 2014 1:45 pm

Hi,
I am using water flow sensor for measurement,i am connecting my sensor in such a way that one end is connected to the tap where water comes in and other end is connected to rotating tap through pipe where water comes out, i am measuring the pulses(count)output by the sensor. in my scenario i am measuring the pulses(count) for half liter. at different flow rates my pulse count is different for half liter,but i should get same pulse count for half liter at different flow rates.


Regards
Arun

sebastian_deac
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Thu Apr 02, 2015 6:06 am

Re: Tutorial: Reading Water Flow rate with Water Flow Sensor

Post by sebastian_deac » Thu Apr 02, 2015 6:28 am

Hi all!

Does anybody have the datasheet for the G1" Water Flow Sensor?

I am looking for the value of the constant that gives the relation between flowrate and pulses per minute the sensor is sending (7.5 for G1/2", 5.5 for G3/4")

I have found the datasheet for G1/2" sensor, flow rate vs frequency rate for G1/4" G3/4" but nothing on G1" sensor


Thanks,

Sebastian

cainhochina
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Thu Jun 11, 2015 4:05 am

Re: Tutorial: Reading Water Flow rate with Water Flow Sensor

Post by cainhochina » Thu Jun 11, 2015 4:09 am

Sorry for replying in such an old post but I really need this information!

Can I make this work WITHOUT using interruptions? I mean, using regular inputs (analog probably) or PWM inputs?

Thank you and sorry again.

rob.grandall
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Tue Jul 21, 2015 7:40 am

Re: Tutorial: Reading Water Flow rate with Water Flow Sensor

Post by rob.grandall » Tue Jul 21, 2015 7:50 am

Very interesting...
Think I might use it in my own applications. Only question: is it waterproof, or will i need to make it water proof?
Thanks!

Post Reply