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. Announcements
  3. 💬 Water Meter Pulse Sensor

💬 Water Meter Pulse Sensor

Scheduled Pinned Locked Moved Announcements
109 Posts 37 Posters 30.9k Views 35 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.
  • mfalkviddM mfalkvidd

    Great work @bart59 !
    Do you have any indication on how long battery life you will get with this setup?

    bart59B Offline
    bart59B Offline
    bart59
    wrote on last edited by
    #15

    @mfalkvidd - I did measure the average current consumption at the time, but I not remember the exact value. I believe it was well below the 0.5 mA. The sensor has been up and running on the same single 1.5V AA battery for 30 days now and the batt percentage still shows 93%.

    1 Reply Last reply
    1
    • dpcrD Offline
      dpcrD Offline
      dpcr
      wrote on last edited by
      #16

      I hope this is not off topic but I'm trying to read our gas meter - but....I cannot use a photo sensor or a hall sensor or a reed switch (the meter is outside and there is no magnet in it). I was able to get some good data using a magnetometer (https://www.sparkfun.com/tutorials/301) using an arduino. But I tink from what I am told is the arduino isn't big enough to handle the code I need to use to change the data (x axis, y axis, z axis) into a pulse but will work on a pi.

      My question is am I missing something (hardware guy, not software)? Can I use a Pi for a sensor (it has the inputs and room), all the code on this site is for arduinos. Could I have the Pi output a pulse to an arduino? Am I over thinking this?

      bart59B 1 Reply Last reply
      0
      • dpcrD dpcr

        I hope this is not off topic but I'm trying to read our gas meter - but....I cannot use a photo sensor or a hall sensor or a reed switch (the meter is outside and there is no magnet in it). I was able to get some good data using a magnetometer (https://www.sparkfun.com/tutorials/301) using an arduino. But I tink from what I am told is the arduino isn't big enough to handle the code I need to use to change the data (x axis, y axis, z axis) into a pulse but will work on a pi.

        My question is am I missing something (hardware guy, not software)? Can I use a Pi for a sensor (it has the inputs and room), all the code on this site is for arduinos. Could I have the Pi output a pulse to an arduino? Am I over thinking this?

        bart59B Offline
        bart59B Offline
        bart59
        wrote on last edited by
        #17

        @dpcreel. I would be surprised the Arduino could not handle the HMC5883L magnetometer from Sparkfun. The I2C protocol is natively supported and you only need to analyse numbers coming from the 3-Axis to decide when the wheels inside the gas meter turn. I think the position of the sensor will be very critical, but the code should not be too complex. Arduino's are typically limited in handling much data (there is only 2000 bytes of RAM in the ATmega328), but your code should not need much RAM space. The program size can be 32 KB which should be enough.

        If you want to go for the PI, there are I2C libraries out there you could use and I would then bypass the Mysensors gateway alltogether and connect an ethernet cable to the PI and use the MQTT protocol to talk to your home controller.

        regards
        Bart

        dpcrD 1 Reply Last reply
        1
        • bart59B bart59

          @dpcreel. I would be surprised the Arduino could not handle the HMC5883L magnetometer from Sparkfun. The I2C protocol is natively supported and you only need to analyse numbers coming from the 3-Axis to decide when the wheels inside the gas meter turn. I think the position of the sensor will be very critical, but the code should not be too complex. Arduino's are typically limited in handling much data (there is only 2000 bytes of RAM in the ATmega328), but your code should not need much RAM space. The program size can be 32 KB which should be enough.

          If you want to go for the PI, there are I2C libraries out there you could use and I would then bypass the Mysensors gateway alltogether and connect an ethernet cable to the PI and use the MQTT protocol to talk to your home controller.

          regards
          Bart

          dpcrD Offline
          dpcrD Offline
          dpcr
          wrote on last edited by
          #18

          @bart59 The Arduino works fine with the HMC5883L, I got some good data from it and was able to "see" the gas meter movements very well. I am not able to write code (hardware guy) to change this data to a pulse for MySensors or whatever it needs. I just want to be able to read my gas meter with the HMC5883L. I did find some code in python that works on the pi, that's why I mentioned it. I'm a hack at software.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            aram
            wrote on last edited by
            #19

            Hi
            I am trying to use the subject code with pulse water meters and hope someone can help to figure out what needs to be adjusted to get more accurate data.

            My setup:
            Gateway ESP8266 (NodeMCU) + NRF24 -> Connected to Domoticz
            Sensor node: Arduino Uno + NRF24
            Default codes from Build. Test sensors so far work great.

            Task:
            Need to connect Siemens WFK2 water meters (four of them actually) with pulse outputs (2 line). According to data sheet (link text) there are two types: reed output or NAMUR.

            To start with, I connected the reed output of the water meter via 10k resistor to +5V, GND and D3. Again, according to data sheet, for every 10l the water meter should give an impulse (e.g. connect the switch). Taking this into account I have adjusted pulse factor to 100 and based on Nominal Flow Rate (Max Flow Rate impossible in my case) limited Max Flow to 25 l/min. This setup works, but I definitely get wrong flow values (e.g. with constant flow of 6l/min serial monitor and domoticz report anything between 12-15l/min) and also wrong water usage m3 and litre usage in Domoticz.

            When trying to debug, found out following behaviour (must be connected to Pulse length an Qn from data sheet IMHO):
            with each turn it indeed switches on, e.g. shortens the contacts which generates pulse for the sensor, however it takes up to 2-4 litres until switch is in the off state.

            As a result you might have a situation when meter switches on, one closes the tap, and the signal is on for minutes/hours until tap is again opened and 2-4 litres have been used, after which signal will switch off.

            Do I understand correctly that the debouncer which should take care of similar situations is not ready for this?

            thanks in advance for support

            1 Reply Last reply
            0
            • bart59B Offline
              bart59B Offline
              bart59
              wrote on last edited by
              #20

              Hi Aram

              The original code from the mysensors site does not handle your situation very well (indeed because the switch staying on or off for a long time). You can use my code (see my post further up this discussion). In my case I have a pulse every 1 liter.

              In your case you only have 1 pulse every 10 liters, which means you have to take a much longer period to calculate the flow correctly. Basically you have to set MIN_SEND_FREQ to a higher value. The flow is calculated based on the number of pulses in a given time period. Example: with 6 l/min you have to calculate this value only once every 5 minutes (=30 liter = 3 pulses from your Siemens meter) instead of every 30 seconds as I do. So if MIN_SEND_FREQ = 600 (every 5 minutes) your flow is calculated as:

              flow = ((double) (pulseCount-oldPulseCount)) * (60000.0 / ((double) intervalcnt*(double) CHECK_FREQUENCY)) / ppl;

              In the example above (pulseCount-oldPulseCount) = 3 pulses
              ppl = 0.1
              intervalcnt = MIN_SEND_FREQ = 600
              CHECK_FREQUENCY = 500
              ==> flow is 6 l/min

              regards

              Bart

              1 Reply Last reply
              1
              • A Offline
                A Offline
                aram
                wrote on last edited by
                #21

                bart59,

                thanks for quick reply. I will try to adjust MIN_SEND_FREQ and use your code.
                however, if I understand correctly, with the current logic used its impossible to avoid misinterpretations of pulses in case of very very long on or off state. It will approximate the flow rate to more correct value during usage of water (this is good enough) and should report total usage somehow correctly (this one I would better get as precise as possible). I wonder if the code will capture the correct number of pulses in the case of very long on state.

                BTW, I was not able to find a readily available sketch to connect NAMUR output, which is basically 5kOhm off state and 1.5795 kOhm on state. I believe, I will have to calculate required pull up resistance to get a proper voltage divider for 5\3.3v, right?

                1 Reply Last reply
                0
                • bart59B Offline
                  bart59B Offline
                  bart59
                  wrote on last edited by
                  #22

                  My code basically measures the time between two upward pulses. You can modify the code to also count the downward pulses. The net effect is that you will get a count every 5 liter (on average), but if there is no flow, the first pulse will always be off by 1-4 liter because you do not know how far the rotation is completed.

                  On NAMUR: you can actually use my code here too: I use analog input A1 to measure the voltage on the infra red sensor (which varies between 0 and 1.1 Volt). During the learn mode (set with a seaprate DIP switch) the code measures the input voltage for a period of 30 seconds while you turn open the water tap (you may want to increase the timing in your case) and then calculates the average between the lowest and highest voltage as the currect point there is a 1 or 0 coming from the pump (in my case it is an IR LED that is reflecting from a mirror into a photo sensor and the position of the mirror may change - resulting in different voltages).

                  regards
                  Bart

                  1 Reply Last reply
                  0
                  • Curtis DobrowolskiC Offline
                    Curtis DobrowolskiC Offline
                    Curtis Dobrowolski
                    wrote on last edited by
                    #23

                    Would anyone be able to help me get the hall sensor to work to work directly connected to an ESP8266 MQTT gateway? I was able to created the MQTT gateway, appended this sketch to the MQTT gateway sketch and connect the hall sensor DO to D12 (D3 is occupied), but when I subscribe to my mosquitto server no values are published. I am able to see the prefixes and they get published every 20 seconds as expected, but there are no sensor values. I plan on using this with home assistant, incase that helps with the final setup. If anyone has any recommendations it would be greatly appreciated.

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      jagadesh waran
                      wrote on last edited by
                      #24

                      Can you please roughly say

                      1. what is the current consumption overall
                      2. what is the current consumption when measuring a pulse
                      3. what is the current consumed when the data is transmitted
                      mfalkviddM 1 Reply Last reply
                      0
                      • J jagadesh waran

                        Can you please roughly say

                        1. what is the current consumption overall
                        2. what is the current consumption when measuring a pulse
                        3. what is the current consumed when the data is transmitted
                        mfalkviddM Offline
                        mfalkviddM Offline
                        mfalkvidd
                        Mod
                        wrote on last edited by mfalkvidd
                        #25

                        @jagadesh-waran welcome to the MySensors community.

                        The current consumption depends on which Arduino you are using and which radio you are using.

                        Could you describe what your goal is?

                        Maybe the page on battery power can be useful.

                        J 1 Reply Last reply
                        0
                        • mfalkviddM mfalkvidd

                          @jagadesh-waran welcome to the MySensors community.

                          The current consumption depends on which Arduino you are using and which radio you are using.

                          Could you describe what your goal is?

                          Maybe the page on battery power can be useful.

                          J Offline
                          J Offline
                          jagadesh waran
                          wrote on last edited by
                          #26

                          @mfalkvidd im using mini at 8mhz with a 3V battery, No LDO and an ESP8266

                          I want to calculate the battery life say im using 3V 19000mah battery and if im consuming 100 gallons per day

                          Could you please update me the life of the battery?

                          Could you please update me the current consumptions at various intervals?

                          mfalkviddM 1 Reply Last reply
                          0
                          • J jagadesh waran

                            @mfalkvidd im using mini at 8mhz with a 3V battery, No LDO and an ESP8266

                            I want to calculate the battery life say im using 3V 19000mah battery and if im consuming 100 gallons per day

                            Could you please update me the life of the battery?

                            Could you please update me the current consumptions at various intervals?

                            mfalkviddM Offline
                            mfalkviddM Offline
                            mfalkvidd
                            Mod
                            wrote on last edited by
                            #27

                            @jagadesh-waran The easiest ways is to either measure the consumption on your devices, or look at the datasheets.

                            1 Reply Last reply
                            0
                            • W Offline
                              W Offline
                              webzter30
                              wrote on last edited by
                              #28

                              I am trying this node. I have it set up. but I am having the same problem as Dirtbag. I am not getting any values. I debugged and I am getting 1 and 0 for my sensor output, so my sensor is working when I trigger it with a magnet.
                              Does this work with MQTT gateway?? am I missing something. Communication is fine between by ESP gateway and my node.?
                              Thanks ahead of time for any help with this.

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

                                Hi. i'm having a strange problem using a arduino nano connecting a hall sensor to read my water meter. My water meter is dated from 1996 and i can't use the TCRT5000 sensor so i'm trying my luck with the hall sensor. My problem is that my arduino is always sending data.... even if i have the water turned off the most strange thing is that even when the arduino is not connected to the hall sensor it send's data. How can i fix this problem ?

                                mfalkviddM 1 Reply Last reply
                                0
                                • mrc-coreM mrc-core

                                  Hi. i'm having a strange problem using a arduino nano connecting a hall sensor to read my water meter. My water meter is dated from 1996 and i can't use the TCRT5000 sensor so i'm trying my luck with the hall sensor. My problem is that my arduino is always sending data.... even if i have the water turned off the most strange thing is that even when the arduino is not connected to the hall sensor it send's data. How can i fix this problem ?

                                  mfalkviddM Offline
                                  mfalkviddM Offline
                                  mfalkvidd
                                  Mod
                                  wrote on last edited by
                                  #30

                                  @mrc-core did you read this part of the instructions?

                                  You can also set the frequency that the sensor will report the water consumption by updating the SEND_FREQUENCY. The default frequency 3 times per minute (every 20 seconds).

                                  mrc-coreM 1 Reply Last reply
                                  0
                                  • mfalkviddM mfalkvidd

                                    @mrc-core did you read this part of the instructions?

                                    You can also set the frequency that the sensor will report the water consumption by updating the SEND_FREQUENCY. The default frequency 3 times per minute (every 20 seconds).

                                    mrc-coreM Offline
                                    mrc-coreM Offline
                                    mrc-core
                                    wrote on last edited by mrc-core
                                    #31

                                    @mfalkvidd Yes i did but has you can see even when the hall sensor is not connected the arduino sends data and the water increases in the the gateway. I can work on the SEND_FREQUENCY and see if it fix this problem.

                                    Thnaks for the replay

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

                                      Have been working with the code and have found one strange thing. When my sensor sends data to the gateway "domoticz" the gateway sends a value to the sensor. The strange thing is that my arduino does not have any sensor connected and sow the data send is zero but my gateway sends akways a positive value and increases this value every time it sends data to the arduino.

                                      Even if i go to the arduino code and set the volume and pulseCount to 0 flash it to the arduino, load the value of zero to the gateway and then e flash the same code but this time i remove the volume and pulseCount to 0 the first time the arduino sends data to the gateway it always receive a value insted of zero since i dont have the hall sensor connected to the arduino.

                                      I'm using a arduino mini pro 3.3v on a easy pcb by soundberg81 and i have setup the digital pin2 to connect the hall sensor.

                                      Here's some log from my arduino:

                                      0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
                                      3 TSM:INIT
                                      4 TSF:WUR:MS=0
                                      11 TSM:INIT:TSP OK
                                      13 TSF:SID:OK,ID=1
                                      14 TSM:FPAR
                                      51 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
                                      1032 TSF:MSG:READ,0-0-1,s=255,c=3,t=8,pt=1,l=1,sg=0:0
                                      1037 TSF:MSG:FPAR OK,ID=0,D=1
                                      2058 TSM:FPAR:OK
                                      2059 TSM:ID
                                      2060 TSM:ID:OK
                                      2062 TSM:UPL
                                      2065 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
                                      2172 TSF:MSG:READ,0-0-1,s=255,c=3,t=25,pt=1,l=1,sg=0:1
                                      2178 TSF:MSG:PONG RECV,HP=1
                                      2181 TSM:UPL:OK
                                      2182 TSM:READY:ID=1,PAR=0,DIS=1
                                      2187 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
                                      2320 TSF:MSG:READ,0-0-1,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
                                      2327 TSF:MSG:SEND,1-1-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1
                                      2335 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
                                      3517 TSF:MSG:READ,0-0-1,s=255,c=3,t=6,pt=0,l=1,sg=0:M
                                      3526 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=11,pt=0,l=11,sg=0,ft=0,st=OK:Water Meter
                                      3535 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=12,pt=0,l=5,sg=0,ft=0,st=OK:2.4.B
                                      3544 TSF:MSG:SEND,1-1-0-0,s=1,c=0,t=21,pt=0,l=11,sg=0,ft=0,st=OK:Hall Sensor
                                      3551 MCO:REG:REQ
                                      3589 !TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=NACK:2
                                      5596 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=1,st=OK:2
                                      5665 TSF:MSG:READ,0-0-1,s=255,c=3,t=27,pt=1,l=1,sg=0:1
                                      5670 MCO:PIM:NODE REG=1
                                      5673 MCO:BGN:STP
                                      5677 TSF:MSG:SEND,1-1-0-0,s=1,c=2,t=25,pt=0,l=0,sg=0,ft=0,st=OK:
                                      5683 MCO:BGN:INIT OK,TSP=1
                                      6484 TSF:MSG:READ,0-0-1,s=1,c=2,t=25,pt=0,l=1,sg=0:0
                                      Received last pulse count from gw:2
                                      pulsecount:2
                                      35686 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:2
                                      volume:0.003
                                      35694 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.003
                                      l/min:2.05
                                      65687 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:2.05
                                      pulsecount:4
                                      65695 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:4
                                      volume:0.004
                                      65704 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.004
                                      l/min:0.00
                                      95688 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:0.00
                                      pulsecount:5
                                      95696 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:5
                                      volume:0.005
                                      95706 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.005
                                      pulsecount:5
                                      125689 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:5
                                      volume:0.006
                                      125698 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.006
                                      l/min:2.00
                                      155691 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:2.00
                                      pulsecount:7
                                      155699 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:7
                                      volume:0.007
                                      155708 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.007
                                      l/min:0.00
                                      185691 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:0.00
                                      pulsecount:8
                                      185699 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:8
                                      volume:0.008
                                      185708 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.008
                                      pulsecount:8
                                      215696 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:8
                                      volume:0.009
                                      215707 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.009
                                      l/min:2.00
                                      245693 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:2.00
                                      pulsecount:10
                                      245701 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:10
                                      volume:0.010
                                      245710 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.010
                                      l/min:0.00
                                      275694 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:0.00
                                      pulsecount:11
                                      275702 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:11
                                      volume:0.011
                                      275714 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.011
                                      pulsecount:11
                                      305695 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:11
                                      volume:0.012
                                      305703 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.012
                                      l/min:2.00
                                      335698 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:2.00
                                      pulsecount:13
                                      335707 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:13
                                      volume:0.013
                                      335718 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.013
                                      l/min:0.00
                                      365732 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:0.00
                                      pulsecount:14
                                      365776 !TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=NACK:14
                                      volume:0.014
                                      365788 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=1,st=OK:0.014
                                      376929 TSF:MSG:READ,0-0-255,s=255,c=3,t=20,pt=0,l=0,sg=0:
                                      376934 TSF:MSG:BC
                                      377041 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=21,pt=1,l=1,sg=0,ft=0,st=OK:0
                                      l/min:5.36
                                      395735 !TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=NACK:5.36
                                      pulsecount:16

                                      Again since i'm geting this problem i don't have my sensor connected to the arduino.

                                      mfalkviddM 1 Reply Last reply
                                      0
                                      • mrc-coreM mrc-core

                                        Have been working with the code and have found one strange thing. When my sensor sends data to the gateway "domoticz" the gateway sends a value to the sensor. The strange thing is that my arduino does not have any sensor connected and sow the data send is zero but my gateway sends akways a positive value and increases this value every time it sends data to the arduino.

                                        Even if i go to the arduino code and set the volume and pulseCount to 0 flash it to the arduino, load the value of zero to the gateway and then e flash the same code but this time i remove the volume and pulseCount to 0 the first time the arduino sends data to the gateway it always receive a value insted of zero since i dont have the hall sensor connected to the arduino.

                                        I'm using a arduino mini pro 3.3v on a easy pcb by soundberg81 and i have setup the digital pin2 to connect the hall sensor.

                                        Here's some log from my arduino:

                                        0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
                                        3 TSM:INIT
                                        4 TSF:WUR:MS=0
                                        11 TSM:INIT:TSP OK
                                        13 TSF:SID:OK,ID=1
                                        14 TSM:FPAR
                                        51 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
                                        1032 TSF:MSG:READ,0-0-1,s=255,c=3,t=8,pt=1,l=1,sg=0:0
                                        1037 TSF:MSG:FPAR OK,ID=0,D=1
                                        2058 TSM:FPAR:OK
                                        2059 TSM:ID
                                        2060 TSM:ID:OK
                                        2062 TSM:UPL
                                        2065 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
                                        2172 TSF:MSG:READ,0-0-1,s=255,c=3,t=25,pt=1,l=1,sg=0:1
                                        2178 TSF:MSG:PONG RECV,HP=1
                                        2181 TSM:UPL:OK
                                        2182 TSM:READY:ID=1,PAR=0,DIS=1
                                        2187 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
                                        2320 TSF:MSG:READ,0-0-1,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
                                        2327 TSF:MSG:SEND,1-1-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1
                                        2335 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
                                        3517 TSF:MSG:READ,0-0-1,s=255,c=3,t=6,pt=0,l=1,sg=0:M
                                        3526 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=11,pt=0,l=11,sg=0,ft=0,st=OK:Water Meter
                                        3535 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=12,pt=0,l=5,sg=0,ft=0,st=OK:2.4.B
                                        3544 TSF:MSG:SEND,1-1-0-0,s=1,c=0,t=21,pt=0,l=11,sg=0,ft=0,st=OK:Hall Sensor
                                        3551 MCO:REG:REQ
                                        3589 !TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=NACK:2
                                        5596 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=1,st=OK:2
                                        5665 TSF:MSG:READ,0-0-1,s=255,c=3,t=27,pt=1,l=1,sg=0:1
                                        5670 MCO:PIM:NODE REG=1
                                        5673 MCO:BGN:STP
                                        5677 TSF:MSG:SEND,1-1-0-0,s=1,c=2,t=25,pt=0,l=0,sg=0,ft=0,st=OK:
                                        5683 MCO:BGN:INIT OK,TSP=1
                                        6484 TSF:MSG:READ,0-0-1,s=1,c=2,t=25,pt=0,l=1,sg=0:0
                                        Received last pulse count from gw:2
                                        pulsecount:2
                                        35686 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:2
                                        volume:0.003
                                        35694 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.003
                                        l/min:2.05
                                        65687 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:2.05
                                        pulsecount:4
                                        65695 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:4
                                        volume:0.004
                                        65704 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.004
                                        l/min:0.00
                                        95688 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:0.00
                                        pulsecount:5
                                        95696 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:5
                                        volume:0.005
                                        95706 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.005
                                        pulsecount:5
                                        125689 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:5
                                        volume:0.006
                                        125698 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.006
                                        l/min:2.00
                                        155691 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:2.00
                                        pulsecount:7
                                        155699 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:7
                                        volume:0.007
                                        155708 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.007
                                        l/min:0.00
                                        185691 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:0.00
                                        pulsecount:8
                                        185699 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:8
                                        volume:0.008
                                        185708 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.008
                                        pulsecount:8
                                        215696 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:8
                                        volume:0.009
                                        215707 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.009
                                        l/min:2.00
                                        245693 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:2.00
                                        pulsecount:10
                                        245701 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:10
                                        volume:0.010
                                        245710 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.010
                                        l/min:0.00
                                        275694 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:0.00
                                        pulsecount:11
                                        275702 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:11
                                        volume:0.011
                                        275714 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.011
                                        pulsecount:11
                                        305695 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:11
                                        volume:0.012
                                        305703 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.012
                                        l/min:2.00
                                        335698 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:2.00
                                        pulsecount:13
                                        335707 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=OK:13
                                        volume:0.013
                                        335718 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=0,st=OK:0.013
                                        l/min:0.00
                                        365732 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=OK:0.00
                                        pulsecount:14
                                        365776 !TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=25,pt=5,l=4,sg=0,ft=0,st=NACK:14
                                        volume:0.014
                                        365788 TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=35,pt=7,l=5,sg=0,ft=1,st=OK:0.014
                                        376929 TSF:MSG:READ,0-0-255,s=255,c=3,t=20,pt=0,l=0,sg=0:
                                        376934 TSF:MSG:BC
                                        377041 TSF:MSG:SEND,1-1-0-0,s=255,c=3,t=21,pt=1,l=1,sg=0,ft=0,st=OK:0
                                        l/min:5.36
                                        395735 !TSF:MSG:SEND,1-1-0-0,s=1,c=1,t=34,pt=7,l=5,sg=0,ft=0,st=NACK:5.36
                                        pulsecount:16

                                        Again since i'm geting this problem i don't have my sensor connected to the arduino.

                                        mfalkviddM Offline
                                        mfalkviddM Offline
                                        mfalkvidd
                                        Mod
                                        wrote on last edited by
                                        #33

                                        @mrc-core if nothing is connected to the sensor pin, the pin will float and might create spurious interrupts. Connect the pin to gnd to make sure it doesn't get any false triggers.

                                        mrc-coreM 1 Reply Last reply
                                        0
                                        • mfalkviddM mfalkvidd

                                          @mrc-core if nothing is connected to the sensor pin, the pin will float and might create spurious interrupts. Connect the pin to gnd to make sure it doesn't get any false triggers.

                                          mrc-coreM Offline
                                          mrc-coreM Offline
                                          mrc-core
                                          wrote on last edited by
                                          #34

                                          @mfalkvidd Thanks. Have now connected the digital pin2 to gnd and in the last 1h the values are always 0.000 going to leave it this way until night since now i'm at work. I would like to find out what was creating the spurious interrupts??
                                          Other thing that ill find out tonight is when i connect the sensor to the arduino will it create rong data or will it only send real data only when the water meter starts running water...

                                          One more thing today at 8:00 when i did the pin2 to gnd the first "boot" over domoticz i got this value as you can see on the image below. Is this normal? Have been trying to deleted but it wont go away.

                                          Once again thanks for your help.

                                          0_1497430047720_Water data.png

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


                                          16

                                          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