Gasmeter accuracy



  • 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


  • Mod

    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



  • 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


  • Mod

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



  • 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.


  • Mod

    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



  • Oh thanks everybody, I'll try it today.


Log in to reply
 

Suggested Topics

  • 87
  • 7
  • 7
  • 1
  • 2
  • 3

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts