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. Hardware
  3. Water Flow Sensor

Water Flow Sensor

Scheduled Pinned Locked Moved Hardware
14 Posts 4 Posters 8.2k 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.
  • T Offline
    T Offline
    tbully
    wrote on last edited by
    #1

    Hello All -

    One of my first "MySensors" projects will be a water flow sensor to detect water usage when not expected. I will be using Vera for my logic/controller. Example:

    • On vacation
    • Water flowing for more than 5 minutes and sprinklers not on (account for ice maker,etc)
    • Assume broken pipe / stuck toilet - turn off water and send an alert

    Something like that...... you get the picture.

    I have tested the following sensor/sketch on the bench and it works great:
    http://www.seeedstudio.com/wiki/G1"_Water_Flow_Sensor

    I would like to incorporate a MySensor in to Vera but I do not see a pre-built MySensor Sketch that does what I want.

    I thought about perhaps using the existing Water Flow sketch (http://www.mysensors.org/build/pulse_water) and putting the logic from seeedstudio but I'm not sure I'm competent enough to do this.

    Does anyone have an ideas for this newb?

    Thanks!

    1 Reply Last reply
    0
    • epierreE Offline
      epierreE Offline
      epierre
      Hero Member
      wrote on last edited by epierre
      #2

      Hello,

      From the water pulse, I have the water flow on a secondary counter with a reed diod.

      Here is an example of what I have on one dat:

      chart.png

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tbully
        wrote on last edited by
        #3

        Thanks for the response but I'm not sure I follow. Can you elaborate?

        epierreE 1 Reply Last reply
        0
        • T tbully

          Thanks for the response but I'm not sure I follow. Can you elaborate?

          epierreE Offline
          epierreE Offline
          epierre
          Hero Member
          wrote on last edited by
          #4
          This post is deleted!
          1 Reply Last reply
          0
          • epierreE Offline
            epierreE Offline
            epierre
            Hero Member
            wrote on last edited by
            #5

            @tbully the WaterMeter sketch if you don't activate the sleep method, will report usage and flow. The above graph is in m3; so 0.025 means 25L, you can see how precise it is.

            But if you only use usage, you will get, on a graphing software such as above, the hourly water use. This way you will know your sprinkler is on (here it is raining at the moment, but mine just use 200L when they work... so I can see it, a 6:30 am other watering turn on, I can see it... and since I see it by the liter, I can even know when I take a bath, flush toilets or just put 1L in a bottle.

            Also the sketch has a memory, if radio is perturbated, next time it can transmit, you'll have the exact counter value, maybe not the precise time.

            On your three points, you could do all of them with it.

            Regarding the flow sensor, it is not calibrated, meaning you won't know if this one liter or more, you'll just get a flow. If you inted to modify your water circuit, I recommend you use a counter with or without reed ( the line tracker does it too).

            1 Reply Last reply
            0
            • T Offline
              T Offline
              tbully
              wrote on last edited by
              #6

              I see all of the Serial.print lines commented out in the example sketch. When I uncomment them, the data is not printed to the serial monitor. I'm not working in a Vera Environment at the moment (testing without it) and would like to see this data.

              Thanks again.

              epierreE 1 Reply Last reply
              0
              • T tbully

                I see all of the Serial.print lines commented out in the example sketch. When I uncomment them, the data is not printed to the serial monitor. I'm not working in a Vera Environment at the moment (testing without it) and would like to see this data.

                Thanks again.

                epierreE Offline
                epierreE Offline
                epierre
                Hero Member
                wrote on last edited by
                #7

                @tbully put yourself at 115200 and iy will work

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  tbully
                  wrote on last edited by
                  #8

                  I'm happy to report that I have made some headway.

                  Even though I set the following in the WaterMeterPulseSensor sketch:
                  #define SLEEP_MODE false

                  I still cannot see flow values in Vera.

                  Thoughts?

                  Capture.PNG

                  WaterMeterPulseSensor.ino

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    tbully
                    wrote on last edited by
                    #9

                    As an update, I found my issue with missing flow data. My function generator was running at 10Hz (to simulate 48 L/min).

                    I'm struggling to get this sensor (listed above) to work with this sketch. I was blowing by the MAX FLOW check in the sketch.

                    If anyone has the time to check out the sensor I'm trying to use, It'd be great.

                    Vktech G1 Meter

                    I also have a tread going HERE that main contain more helpful data.

                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      tbully
                      wrote on last edited by
                      #10

                      I was FINALLY able to back in to the correct formula and PULSE_FACTOR to get accurate data displayed!

                      Now I'm trying to combine this Arduino node to do both the pulse counting AND control a relay. What I'm finding is that I'm getting very poor response/performance from controlling the relay. Sometimes I have to click on the ON (or OFF) button successively multiple times to get it to react. I've also noticed that while I'm clicking (and the relay is not responding) that the gateway is giving a red error light for each click.

                      The performance is even worse if I'm running the serial monitor on the sensor side. As you can see from my sketch, I even tried to disable interrupts thinking that maybe I'm falling in to the onPulse routine too often due to the high frequency on the PIN.

                      Thoughts?

                      WaterMeterPulseSensorSwitchComb.ino

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        mikeones
                        wrote on last edited by
                        #11

                        It may not make a difference but, have you tried moving your gw.messageAvailable() check to the top of the loop? I have a relay installed along with a distance sensor attached to my garage door. I get distance updates every 30 seconds when the door is stationary and when the door is moving, I send an update every half second. Having gw.messageAvailable() at the beginning of my loop() works the best in my environment. This assumes you are not fighting a reception or interference issue though.

                        1 Reply Last reply
                        0
                        • T Offline
                          T Offline
                          tbully
                          wrote on last edited by
                          #12

                          This did cross my mind. Having it at the top shouldn't matter but - "why not!?".

                          My gateway is currently only a few feet from my sensor so I don't think it's a reception issue.

                          I will report back, of course. Thanks for the idea.

                          1 Reply Last reply
                          0
                          • T Offline
                            T Offline
                            tbully
                            wrote on last edited by
                            #13

                            New status: I found that by using an external 5v power source for the sensor (instead of plugging it in to the USB port), yields perfect results. I'm not sure why it'd matter. My guess is it was interfering with the radio's operation when running the relay. I'm going to add a filter tonight to see if it helps - just for education purposes. However, it won't be powered by a PC in production anyway.........

                            RJ_MakeR 1 Reply Last reply
                            0
                            • T tbully

                              New status: I found that by using an external 5v power source for the sensor (instead of plugging it in to the USB port), yields perfect results. I'm not sure why it'd matter. My guess is it was interfering with the radio's operation when running the relay. I'm going to add a filter tonight to see if it helps - just for education purposes. However, it won't be powered by a PC in production anyway.........

                              RJ_MakeR Offline
                              RJ_MakeR Offline
                              RJ_Make
                              Hero Member
                              wrote on last edited by
                              #14

                              @tbully
                              Nice find... Seems like there are more and more power related issues popping up lately..

                              RJ_Make

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


                              15

                              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