I've hooked up an NPN sensor (LJ12A3-4-Z/BX) to a NodeMCU module. The pulse counter is being used as watermeter. The sensor is working and the correct amount of pulses matches the counter on the watermeter.
Unfortunately the software is counting false liters. In the attached PDF file i've wrote down all the numbers and start counting the pulses (physical and in the software) and they don't match as you can see: Waterstand.pdf.
I've wrote down this numbers for the latest test from ESPEasy:
Count: 0
Total: 57
Then i've flushed the toilet (7 liters and this matches the 7 pulses) but the total is ending on 73, that's 9 liters more than the LED pulses....
1 LED pulse is 1 liter in the software.
1 LED pulse is not 1 liter in the software, the exact difference varies between 2 and 11...
Yes, problems is still there after a power cycle.
Hardware: NodeMCU (ESP8266)
ESP Easy version: ESPEasy_mega-20181128/bin/ESP_Easy_mega-20181128_normal_ESP8266_4096.bin
ESP Easy settings/screenshots:
414510: MQTT : Connection lost, state: Connection timeout
414542: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
414543: Subscribed to: domoticz/out
414672: Domoticz: Sensortype: 1 idx: 30 values: 0.00
414672: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
422041: WD : Uptime 7 ConnectFailures 8 FreeMem 14256
422930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 109.27 loopCounterMax: 333333 loopCounterLast: 262559 countFin
422931: Scheduler stats: (called/tasks/max_length/idle%) 3646753/27206/8/91.20
452041: WD : Uptime 8 ConnectFailures 8 FreeMem 14104
452930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 104.57 loopCounterMax: 333333 loopCounterLast: 273748 countFin
452931: Scheduler stats: (called/tasks/max_length/idle%) 273748/1982/8/91.10
465688: MQTT : Connection lost, state: Connection timeout
465722: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
465723: Subscribed to: domoticz/out
465848: Domoticz: Sensortype: 1 idx: 30 values: 7.00
465849: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'7.00'}
482041: WD : Uptime 8 ConnectFailures 9 FreeMem 14040
482930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 120.42 loopCounterMax: 333333 loopCounterLast: 239097 countFin
482931: Scheduler stats: (called/tasks/max_length/idle%) 239097/1818/8/90.40
512041: WD : Uptime 9 ConnectFailures 9 FreeMem 14040
512930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 110.78 loopCounterMax: 333333 loopCounterLast: 259056 countFin
512931: Scheduler stats: (called/tasks/max_length/idle%) 259056/1907/8/90.70
516865: MQTT : Connection lost, state: Connection timeout
516902: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
516903: Subscribed to: domoticz/out
517028: Domoticz: Sensortype: 1 idx: 30 values: 4.00
517029: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'4.00'}
542041: WD : Uptime 9 ConnectFailures 10 FreeMem 13944
542930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 104.68 loopCounterMax: 333333 loopCounterLast: 273503 countFin
542931: Scheduler stats: (called/tasks/max_length/idle%) 273503/1981/8/90.90
568047: MQTT : Connection lost, state: Connection timeout
568080: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
568081: Subscribed to: domoticz/out
568208: Domoticz: Sensortype: 1 idx: 30 values: 0.00
568208: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
572041: WD : Uptime 10 ConnectFailures 11 FreeMem 14272
572931: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 105.98 loopCounterMax: 333333 loopCounterLast: 270290 countFin
572931: Scheduler stats: (called/tasks/max_length/idle%) 270290/1966/8/91.10
602041: WD : Uptime 10 ConnectFailures 11 FreeMem 13848
602930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 105.47 loopCounterMax: 333333 loopCounterLast: 271511 countFin
602931: Scheduler stats: (called/tasks/max_length/idle%) 271511/1967/8/91.00
619227: MQTT : Connection lost, state: Connection timeout
619259: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
619260: Subscribed to: domoticz/out
619386: Domoticz: Sensortype: 1 idx: 30 values: 0.00
619387: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
632041: WD : Uptime 11 ConnectFailures 12 FreeMem 14064
632930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 105.30 loopCounterMax: 333333 loopCounterLast: 271953 countFin
632931: Scheduler stats: (called/tasks/max_length/idle%) 271953/1984/8/90.90
662041: WD : Uptime 11 ConnectFailures 12 FreeMem 13848
662930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 105.84 loopCounterMax: 333333 loopCounterLast: 270613 countFin
662931: Scheduler stats: (called/tasks/max_length/idle%) 270613/1982/8/91.40
670155: MQTT : Connection lost, state: Connection timeout
670200: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
670201: Subscribed to: domoticz/out
670326: Domoticz: Sensortype: 1 idx: 30 values: 0.00
670327: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
692041: WD : Uptime 12 ConnectFailures 13 FreeMem 13848
692930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 105.41 loopCounterMax: 333333 loopCounterLast: 271607 countFin
692931: Scheduler stats: (called/tasks/max_length/idle%) 271607/1980/8/91.10
721345: MQTT : Connection lost, state: Connection timeout
721383: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
721384: Subscribed to: domoticz/out
721510: Domoticz: Sensortype: 1 idx: 30 values: 0.00
721511: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
722041: WD : Uptime 12 ConnectFailures 14 FreeMem 15280
722931: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 104.66 loopCounterMax: 333333 loopCounterLast: 273502 countFin
722932: Scheduler stats: (called/tasks/max_length/idle%) 273502/1983/8/90.90
752041: WD : Uptime 13 ConnectFailures 14 FreeMem 13176
752930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 105.93 loopCounterMax: 333333 loopCounterLast: 270346 countFin
752931: Scheduler stats: (called/tasks/max_length/idle%) 270346/1982/8/91.20
772528: MQTT : Connection lost, state: Connection timeout
772567: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
772568: Subscribed to: domoticz/out
772694: Domoticz: Sensortype: 1 idx: 30 values: 0.00
772695: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
782041: WD : Uptime 13 ConnectFailures 15 FreeMem 13776
812041: WD : Uptime 14 ConnectFailures 15 FreeMem 13848
812930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 106.19 loopCounterMax: 333333 loopCounterLast: 269756 countFin
812931: Scheduler stats: (called/tasks/max_length/idle%) 269756/1982/8/91.20
823723: MQTT : Connection lost, state: Connection timeout
823762: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
823763: Subscribed to: domoticz/out
823888: Domoticz: Sensortype: 1 idx: 30 values: 0.00
823889: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
842041: WD : Uptime 14 ConnectFailures 16 FreeMem 13832
842930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 111.37 loopCounterMax: 333333 loopCounterLast: 257766 countFin
842931: Scheduler stats: (called/tasks/max_length/idle%) 257766/1908/8/88.30
872041: WD : Uptime 15 ConnectFailures 16 FreeMem 13768
872930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 112.10 loopCounterMax: 333333 loopCounterLast: 256148 countFin
872931: Scheduler stats: (called/tasks/max_length/idle%) 256148/1902/8/90.20
874907: MQTT : Connection lost, state: Connection timeout
874938: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
874938: Subscribed to: domoticz/out
875065: Domoticz: Sensortype: 1 idx: 30 values: 1.00
875066: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'1.00'}
902041: WD : Uptime 15 ConnectFailures 17 FreeMem 13720
902930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 130.58 loopCounterMax: 333333 loopCounterLast: 221186 countFin
902931: Scheduler stats: (called/tasks/max_length/idle%) 221186/1712/8/90.00
925582: MQTT : Connection lost, state: Connection timeout
925612: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
925613: Subscribed to: domoticz/out
925756: Domoticz: Sensortype: 1 idx: 30 values: 6.00
925757: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'6.00'}
932043: WD : Uptime 16 ConnectFailures 18 FreeMem 12032
932930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 115.30 loopCounterMax: 333333 loopCounterLast: 249347 countFin
932931: Scheduler stats: (called/tasks/max_length/idle%) 249347/1861/8/91.20
962212: WD : Uptime 16 ConnectFailures 18 FreeMem 10680
962930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 111.51 loopCounterMax: 333333 loopCounterLast: 257454 countFin
962931: Scheduler stats: (called/tasks/max_length/idle%) 257454/1904/8/90.30
976530: MQTT : Connection lost, state: Connection timeout
976561: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
976562: Subscribed to: domoticz/out
976703: Domoticz: Sensortype: 1 idx: 30 values: 9.00
976703: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'9.00'}
992041: WD : Uptime 17 ConnectFailures 19 FreeMem 13624
992930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 123.68 loopCounterMax: 333333 loopCounterLast: 233120 countFin
992931: Scheduler stats: (called/tasks/max_length/idle%) 233120/1766/8/89.60
1022041: WD : Uptime 17 ConnectFailures 19 FreeMem 13624
1022930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 104.47 loopCounterMax: 333333 loopCounterLast: 274035 countFin
1022931: Scheduler stats: (called/tasks/max_length/idle%) 274035/1982/8/90.90
1027472: MQTT : Connection lost, state: Connection timeout
1027524: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1027525: Subscribed to: domoticz/out
1027659: Domoticz: Sensortype: 1 idx: 30 values: 1.00
1027659: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'1.00'}
1052041: WD : Uptime 18 ConnectFailures 20 FreeMem 13624
1052931: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 105.00 loopCounterMax: 333333 loopCounterLast: 272735 countFin
1052931: Scheduler stats: (called/tasks/max_length/idle%) 272735/1980/8/90.60
1078675: MQTT : Connection lost, state: Connection timeout
1078705: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1078705: Subscribed to: domoticz/out
1078832: Domoticz: Sensortype: 1 idx: 30 values: 0.00
1078832: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
1082587: WD : Uptime 18 ConnectFailures 21 FreeMem 12408
1082930: LoopStats: shortestLoop: 90 longestLoop: 885879 avgLoopDuration: 115.37 loopCounterMax: 333333 loopCounterLast: 249141 countFin
1082931: Scheduler stats: (called/tasks/max_length/idle%) 249141/1908/8/91.00
1112041: WD : Uptime 19 ConnectFailures 21 FreeMem 13552
1113057: LoopStats: shortestLoop: 90 longestLoop: 1001619 avgLoopDuration: 139.92 loopCounterMax: 333333 loopCounterLast: 207794 countFi
1113057: Scheduler stats: (called/tasks/max_length/idle%) 207793/1618/8/89.80
1119587: MQTT : Connection lost, state: Connection timeout
1119621: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1119622: Subscribed to: domoticz/out
1119747: Domoticz: Sensortype: 1 idx: 30 values: 5.00
1119748: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'5.00'}
1142041: WD : Uptime 19 ConnectFailures 22 FreeMem 14240
1142930: LoopStats: shortestLoop: 90 longestLoop: 1001619 avgLoopDuration: 119.54 loopCounterMax: 333333 loopCounterLast: 239847 countFi
1142931: Scheduler stats: (called/tasks/max_length/idle%) 239847/1800/8/90.50
1170766: MQTT : Connection lost, state: Connection timeout
1170834: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1170835: Subscribed to: domoticz/out
1170962: Domoticz: Sensortype: 1 idx: 30 values: 1.00
1170963: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'1.00'}
1172041: WD : Uptime 20 ConnectFailures 23 FreeMem 15088
1172930: LoopStats: shortestLoop: 90 longestLoop: 1001619 avgLoopDuration: 106.66 loopCounterMax: 333333 loopCounterLast: 268581 countFi
1172931: Scheduler stats: (called/tasks/max_length/idle%) 268581/1978/8/90.90
1202041: WD : Uptime 20 ConnectFailures 23 FreeMem 13576
1221738: MQTT : Connection lost, state: Connection timeout
1221770: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1221771: Subscribed to: domoticz/out
1221896: Domoticz: Sensortype: 1 idx: 30 values: 1.00
1221897: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'1.00'}
1232041: WD : Uptime 21 ConnectFailures 24 FreeMem 14016
1232944: LoopStats: shortestLoop: 90 longestLoop: 1001619 avgLoopDuration: 109.15 loopCounterMax: 333333 loopCounterLast: 262892 countFi
1232944: Scheduler stats: (called/tasks/max_length/idle%) 262892/1925/8/90.20
1262041: WD : Uptime 21 ConnectFailures 24 FreeMem 13528
1262930: LoopStats: shortestLoop: 90 longestLoop: 1001619 avgLoopDuration: 107.46 loopCounterMax: 333333 loopCounterLast: 266626 countFi
1262931: Scheduler stats: (called/tasks/max_length/idle%) 266626/1936/8/91.00
1272915: MQTT : Connection lost, state: Connection timeout
1272948: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1272949: Subscribed to: domoticz/out
1273074: Domoticz: Sensortype: 1 idx: 30 values: 0.00
1273075: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
1322041: WD : Uptime 22 ConnectFailures 25 FreeMem 13528
1322930: LoopStats: shortestLoop: 90 longestLoop: 1001619 avgLoopDuration: 104.64 loopCounterMax: 333333 loopCounterLast: 273607 countFi
1322931: Scheduler stats: (called/tasks/max_length/idle%) 547935/3963/8/91.30
1323841: MQTT : Connection lost, state: Connection timeout
1323872: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1323873: Subscribed to: domoticz/out
1323999: Domoticz: Sensortype: 1 idx: 30 values: 0.00
1323999: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
1352041: WD : Uptime 23 ConnectFailures 26 FreeMem 13528
1352931: LoopStats: shortestLoop: 90 longestLoop: 1001619 avgLoopDuration: 104.79 loopCounterMax: 333333 loopCounterLast: 273237 countFi
1352931: Scheduler stats: (called/tasks/max_length/idle%) 273237/1982/8/90.80
1374775: MQTT : Connection lost, state: Connection timeout
1374807: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1374808: Subscribed to: domoticz/out
1374933: Domoticz: Sensortype: 1 idx: 30 values: 0.00
1374934: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
1382041: WD : Uptime 23 ConnectFailures 27 FreeMem 13544
1382931: LoopStats: shortestLoop: 90 longestLoop: 1001619 avgLoopDuration: 106.12 loopCounterMax: 333333 loopCounterLast: 269978 countFi
1382931: Scheduler stats: (called/tasks/max_length/idle%) 269978/1966/8/90.90
1412930: LoopStats: shortestLoop: 90 longestLoop: 1001619 avgLoopDuration: 106.52 loopCounterMax: 333333 loopCounterLast: 268940 countFi
1412931: Scheduler stats: (called/tasks/max_length/idle%) 268940/1982/8/91.20
1425952: MQTT : Connection lost, state: Connection timeout
1425991: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1425992: Subscribed to: domoticz/out
1426361: Domoticz: Sensortype: 1 idx: 30 values: 5.00
1426362: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'5.00'}
1442041: WD : Uptime 24 ConnectFailures 28 FreeMem 13512
1442932: LoopStats: shortestLoop: 90 longestLoop: 1001619 avgLoopDuration: 125.82 loopCounterMax: 333333 loopCounterLast: 229281 countFi
1442933: Scheduler stats: (called/tasks/max_length/idle%) 229281/1752/8/85.00
1472041: WD : Uptime 25 ConnectFailures 28 FreeMem 13512
1472931: LoopStats: shortestLoop: 90 longestLoop: 1001619 avgLoopDuration: 123.64 loopCounterMax: 333333 loopCounterLast: 233159 countFi
1472932: Scheduler stats: (called/tasks/max_length/idle%) 233159/1769/8/88.90
1487652: MQTT : Connection lost, state: Connection timeout
1487686: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1487687: Subscribed to: domoticz/out
1487813: Domoticz: Sensortype: 1 idx: 30 values: 12.00
1487813: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'12.00'}
1502042: WD : Uptime 25 ConnectFailures 29 FreeMem 13216
1502930: LoopStats: shortestLoop: 90 longestLoop: 1001619 avgLoopDuration: 121.72 loopCounterMax: 333333 loopCounterLast: 236666 countFi
1502931: Scheduler stats: (called/tasks/max_length/idle%) 236666/1796/8/90.00
1528269: MQTT : Connection lost, state: Connection timeout
1528311: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1528312: Subscribed to: domoticz/out
1528440: Domoticz: Sensortype: 1 idx: 30 values: 7.00
1528440: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'7.00'}
1532041: WD : Uptime 26 ConnectFailures 30 FreeMem 14192
1532930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 140.51 loopCounterMax: 333333 loopCounterLast: 206101 countFi
1532931: Scheduler stats: (called/tasks/max_length/idle%) 206101/1590/8/89.80
1562041: WD : Uptime 26 ConnectFailures 30 FreeMem 13512
1562930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.11 loopCounterMax: 333333 loopCounterLast: 272357 countFi
1562931: Scheduler stats: (called/tasks/max_length/idle%) 272357/1982/8/91.10
1579207: MQTT : Connection lost, state: Connection timeout
1579237: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1579238: Subscribed to: domoticz/out
1579363: Domoticz: Sensortype: 1 idx: 30 values: 0.00
1579364: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
1592041: WD : Uptime 27 ConnectFailures 31 FreeMem 13440
1592930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.55 loopCounterMax: 333333 loopCounterLast: 271321 countFi
1592931: Scheduler stats: (called/tasks/max_length/idle%) 271321/1983/8/90.90
1622041: WD : Uptime 27 ConnectFailures 31 FreeMem 13512
1622946: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 104.62 loopCounterMax: 333333 loopCounterLast: 273757 countFi
1622946: Scheduler stats: (called/tasks/max_length/idle%) 273757/1982/8/91.10
1630382: MQTT : Connection lost, state: Connection timeout
1630429: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1630430: Subscribed to: domoticz/out
1630556: Domoticz: Sensortype: 1 idx: 30 values: 1.00
1630556: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'1.00'}
1652041: WD : Uptime 28 ConnectFailures 32 FreeMem 13512
1652930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.37 loopCounterMax: 333333 loopCounterLast: 271618 countFi
1652931: Scheduler stats: (called/tasks/max_length/idle%) 271618/1982/8/91.00
1681576: MQTT : Connection lost, state: Connection timeout
1681614: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1681615: Subscribed to: domoticz/out
1681740: Domoticz: Sensortype: 1 idx: 30 values: 0.00
1681741: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
1682041: WD : Uptime 28 ConnectFailures 33 FreeMem 14864
1682941: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 104.98 loopCounterMax: 333333 loopCounterLast: 272789 countFi
1682942: Scheduler stats: (called/tasks/max_length/idle%) 272789/1983/8/91.00
1712041: WD : Uptime 29 ConnectFailures 33 FreeMem 13512
1712930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.17 loopCounterMax: 333333 loopCounterLast: 272162 countFi
1712931: Scheduler stats: (called/tasks/max_length/idle%) 272162/1982/8/91.00
1732759: MQTT : Connection lost, state: Connection timeout
1732795: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1732796: Subscribed to: domoticz/out
1732921: Domoticz: Sensortype: 1 idx: 30 values: 0.00
1732922: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
1742041: WD : Uptime 29 ConnectFailures 34 FreeMem 13440
1742930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.48 loopCounterMax: 333333 loopCounterLast: 271482 countFi
1742931: Scheduler stats: (called/tasks/max_length/idle%) 271482/1983/8/90.70
1757407: SaveToFile: free stack: 3232
1757439: FILE : Saved config.dat
1757439: SaveToFile: free stack after: 3232
1757446: SaveToFile: free stack: 3296
1757477: FILE : Saved config.dat
1757477: SaveToFile: free stack after: 3296
1757485: SaveToFile: free stack: 3248
1757554: FILE : Saved config.dat
1757554: SaveToFile: free stack after: 3248
1757566: INIT : Pulse 14
1757712: Domoticz: Sensortype: 1 idx: 30 values: 0.00
1757713: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
1772041: WD : Uptime 30 ConnectFailures 33 FreeMem 13512
1772930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 115.15 loopCounterMax: 333333 loopCounterLast: 249595 countFi
1772931: Scheduler stats: (called/tasks/max_length/idle%) 249594/1862/8/90.40
1788011: MQTT : Connection lost, state: Connection timeout
1788044: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1788045: Subscribed to: domoticz/out
1788170: Domoticz: Sensortype: 1 idx: 30 values: 3.00
1788171: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'3.00'}
1802041: WD : Uptime 30 ConnectFailures 34 FreeMem 15976
1802930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 120.58 loopCounterMax: 333333 loopCounterLast: 238827 countFi
1802931: Scheduler stats: (called/tasks/max_length/idle%) 238827/1790/8/91.50
1832041: WD : Uptime 31 ConnectFailures 34 FreeMem 13512
1832930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 124.66 loopCounterMax: 333333 loopCounterLast: 231278 countFi
1832931: Scheduler stats: (called/tasks/max_length/idle%) 231278/1759/8/90.20
1839189: MQTT : Connection lost, state: Connection timeout
1839220: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1839221: Subscribed to: domoticz/out
1839347: Domoticz: Sensortype: 1 idx: 30 values: 13.00
1839348: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'13.00'}
1862041: WD : Uptime 31 ConnectFailures 35 FreeMem 13512
1862930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 112.66 loopCounterMax: 333333 loopCounterLast: 254919 countFi
1862931: Scheduler stats: (called/tasks/max_length/idle%) 254919/1891/8/89.80
1922041: WD : Uptime 32 ConnectFailures 36 FreeMem 13200
1922930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 104.96 loopCounterMax: 333333 loopCounterLast: 272755 countFi
1922931: Scheduler stats: (called/tasks/max_length/idle%) 272755/1982/8/91.00
1941637: MQTT : Connection lost, state: Connection timeout
1941745: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1941746: Subscribed to: domoticz/out
1941871: Domoticz: Sensortype: 1 idx: 30 values: 1.00
1941872: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'1.00'}
1952041: WD : Uptime 33 ConnectFailures 37 FreeMem 13408
1952930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 107.07 loopCounterMax: 333333 loopCounterLast: 267626 countFi
1952931: Scheduler stats: (called/tasks/max_length/idle%) 267626/1978/8/90.50
1982042: WD : Uptime 33 ConnectFailures 37 FreeMem 11832
1982930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 104.75 loopCounterMax: 333333 loopCounterLast: 273264 countFi
1982931: Scheduler stats: (called/tasks/max_length/idle%) 273264/1982/8/90.90
1992889: MQTT : Connection lost, state: Connection timeout
1992920: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
1992921: Subscribed to: domoticz/out
1993046: Domoticz: Sensortype: 1 idx: 30 values: 0.00
1993046: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
2012041: WD : Uptime 34 ConnectFailures 38 FreeMem 13512
2012930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 104.36 loopCounterMax: 333333 loopCounterLast: 274253 countFi
2012931: Scheduler stats: (called/tasks/max_length/idle%) 274253/1981/8/90.70
2042041: WD : Uptime 34 ConnectFailures 38 FreeMem 13512
2042930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.23 loopCounterMax: 333333 loopCounterLast: 272077 countFi
2042931: Scheduler stats: (called/tasks/max_length/idle%) 272077/1982/8/91.10
2043814: MQTT : Connection lost, state: Connection timeout
2043886: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
2043887: Subscribed to: domoticz/out
2044012: Domoticz: Sensortype: 1 idx: 30 values: 0.00
2044013: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
2072049: WD : Uptime 35 ConnectFailures 39 FreeMem 11352
2072930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.59 loopCounterMax: 333333 loopCounterLast: 271195 countFi
2072931: Scheduler stats: (called/tasks/max_length/idle%) 271195/1978/8/90.50
2102041: WD : Uptime 35 ConnectFailures 39 FreeMem 12568
2102930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.41 loopCounterMax: 333333 loopCounterLast: 271643 countFi
2102931: Scheduler stats: (called/tasks/max_length/idle%) 271643/1982/8/91.10
2105032: MQTT : Connection lost, state: Connection timeout
2105068: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
2105069: Subscribed to: domoticz/out
2105194: Domoticz: Sensortype: 1 idx: 30 values: 0.00
2105194: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
2132041: WD : Uptime 36 ConnectFailures 40 FreeMem 13352
2132930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 106.20 loopCounterMax: 333333 loopCounterLast: 269458 countFi
2132931: Scheduler stats: (called/tasks/max_length/idle%) 269458/1983/8/90.90
2156213: MQTT : Connection lost, state: Connection timeout
2156246: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
2156247: Subscribed to: domoticz/out
2156372: Domoticz: Sensortype: 1 idx: 30 values: 0.00
2156373: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
2162041: WD : Uptime 36 ConnectFailures 41 FreeMem 15264
2162930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 106.94 loopCounterMax: 333333 loopCounterLast: 267630 countFi
2162931: Scheduler stats: (called/tasks/max_length/idle%) 267630/1983/8/90.70
2192041: WD : Uptime 37 ConnectFailures 41 FreeMem 12568
2192930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.09 loopCounterMax: 333333 loopCounterLast: 272147 countFi
2192931: Scheduler stats: (called/tasks/max_length/idle%) 272147/1982/8/90.90
2217639: MQTT : Connection lost, state: Connection timeout
2217670: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
2217671: Subscribed to: domoticz/out
2217796: Domoticz: Sensortype: 1 idx: 30 values: 4.00
2217797: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'4.00'}
2222041: WD : Uptime 37 ConnectFailures 42 FreeMem 14560
2222931: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.42 loopCounterMax: 333333 loopCounterLast: 271318 countFi
2222931: Scheduler stats: (called/tasks/max_length/idle%) 271318/1983/8/90.70
2252041: WD : Uptime 38 ConnectFailures 42 FreeMem 13464
2252930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 104.68 loopCounterMax: 333333 loopCounterLast: 273174 countFi
2252931: Scheduler stats: (called/tasks/max_length/idle%) 273174/1982/8/91.10
2268815: MQTT : Connection lost, state: Connection timeout
2268846: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
2268847: Subscribed to: domoticz/out
2268972: Domoticz: Sensortype: 1 idx: 30 values: 11.00
2268973: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'11.00'}
2282041: WD : Uptime 38 ConnectFailures 43 FreeMem 13392
2282930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.29 loopCounterMax: 333333 loopCounterLast: 271640 countFi
2282931: Scheduler stats: (called/tasks/max_length/idle%) 271640/1981/8/90.70
2312041: WD : Uptime 39 ConnectFailures 43 FreeMem 13464
2312930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 104.61 loopCounterMax: 333333 loopCounterLast: 273315 countFi
2312931: Scheduler stats: (called/tasks/max_length/idle%) 273315/1982/8/91.10
2319990: MQTT : Connection lost, state: Connection timeout
2320023: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
2320024: Subscribed to: domoticz/out
2320150: Domoticz: Sensortype: 1 idx: 30 values: 15.00
2320150: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'15.00'}
2342041: WD : Uptime 39 ConnectFailures 44 FreeMem 13464
2342930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.12 loopCounterMax: 333333 loopCounterLast: 272110 countFi
2342931: Scheduler stats: (called/tasks/max_length/idle%) 272110/1984/8/90.80
2371166: MQTT : Connection lost, state: Connection timeout
2371196: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
2371197: Subscribed to: domoticz/out
2371323: Domoticz: Sensortype: 1 idx: 30 values: 0.00
2371323: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
2372041: WD : Uptime 40 ConnectFailures 45 FreeMem 15152
2372930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.33 loopCounterMax: 333333 loopCounterLast: 271650 countFi
2372931: Scheduler stats: (called/tasks/max_length/idle%) 271650/1983/8/90.80
2402041: WD : Uptime 40 ConnectFailures 45 FreeMem 13464
2402930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 112.59 loopCounterMax: 333333 loopCounterLast: 254865 countFi
2402931: Scheduler stats: (called/tasks/max_length/idle%) 254865/1874/8/90.30
2422091: MQTT : Connection lost, state: Connection timeout
2422152: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
2422153: Subscribed to: domoticz/out
2422279: Domoticz: Sensortype: 1 idx: 30 values: 0.00
2422280: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'0.00'}
2432041: WD : Uptime 41 ConnectFailures 46 FreeMem 13832
2432930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.33 loopCounterMax: 333333 loopCounterLast: 271662 countFi
2432931: Scheduler stats: (called/tasks/max_length/idle%) 271662/1979/8/90.80
2462041: WD : Uptime 41 ConnectFailures 46 FreeMem 13352
2473296: MQTT : Connection lost, state: Connection timeout
2473328: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
2473329: Subscribed to: domoticz/out
2473459: Domoticz: Sensortype: 1 idx: 30 values: 3.00
2473459: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'3.00'}
2492041: WD : Uptime 42 ConnectFailures 47 FreeMem 13464
2492930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 106.48 loopCounterMax: 333333 loopCounterLast: 268858 countFi
2492931: Scheduler stats: (called/tasks/max_length/idle%) 268858/1983/8/90.90
2522041: WD : Uptime 42 ConnectFailures 47 FreeMem 13464
2522931: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.05 loopCounterMax: 333333 loopCounterLast: 272292 countFi
2522931: Scheduler stats: (called/tasks/max_length/idle%) 272292/1982/8/91.20
2524476: MQTT : Connection lost, state: Connection timeout
2524510: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
2524511: Subscribed to: domoticz/out
2524636: Domoticz: Sensortype: 1 idx: 30 values: 1.00
2524637: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'1.00'}
2552041: WD : Uptime 43 ConnectFailures 48 FreeMem 13296
2552930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 104.57 loopCounterMax: 333333 loopCounterLast: 273517 countFi
2552931: Scheduler stats: (called/tasks/max_length/idle%) 273517/1983/8/90.90
2575656: MQTT : Connection lost, state: Connection timeout
2575718: MQTT : Connected to broker with client ID: ESPClient_60:01:94:0C:14:F8
2575718: Subscribed to: domoticz/out
2575845: Domoticz: Sensortype: 1 idx: 30 values: 1.00
2575846: MQTT : {'idx':30,'RSSI':10,'nvalue':0,'svalue':'1.00'}
2582041: WD : Uptime 43 ConnectFailures 49 FreeMem 13600
2582930: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 105.08 loopCounterMax: 333333 loopCounterLast: 272269 countFi
2582931: Scheduler stats: (called/tasks/max_length/idle%) 272269/1981/8/90.50
2612041: WD : Uptime 44 ConnectFailures 49 FreeMem 13296
2612931: LoopStats: shortestLoop: 90 longestLoop: 2287753 avgLoopDuration: 104.53 loopCounterMax: 333333 loopCounterLast: 273626 countFi
2612931: Scheduler stats: (called/tasks/max_length/idle%) 273626/1982/8/91.20
At what position in the plugin list do you have the pulse counter?
And what are you trying to measure? The sensor you mention is just a proximity sensor normally used in 3D printers for bed leveling.
How is it connected to the ESP?
Can you link a schematic, or some description?
How long is the cable from the sensor to the ESP?
Do you use pull-up resistors?
What voltage is used for the sensor and how do you bring the signal down to 3.3V levels for the ESP?
Hi,
Not sure what you mean by position but on the device page's it's the first one. Just installed the firmware wrote above yesterday before opening the request (problem was also there in the previous version, i thought itwas 201809xx). No other devices are installed or enabled.
It's for measuring the watermeter, i know this sensor is also used for 3D printers.
The connection is true wires haha...
I'm using an old 12V adapter for powering the sensor, the GND is also connected to the NodeMCU GND pin. Between the GND & Data there is an 6.8K resistor to reduce the 12V voltage back to 3.3 (my sensor has an 10K built-in resistor also). Data is connected to D5
Short history:
Allready tried to connect the sensor directly to my Raspberry Pi and that was not working at all, the software was buggy and reliable at all. Even with the sensor in "off" mode (no LED turned on) the software is making false positive readings. Ask for help @Tweakers.net and some had exact the same issue and has moved over to an seperated board (Wemos D1) and no problems at all. I've decided to move also but using a NodeMCU because i've had some stock ;). Asked him the same yesterday and he has also false positive readings.
It don't happen when the watermeter is not used.
Just ordered an 5V version of the sensor from Ali yesterday, some people are sure this will solve the problem.
@toppe if it is pnp sensor, you should use voltage divider
I think there are several issues here.
Maybe the wire is quite long, so it might work as an antenna.
Perhaps also the voltage level difference between high and low is not that clear.
Can you draw up a schematic to get an idea how it is connected?
Also make sure the voltage to the sensor is clean. So if you have an "old adapter", it may be using a transformer (heavy adapter) and only a rectifier + capacitor.
Then you may consider adding a 7809 or something like that to make the voltage to the sensor very stable. (+ the capacitors near the 7809)
Also, try to either shield the cable to the ESP, or make it as short as possible.
And depending on the type of sensor (PNP/NPN), you may need pull-up or pull-down resistors to make the signal "stronger".
Maybe you can measure the output signal using a scope or a multimeter, to know what level it is. And then we can decide what to add between the sensor and the ESP.
@TD-er with 12v signal no interference, yes we dont know how long wire are used here, and this sensor has own internal pullup. For me problem. is too high voltage.
Check voltage on esp pin with multimeter, with and without stable signal on the sensor
Hi,
Tried to make the schematic but i'm not good at it.
You can find it here: https://www.digikey.com/schemeit/project/npn-sensor-BQ2KU7O402QG/
Short version: Adapter + only to sensor, adapter - to sensor and to NodeMCU. Data is connected to GND with an 6.8K resistor.
I'm not sure if i hooked up the NPN sensor correctly in the schematic, sorry for it :smile:
I would like to order the necessary parts but i would need some help at it....
Back to the question: is the problem software related or not?
Back to the question: is the problem software related or not?
Not sure yet.
Since it is counting "too much", I would expect it to be a hardware/electrical issue.
I looked at your schema, but if it is connected like that, it will not work.
Maybe you can show a picture?
You will need 2 resistors to get the signal to proper levels.
Just as an indication, may not be the correct resistor values:
Edit:
It appears the output signal is only a little below the input voltage, so if you power it with 12V, its output value will be 11.x V
So to get it down to 3.3V levels, you will need to use 10k & 27k resistor. (15k in the image is replaced by 27k)
Edit2:
Some comparison between versions of these sensors

Hmmm this looks little different than my schematic :stuck_out_tongue_closed_eyes: but can you help me a little bit with the black wire?
This is what i see:
Left leg from the 27K resistor is connected to the black wire
Lower leg from the 10K resistor is connected to the GND
The right leg (27K) and upper leg (10K) are connected to D5?
And just read somewhere that my sensos has an built in 10K resistor and that i should use an 6.8K.
Had read the voltage's before: when sensor has a pulse (led is on) the voltage drops to 0.64v
Brown and blue are quite rock solid, just wire them to the 12V adapter.
Edit after your second one: It seems i've connected the sensor as PNP and not NPN?
Have some photos here: https://www.icloud.com/sharedalbum/nl-nl/#B0jGfnH8tGpm0Rf
I'm feeling really dumb :disappointed:
Left leg from the 27K resistor is connected to the black wire
Lower leg from the 10K resistor is connected to the GNDThe right leg (27K) and upper leg (10K) are connected to D5?
That's correct.
If you just attach those resistors and do not connect the pin to the ESP GPIO D5, what voltage do you measure between GND and that pin?
It should be either close to 0V or close to 3.3V.
If there is indeed a 10k resistor in the sensor itself, so you may indeed need to lower the 10k resistor and maybe the 27k resistor is no longer needed then.
You should try the sensor first without the ESP connected, to see what voltage you get between the data pin and GND, just to get these at the right levels.
Hmm
I'm allready measuring close tot 3.3V is sensor is not on and 0.64V is sensor is on (When LED is on) with the current setup. I'm only using an 6.8K resistor between data and GND :)
OK, so then the current setup is fine.
I didn't take into account the internal resistor when calculating the resistor values.
Also with those relatively low resistor values, it should be rather immune to external noise, although you are running quite long breadboard wires which do not always make the best connections.
Maybe someone else has any ideas?
The wiring setup is quite messy. The cables are not rock solid...
I'm waiting to make this rock solid because i'm running into trouble but there is a chance that it will work as it should when the setup is fine?
I will try to shorten the cables later today but you're guess is that it can help?
Given that the ESP counts too high values, some external signal must send a trigger.
So either bad connections, or it is picking up some external signal (like an antenna)
You could also try to experiment with the "Debounce Time (mSec)" setting.
If you set it too high, you will miss samples. So you should have some kind of estimate on how fast the LED flashes when a count must be given.
If for example your "high" time is 100 msec, you should not exceed the debounce time of 50 msec (give or take)
ok it is npn, my mistake, so 27/30kOhm and 10 kohm should do the job like on @TD-er picture
The speed is relative and is higher depending on the water request. Taking is shower is requesting more water than do the dishes.
I've allready tried to set the debounce time to 50-3000 and sereval timings in between, the results are the same.
Strange thing: it's happning random. Between 07:00 and 08:00 i'm using 0 liters and between 08:00 and 09:00 it's couting 923 liters? Sometimes it's couting nothing for 3/4/5 hours...?
Maybe move the sensor a bit up? if that is possible.
I am not sure how the sensor is reacting to the water meter.
I assume it is detecting some kind of metal part in one of the dials?
What if the dial stops at a position where it is barely detectable by the sensor? Any vibration could then trigger a count.
So that's in line with @Barracuda09 's suggestion ;)
Yes indeed @TD-er
A picture of the "inside" of the water meter could help maybe as well
Yes, the watermeter has an metalplate that rotates when it's in use. One full circle is exactly one liter.
The sensors detects the metalplate and than the LED is on, you will see the plate directly under the blue circle.
I've checked the count physically, the disk rotates 7 times, the led turns on 7 times and the ESP counts 9. Did this more than once, if there is a difference it's allways 2 or more...
"What if the dial stops at a position where it is barely detectable by the sensor? Any vibration could then trigger a count."
Thats the reason i've set it to FALLING. Should prevent false positive's (the disk should be spin back first and than forward to make an false count)
You can see here more about it:
https://github.com/letscontrolit/ESPEasy/files/2625787/Waterstand.pdf
the disk should be spin back first and than forward to make an false count
Only if that was true, but in reality its probably not and the signal is bouncing and the ESP is faster in detecting the signal then a human eye. And it can even "bounce" when the sensor is critically positioned.
So my bet is maybe reposition the sensor and us an adequate debounce time
And how deep lies that rotating metal plate because the sensor only has a 4mm range
The depth of the metalplate is unknow and because it's sealed i cannot messaure it..
The sensor is mounted in the lid of the meter and is flat with the surface when the lid is closed.
How should i move the sensor? I've tried to make the sensor less contact with the metalplate but than it's not working at all. Much room for trial and error is not possible.
Edit:
the disk should be spin back first and than forward to make an false count
Only if that was true, but in reality its probably not and the signal is bouncing and the ESP is faster in detecting the signal then a human eye. And it can even "bounce" when the sensor is critically positioned.
So my bet is maybe reposition the sensor and us an adequate debounce time
Read this wrong. What should you suggest for an debounce time? Low as possible (=1mSec). Because the speed of the rotating disk is depending on the current water usage. More water is faster disk, less water is slower disk...
Well if moving it a bit up makes it not work then the metal plate is
probably almost or more then 4 mm away.
So it is critically mounted I expect and it's an bouncing problem rather
then an software one. But choosing a sensor that has more range will
probably introduce problems that it will see maybe gears rotating.
Maybe use an optical senor for that.
I will try to move the sensor, and if it's necessary it's possible to detach the sensor from the lid and use bracket or something like that. For now it's not possible to move the sensor more to the right or left.
Will try to set the debounce time to 1 or 2 seconds, the sensor will do about 3 seconds to turn on after turned of so a low debounce time is not critical :)
Conclusion: it's an hardware related problem?
@toppe
Conclusion: it's an hardware related problem?
Why don't you take a different approach? It may be that the sensor is bouncing even if there are not clear pulses, which would trigger the count.
Since it has a nice LED, tape a LDR ("light sensor") in front of it and make sure it's dark (close it, tape it or something else). LDR's are easy to hook up and you don't need to mess with much components. It is also very light and small, so you can just tape it straight down, if you want so. Even if you don't have one, maybe you can scrap some out of old electronics (solar night lamps, etc).
Yes I would expect or my bet is an hardware problem, this is an critical
application.
Don't use a metal bracket, or use an optical sensor.
Well the debounce is dependent on how fast the disk is spinning at Max. The
signal should be "clear" before the disk makes a complete round. But if the
sensor is critically mounted, it will trigger by any movement of the sensor
if the metal plate is in the proximity of the sensor.
Next question: What is behind the rotating plate inside the device?
If possible use an oscilloscope to check the pulses if it is really one pulse or two or more pulses faster then human eye? Second I'd check power supply with scope. The randomness sounds a bit like spikes from power.
@toppe
Conclusion: it's an hardware related problem?
Why don't you take a different approach? It may be that the sensor is bouncing even if there are not clear pulses, which would trigger the count.
Since it has a nice LED, tape a LDR ("light sensor") in front of it and make sure it's dark (close it, tape it or something else). LDR's are easy to hook up and you don't need to mess with much components. It is also very light and small, so you can just tape it straight down, if you want so. Even if you don't have one, maybe you can scrap some out of old electronics (solar night lamps, etc).
I'll check if i have one at home or else order one on the internet, is this model fine? Read about it and it seems oke...? https://opencircuit.nl/Product/10113/Lichtgevoelige-schakelaar-module
And just place it above the blue circle? Never looked for the LED because i thought the NPN is more accurate
@ShardanX Dont have one, only an multimeter. I can try to use the 5V onboard of the NodeMCU, some users reports that this should work also
Is there an LED? I would not expect that to be true.
Is there an LED? I would not expect that to be true.
I think @Fusseldieb is reffering to the LED ontop of the NPN when i read his post again. Should work also but is giving an bandaid on the wound instead of making the wound go away..
Not sure if a long debounce time will cause other issues.
I have to check the source to see what it does then.
You could also add a small capacitor to the signal. That will delay the rise/fall of the signal and thus filter out very short pulses.
According to this online calculator a 10 uF capacitor would give a delay of about 68 msec (used 3.3V and 6k8 resistor)
Make sure the polarity is right :)
I think @Fusseldieb is reffering to the LED ontop of the NPN
That will make no difference at all. I thick @Fusseldieb mistake was, that there was an LED on the meter it self. But I would not expect that at all with an analog meter (or even a digital, battery powered meter)
You can find documentation of the meter and a pulse counter from the supplier on intranet. https://sensus.com/products/620-water-meter/
It doesn't have standard led. their solution is detecting the spinner movement, even in 2 directions.
My experience with the espeasy pulse counter module is very good, but it can take a while to get the proper detection; the detection itself, proper voltage levels and de-bounce time. I'm using it for reading S0 pulses from 2 DIN meters so proper detection wasn't a problem but it took me some time to get the proper voltage levels and de-bouncing time. As it where cheap DIN meters the resistors are even different for the 2.... Using an oscilloscope will help a lot...
@blb4github
spinner movement
The red spinner you think? that will probably work better, its faster. And with an optical sensor works also better I guess.
Haha, i'm feeling an dumb ass. Not sure if it's the problem but i tought that the GND was only connected to the NPN sensor, it's was not. There was also an TSL2561 and DHT22 sensor on the same GND rail on my breadboard. Just removed it and did 6 tests: all 6 match exactly with the pulse counted on the sensor itself. Yesterday not one test matches the pulse counts. The numbers in Domoticz is the same as the physical numbers 馃憤
Also changed the debounce time to 3000. As far i can test on the moment the sensor need's atleast 3 seconds to turn on after turning off.
Not sure what the problem was here, possible the GND that was having more devices than one...?
possible the GND that was having more devices than one
Well that is the basic idea of GND ;-) that is has more 'devices' connected to it.
7 times tested right know, still matching. I'm dumb! you can say it all hahahaha 馃檴
@toppe
I'm dumb
I am the first then ;-)
But the GND should be good. I would check you wiring once more because it should be possible to do what you were trying to do.
Just made an test setup; removed all the other sensors and hung the NodeMCU USB cable on the key that's in the door. Run 6 tests, no mis counts at all. Just put it back in the closet and than the software counts +1 (water not running at all)... cut the wires on the correct length (little to long) and wrote down all the numbers.
Will take a shower in a few minutes and recheck...
Edit: When the +1 is counted the time become 7 numbers or so... Normaly it is 4 at my place
Again a post from me 馃槃
Just took a shower and wrote down all the numbers and compared it afterwards.
Physical: 322.349
Domoticz: 322.349
ESP (Count/total): 0/2
Physical: 322.380
Domoticz: 322.380
ESP (Count/total): 0/38
322.349 - 322.380 = 0.031
38 - 2 = 31
So your sensor is now grounded for a long time :)
And we can close this issue.