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. Gasmeter accuracy

Gasmeter accuracy

Scheduled Pinned Locked Moved Hardware
7 Posts 4 Posters 1.6k Views 4 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.
  • mikeeM Offline
    mikeeM Offline
    mikee
    wrote on last edited by
    #1

    Hi Guys,
    I have a MS gas meter based on Water meter sketch measuring on BK-G4T gas meter. I am using Mader reed switch. During winter my readings were corresponding with analog scale on gas meter (I had 6-12m3/day - heating, Hot water and cooking). But now in summer (Cooking, hot water) I am getting 0,5 - 4m3/day but real consumption is only ca.0,3-0,5 m3 a day. Has anyone idea how to correct this or what causes the problem ? Is the magnet (on analog gas meter scale) stuck in some position causing it?
    Thanks

    1 Reply Last reply
    0
    • gohanG Offline
      gohanG Offline
      gohan
      Mod
      wrote on last edited by
      #2

      do you have a debounce function? Maybe the slow moving magnet is triggering the reed switch multiple times when is at the limit of the magnetic field

      1 Reply Last reply
      0
      • mikeeM Offline
        mikeeM Offline
        mikee
        wrote on last edited by
        #3

        No debounce function in sketch. Im just looking for some examples. Is the best (only) way to do it trough debounce.h library?
        Thanks gohan

        1 Reply Last reply
        0
        • gohanG Offline
          gohanG Offline
          gohan
          Mod
          wrote on last edited by
          #4

          I am no expert on debouce, hopefully someone else will join the discussion. :D

          1 Reply Last reply
          0
          • qqlapralineQ Offline
            qqlapralineQ Offline
            qqlapraline
            wrote on last edited by
            #5

            Helllo guys,

            Here is a small sketch (it may be version 1.5 of MySensors) that I've used for measuring Gas consumption.
            0_1498509273489_EnergyMeterPulseSensor.ino

            The key is between line 125 and 136 (I have removed my debug lines for more clarity and a useless statement):

              int input_state = digitalRead(DIGITAL_INPUT_SENSOR);
              gw.wait(30);
              
              if ((input_state == LOW)) {
                pulseCount++;
              }
            

            The gw.wait(30) acts as a debouncer.
            I hope this is clear.
            Regards,

            QQ.

            1 Reply Last reply
            1
            • mfalkviddM Offline
              mfalkviddM Offline
              mfalkvidd
              Mod
              wrote on last edited by mfalkvidd
              #6

              Using wait as suggested above is a simple and effective way to debounce. MySensors 1.x used gw.wait(), MySensors 2.x uses wait().

              Another method is used in the onPulse function in https://www.mysensors.org/build/pulse_power

              An example using the Bounce2 library is available at https://www.mysensors.org/build/binary

              1 Reply Last reply
              0
              • mikeeM Offline
                mikeeM Offline
                mikee
                wrote on last edited by
                #7

                Oh thanks everybody, I'll try it today.

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


                33

                Online

                11.7k

                Users

                11.2k

                Topics

                113.1k

                Posts


                Copyright 2025 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