Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Water Flow sensor

Water Flow sensor

Scheduled Pinned Locked Moved My Project
11 Posts 6 Posters 10.9k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mrc-coreM Offline
    mrc-coreM Offline
    mrc-core
    wrote on last edited by
    #1

    Hi.
    I'm using this water flow sensor G12 water flow sensor.jpg using the code available from the pulse water meter but the values i'me getting are all rong...
    I'm triyng to adapt the code to this water flow sensor with no luck.

    Could anyone give me an help with the code?
    Thanks in advance.

    SparkmanS 1 Reply Last reply
    1
    • mrc-coreM mrc-core

      Hi.
      I'm using this water flow sensor G12 water flow sensor.jpg using the code available from the pulse water meter but the values i'me getting are all rong...
      I'm triyng to adapt the code to this water flow sensor with no luck.

      Could anyone give me an help with the code?
      Thanks in advance.

      SparkmanS Offline
      SparkmanS Offline
      Sparkman
      Hero Member
      wrote on last edited by Sparkman
      #2

      @mrc-core I believe this type of meter outputs 4.5 pulses per liter, but there are a number of different specs for similar meters. Do you have a link to the one that you actually purchased? The example sketch is for meters that output 1 pulse per liter (or 1000 pulses for 1 cubic meter). Therefore change PULSE_FACTOR to 4500 in the sketch. You may need to adjust that number. I would get a large bucket for which you know how many liters it is and then count the number of pulses required to fill it. Take that number, divide it by the size of the bucket (in liters) and then multiply by 1000. That number becomes your PULSE_FACTOR.

      Cheers
      Al

      korttomaK 1 Reply Last reply
      2
      • Ivan ZI Offline
        Ivan ZI Offline
        Ivan Z
        Hardware Contributor
        wrote on last edited by
        #3

        I using this sensor

        #define PULSE_FACTOR 450

        All sensor has different property. Read instruction or make measurement.

        I made measurement because documentation has different value

        1 Reply Last reply
        0
        • mrc-coreM Offline
          mrc-coreM Offline
          mrc-core
          wrote on last edited by
          #4

          Thanks for the replay.

          The only specs i have about this sensor is this:
          Specifications
          Mini. Wokring Voltage: DC 4.5V
          Max. Working Current: 15mA (DC 5V)
          Working Voltage: DC 5V~24V
          Flow Rate Range: 0~60L/min
          Load Capacity: ≤10mA (DC 5V)
          Operating Temperature: ≤80℃
          Liquid Temperature: ≤120℃
          Operating Humidity: 35%~90%RH
          Water Pressure: ≤2.0MPa
          Storage Temperature: -25~+ 80℃
          Storage Humidity: 25%~95%RH

          Going to try today at home to change the #define PULSE_FACTOR has sayd and see if i get more real values.
          Once again thanks for helping me.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            aesanto
            wrote on last edited by
            #5

            Hi,

            Here you can find a simplified version of the WaterFlow node.
            This version only sends to the GW the current flow volume in liters/hour.
            I don't know your model (G??) as the pulses per liter/hour vary from different flow sensors. Mine is G1" so the math is for this sensor.

            I had a problem with interrupts, and this was the way i found to work.

            Hope this helps!

            #include <SPI.h>
            #include <MySensor.h>  
            
            #define DIGITAL_INPUT_SENSOR 3                  // The digital input you attached your sensor.  (Only 2 and 3 generates interrupt!)
            #define SENSOR_INTERRUPT DIGITAL_INPUT_SENSOR-2        // Usually the interrupt = pin -2 (on uno/nano anyway)
            
            #define CHILD_ID 1                              // Id of the sensor child
            
            int READ_INTERVAL = 3;           // Read interval to count the pulses (in seconds). 
            
            long lastReadStart;
            int flow;
            
            MySensor gw;
            MyMessage flowMsg(CHILD_ID,V_FLOW);
            
            
            int READ_INTERVAL_MILLIS=READ_INTERVAL * 1000;        // Just to simple the math!
            volatile unsigned long pulseCount = 0;   
            
            void setup()  
            {  
              gw.begin(); 
            
              // Send the sketch version information to the gateway and Controller
              gw.sendSketchInfo("Water Meter", "1.2");
            
              // Register this device as Waterflow sensor
              gw.present(CHILD_ID, S_WATER);       
            
              pulseCount = 0;
            
              lastReadStart = millis();
            
              attachInterrupt(SENSOR_INTERRUPT, onPulse, RISING);
            }
            
            
            void loop()     
            { 
              unsigned long currentTime = millis();
            	
            
              if (currentTime - lastReadStart > READ_INTERVAL_MILLIS)
              {
                flow = pulseCount*60/READ_INTERVAL;  //Need to change here for the G type
                lastReadStart=currentTime;
                 
            
            
                  Serial.print("l/hour:");
                  Serial.println(flow);
                  gw.send(flowMsg.set(flow));
                  
                  pulseCount = 0;
              }
            }
            
            
            void onPulse()
            {
              pulseCount++; 
            }```
            1 Reply Last reply
            2
            • mrc-coreM Offline
              mrc-coreM Offline
              mrc-core
              wrote on last edited by mrc-core
              #6

              Hi thanks for the code.
              My water flow sensor it's the FS300A G3/4
              Flow Range: 1-60L/min
              Working Pressure: <1.20/Mpa

              I'm still having some troble on the readdings from this sensor.
              I'm getting for an example in 00:30min readings almost 1.000 m3...

              1 Reply Last reply
              0
              • SparkmanS Offline
                SparkmanS Offline
                Sparkman
                Hero Member
                wrote on last edited by
                #7

                @mrc-core said:

                FS300A G3/4

                This one: http://www.seeedstudio.com/wiki/G3/4_Water_Flow_sensor ? It indicates 5.5 pulses per liter, so you should have 5500 as your PULSE_FACTOR. I would still measure it though as each unit is likely slightly different.

                Cheers
                Al

                1 Reply Last reply
                0
                • mrc-coreM Offline
                  mrc-coreM Offline
                  mrc-core
                  wrote on last edited by
                  #8

                  Hi. Yes its The same sensor.
                  ill try toda with The value 5500.
                  This Will seem a dumb question but how can i measure it?

                  1 Reply Last reply
                  0
                  • SparkmanS Sparkman

                    @mrc-core I believe this type of meter outputs 4.5 pulses per liter, but there are a number of different specs for similar meters. Do you have a link to the one that you actually purchased? The example sketch is for meters that output 1 pulse per liter (or 1000 pulses for 1 cubic meter). Therefore change PULSE_FACTOR to 4500 in the sketch. You may need to adjust that number. I would get a large bucket for which you know how many liters it is and then count the number of pulses required to fill it. Take that number, divide it by the size of the bucket (in liters) and then multiply by 1000. That number becomes your PULSE_FACTOR.

                    Cheers
                    Al

                    korttomaK Offline
                    korttomaK Offline
                    korttoma
                    Hero Member
                    wrote on last edited by korttoma
                    #9

                    @mrc-core said:

                    This Will seem a dumb question but how can i measure it?

                    @Sparkman already told you how to measure it

                    @Sparkman said:

                    I would get a large bucket for which you know how many liters it is and then count the number of pulses required to fill it. Take that number, divide it by the size of the bucket (in liters) and then multiply by 1000. That number becomes your PULSE_FACTOR.

                    • Tomas
                    1 Reply Last reply
                    0
                    • mrc-coreM Offline
                      mrc-coreM Offline
                      mrc-core
                      wrote on last edited by
                      #10

                      Thanks to all for the help.
                      Problem solved using the value 5500 at PULSE_FACTOR.
                      Up until now the values i'm getting seem correct.

                      The only problem now is the domoticz over raspberry that from time to time hangs up an lose connectivity to mysensor serial gateway.

                      That's another problem to solve.

                      Once again thanks for the help.

                      1 Reply Last reply
                      0
                      • R Offline
                        R Offline
                        Roger44
                        wrote on last edited by
                        #11

                        Hi

                        These sensors are really quite neat. I got quite accurate measurements from 4,9 to 44 litres/min, I couldn't go any higher, the output fed into the audio input on the PC with a simple and free frequency meter software. Amazing for a few dollars.

                        The downturn is the pressure loss across the meter, 0.08 bars at 15 L/min rising to 0,69 bars at 41.8 L/min : Here are what I measured
                        dP
                        L/min flowmeter
                        15 0,08
                        18,4 0,04
                        24,7 0,21
                        26,5 0,24
                        30,7 0,29
                        34,2 0,4
                        37,3 0,51
                        40,0 0,63
                        41,8 0,72
                        42,5 0,69

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        13

                        Online

                        11.7k

                        Users

                        11.2k

                        Topics

                        113.0k

                        Posts


                        Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • MySensors
                        • OpenHardware.io
                        • Categories
                        • Recent
                        • Tags
                        • Popular