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 3.7k 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.
  • M Offline
    M 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
      • M Offline
        M 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
          • Q Offline
            Q 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
              • M Offline
                M Offline
                mikee
                wrote on last edited by
                #7

                Oh thanks everybody, I'll try it today.

                1 Reply Last reply
                1

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                13

                Online

                12.0k

                Users

                11.2k

                Topics

                113.4k

                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