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
-
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
-
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.inoThe 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.
-
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.
Suggested Topics
-
Over the air updates
General Discussion • 23 Mar 2014, 21:38 • ToSa 1 Mar 2015, 11:21 -
Arduino Nano Every problem
Hardware • 1 Feb 2020, 09:18 • hakha4 5 Dec 2023, 02:21 -
Sensors and more
Hardware • 19 Jun 2023, 00:41 • Robert Leverett 19 Jun 2023, 00:41 -
Does MySensors require Arduino Timer 2?
Hardware • 6 Jan 2024, 19:39 • OldSurferDude 11 Jan 2024, 04:39 -
hlk-pm01 are to noisy for rfm69?
Hardware • 5 Aug 2023, 21:16 • Tmaster 9 Aug 2023, 16:28 -
Sensor to detect marijuana vape/smoke
Hardware • 21 Jan 2025, 06:36 • Hellmark 25 Feb 2025, 20:56