General Pulse counting to much

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
toppe
New user
Posts: 5
Joined: 28 Nov 2018, 15:36

General Pulse counting to much

#1 Post by toppe » 28 Nov 2018, 15:43

Hi Folks,

On this moment i'm working on a smart water meter using an NPN sensor, NodeMCU and de ESPEasy software.
The setup is working as it should, the only problem is that the software is counting to much pulses.

I've just did some testing with the sensor and i've counted 7 pulses (the LED turned on 7 times) and the ESPEasy software had a start of 280 and ending on 289 and not 287 as it should have. Did the test twice and they both had a test of +2.

Does anybody had a good solution for the problem?:

Some sensor information:
Debounce Time (mSec): 100
Counter Type: Delta
Mode Type: RISING

Thank you.

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: General Pulse counting to much

#2 Post by Domosapiens » 28 Nov 2018, 16:51

Sounds like a missing Pull-Up /Pull-Down resistor.

What type of NPN sensor?
6V, 12V, 5V ?
Level convertor?
What GPIO?

Here a trouble free solution for LJ12A3-4-Z/BX-5V
https://www.letscontrolit.com/forum/vie ... 232#p32473
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

toppe
New user
Posts: 5
Joined: 28 Nov 2018, 15:36

Re: General Pulse counting to much

#3 Post by toppe » 28 Nov 2018, 16:52

Domosapiens wrote: 28 Nov 2018, 16:51 Sounds like a missing Pull-Up /Pull-Down resistor.

What type of NPN sensor?
6V, 12V, 5V ?
Level convertor?
What GPIO?

Here a trouble free solution for LJ12A3-4-Z/BX-5V
https://www.letscontrolit.com/forum/vie ... 232#p32473
Yep, the same solution as you give me on Tweakers but the problem is not the sensor. The problem is the ESPEasy software with count's random liters. I've confirmed it with the visual counting and the sensor is giving the correct amount of pulses, the software does +2(or 3) random.

Before toilet flush:
Count: 0
Total: 9

After flush:
Count: 4
Total: 20

Pulse counted: 7.

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: General Pulse counting to much

#4 Post by Domosapiens » 28 Nov 2018, 18:25

Yep, that is strange !
I did not tested it, in that way.

I compared the Domoticz result (including off-set) with the real meter.
That was correct one weak ago ...
Saw your #2103 github
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

toppe
New user
Posts: 5
Joined: 28 Nov 2018, 15:36

Re: General Pulse counting to much

#5 Post by toppe » 28 Nov 2018, 18:41

Domosapiens wrote: 28 Nov 2018, 18:25 Yep, that is strange !
I did not tested it, in that way.

I compared the Domoticz result (including off-set) with the real meter.
That was correct one weak ago ...
Saw your #2103 github
Just ordered your 5V sensor (this one) but i'm not sure it will work because the LED pulse works as it should be.

Just put changed the debounce time to 1 msec.. Will wait for my Github request and see what that brings for info

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: General Pulse counting to much

#6 Post by Domosapiens » 28 Nov 2018, 23:40

I compared the Domoticz result (including off-set) with the real meter.
Still correct.

Could it something with time and samples?

I use:
Name: Flow
GPIO-12(D6)
Debounce 0
Counter Delta
Mode Type Rising
Interval 60 seconds !!!!!! (measure Liter/minute)
Count: 0 decimals
Total: 1 decimal
Time: 2 decimals (don't know the usage ...)

IDX 123 goes to Domoticz: Type General, Counter Incremental (only 2 decimals !!!, not like your 3 decimals)
Domoticz settings ...Meters/Counters ...Counter Dividers ...Water ..1000

To understand additional different Domoticz water meter capabilities I made this rule (fork):

Code: Select all

On Flow#Count do
SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=udevice&idx=171&nvalue=0&svalue=[Flow#Count]
SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=udevice&idx=122&nvalue=0&svalue=[Flow#Count]
SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=udevice&idx=172&nvalue=0&svalue=[Flow#Count]
SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=udevice&idx=173&nvalue=0&svalue=[Flow#Count]
SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=udevice&idx=124&nvalue=0&svalue=[Flow#Count]
Endon
123= General, Counter Incremental (Task IDX used with offset)
171= General, Counter Incremental (used without offset)
122= General, Waterflow (momentary usage, nice to check your shower performance; I replaced my bottleneck: shower hose)
172=RFXMeter, RFXMeter Counter (many strange high values=long standing Domoticz bug)
173=General, Custom Sensor (momentary usage, same as 122)
124=RFXMeter, RFXMeter Counter (many strange high values=long standing Domoticz bug); duplicated ... same bug, same moment
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

toppe
New user
Posts: 5
Joined: 28 Nov 2018, 15:36

Re: General Pulse counting to much

#7 Post by toppe » 29 Nov 2018, 06:03

Domosapiens wrote: 28 Nov 2018, 23:40
I compared the Domoticz result (including off-set) with the real meter.
Still correct.

Could it something with time and samples?

I use:
Name: Flow
GPIO-12(D6)
Debounce 0
Counter Delta
Mode Type Rising
Interval 60 seconds !!!!!! (measure Liter/minute)
Count: 0 decimals
Total: 1 decimal
Time: 2 decimals (don't know the usage ...)

IDX 123 goes to Domoticz: Type General, Counter Incremental (only 2 decimals !!!, not like your 3 decimals)
Domoticz settings ...Meters/Counters ...Counter Dividers ...Water ..1000

To understand additional different Domoticz water meter capabilities I made this rule (fork):

Code: Select all

On Flow#Count do
SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=udevice&idx=171&nvalue=0&svalue=[Flow#Count]
SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=udevice&idx=122&nvalue=0&svalue=[Flow#Count]
SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=udevice&idx=172&nvalue=0&svalue=[Flow#Count]
SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=udevice&idx=173&nvalue=0&svalue=[Flow#Count]
SendToHTTP 192.168.1.7,8080,/json.htm?type=command&param=udevice&idx=124&nvalue=0&svalue=[Flow#Count]
Endon
123= General, Counter Incremental (Task IDX used with offset)
171= General, Counter Incremental (used without offset)
122= General, Waterflow (momentary usage, nice to check your shower performance; I replaced my bottleneck: shower hose)
172=RFXMeter, RFXMeter Counter (many strange high values=long standing Domoticz bug)
173=General, Custom Sensor (momentary usage, same as 122)
124=RFXMeter, RFXMeter Counter (many strange high values=long standing Domoticz bug); duplicated ... same bug, same moment
Will try it later on the day, but still think it’s not an solution. The software is counting to much, the pulse led match 100% with the rotating disk

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: General Pulse counting to much

#8 Post by Domosapiens » 29 Nov 2018, 10:18

the pulse led match 100% with the rotating disk
Yep, I understand.

But that does not mean that the ESP does not get more pulses ....
ESP could see additional spikes ...

Saw your scheme on Github, but that tool limits you in your expression.
Advise ... use PPT to make a logic scheme.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

toppe
New user
Posts: 5
Joined: 28 Nov 2018, 15:36

Re: General Pulse counting to much

#9 Post by toppe » 29 Nov 2018, 12:49

@Domosapiens, please see Github :)

Post Reply

Who is online

Users browsing this forum: No registered users and 45 guests