Page 1 of 1

Pulse Counter

Posted: 04 Mar 2017, 11:16
by journeyman
Hello, I have this module:

Image

And am trying to use it as pulse counter for my energy counter.
I connected it do GPIO0 bot its not counting at all.

I foundout that this module giving high level on standby and low on pulse. Its ok for Espeasy (R147)?

Re: Pulse Counter

Posted: 04 Mar 2017, 11:59
by Shardan
Hello,

what kind of electricity counter? The old version with a rotating disk or an electroic counter with a flashing LED?
Can you please give a screen shot of the tastk configuration? It is difficult to say what might be wrong without that,

The high level shoud be no problem as a pulse should be counted anyways.
If using GPIO0 the sensor must give a high level for your configuration otherwise
the ESP would not boot at all. GPIO0 ist hardcoded internally for detecting
firmware upload. If it is "low" at startup, the ESP waits for a new firmware
instead of booting the loaded one.

Anyways, on the sensor board are two LEDS near the pins. One is the "power" LED, it
shows if the board has power. The second one shows the pulse output.
If the second one does not blink there are no pulses to count. This should be checked first.

Regards
Shardan

Re: Pulse Counter

Posted: 04 Mar 2017, 13:51
by journeyman
Hello, thank you for message.

It is counter with LED. on module PWR led is ON and second led is flashing acording to counters led.
I tryied also with gpio15 and all i got is 0 :/

I would like to use it with Domoticz, what setting should I Put?


Thank you and greetings.
2017-03-04_13h34_32.png
2017-03-04_13h34_32.png (20.7 KiB) Viewed 38607 times

Re: Pulse Counter

Posted: 04 Mar 2017, 14:21
by toffel969
Have you tried to adjust the sensitivity of the device by turning the poti?... never mind if led is flashing.

There are 4 pins on the module. Which one did you connect to gpio?

Re: Pulse Counter

Posted: 04 Mar 2017, 14:28
by journeyman
OK i tryied with another esp and its working....

I have some numbers, but what should be the settings to send it to domoticz with correct readings of current W and total / day / month kWh?

if 6400pulses = 1kWh?

Re: Pulse Counter

Posted: 04 Mar 2017, 15:26
by Shardan
Hello again,

Settings look good as far as i see.

Things i would change:
Set the Formula field to %value%. I've seen some sketches not working without this.
Set the "Decimals" to 0 - there is no 0.1 pulse so decimals are not needed.
I'm not sure if the sketch works without a "Debounce time" setting.
Just to make sure set it to 1.

Sadly i can't say anything about domoticz as I use FHEM.

To get this strange thing solved some steps:

First check the "Unit Number" set in the "Config" tab.
It must be set to a unique number from 1 to 31.

Do you get any reading in the task list (refresh the page now and then, it does not refresh automatically).
If yes there is a problem with the domoticz configuration and i can't help any further.

If the task list reading stays zero there is a circuit problem.
As far as i can see from the picture there seems to be a LM393 soldered on the sensor board.
This is a circuit with a "OpenCollector" output type so it needs a pull up resistor.
Use a 3.3 ... 10 KOhm resistor connected between 3.3V and the GPIO to get the correct high level.

(I know there is the LED connected to the output. But a LED can take up up to 2.5 V depending on type
so the high level isn't reached.)

Let's see if that works.

Regards
Shardan

Re: Pulse Counter

Posted: 04 Mar 2017, 17:32
by journeyman
Its working now on another ESP, giving some numbers but the only problem left its to set it correctly in domoticz its giving only 30 - 40watts and no kWh counting.


Thank you!

Re: Pulse Counter

Posted: 05 Mar 2017, 13:09
by insippo
My electricity meter is 800 imp per kwh. How to configure esp for domoticz ?

Re: Pulse Counter

Posted: 24 Mar 2017, 09:47
by miroslav.petrov
To set the impulses per kw/h in Domoticz you have to go to Settings tab and then to Meters/Counters tab and change the default values. In my case I have 125 impulses per kw/h.
d.PNG
d.PNG (45.54 KiB) Viewed 38470 times

Re: Pulse Counter

Posted: 26 Mar 2017, 17:36
by insippo
This is great.!
Question about esp connection to electricity meter. How to connect directly to meter ? Without ldr or photo diode. My electrycity meter has 2 contacts for this.

Re: Pulse Counter

Posted: 26 Mar 2017, 18:05
by Shardan
Hello Insippo,

which electricity meter do you use? Does it have two connectors "S0+" and S0-" ?

Regards
Shardan

Re: Pulse Counter

Posted: 26 Mar 2017, 18:16
by insippo
Yes. These 2 connectors

Re: Pulse Counter

Posted: 26 Mar 2017, 20:45
by Shardan
insippo wrote: 26 Mar 2017, 18:16 Yes. These 2 connectors
Then it should be easy to do.
These counters usually have a so called "Open Collector" output.
You will need just a resistor 2,2K .... 10 K and some wiring:
Counter-Connection.jpg
Counter-Connection.jpg (27.93 KiB) Viewed 36817 times
.
The wiring should not be too long as i assumed the ESP is placed near the counter.
Use the "Pulse Counter" in ESPEasy to get the readings.

Hope that helps

Regards
Shardan

Re: Pulse Counter

Posted: 26 Mar 2017, 21:33
by insippo
Thank you. Tomorrow i tray if i find time. This is easier than mysensors with billoim wires :) If my wifi signal reaches out.
What GPIO nr. need use ?

Re: Pulse Counter

Posted: 26 Mar 2017, 22:18
by Shardan
Hello,

I'd recommend not to use the GPIO0 as it is used for flashing.
Any other GPIO can be used, it's configurable in the ESPEasy devices.

Regards
Shardan

Re: Pulse Counter

Posted: 27 Mar 2017, 06:43
by insippo
Okay.
Thank you.

Re: Pulse Counter

Posted: 07 Apr 2017, 07:59
by lassiko
Hello,

I have some issues to get right values from ESP easy (latest build) to Domoticz.
Earlier, i was using mysensors Arduino nano node pulsecounter for this, but range was not good with that one
I changed to Wemos + ESPeasy, which gives me a better range. Problem is, that with ESPeasy, i cannot get correct values to my "Electric (Instant + Counter)" device in Domoticz.

Earlier with Arduino, i was able to get data, which was shown correctly on this: INSTANT, OVERALL, TODAY Info, all are important.
Image (with values of course)

Now with ESP easy, i get values only like this:
Image

I know this is problem of a form data is send to Domoticz, but i do not have skills to make it right :oops:
Maybe someone can help me with this?

Thank you!

Re: Pulse Counter

Posted: 09 Apr 2017, 16:34
by toffel969
I just had the same problem literally 30 min ago.

This is how to fix it: Choose Normal counter incremental device as dummy

Then under settings in Domoticz, change the Pulse value for energy to whatever fits your purpose

Re: Pulse Counter

Posted: 09 Apr 2017, 20:09
by Shardan
insippo wrote: 26 Mar 2017, 17:36 This is great.!
Question about esp connection to electricity meter. How to connect directly to meter ? Without ldr or photo diode. My electrycity meter has 2 contacts for this.
Hello,

the connection is simple, as long as your counter has the "S0" pulse output:
Counter S0 Connet.jpg
Counter S0 Connet.jpg (30.97 KiB) Viewed 36675 times
.
Yes, that simple ;)

The "S0" connect is a standardized output without own voltage supply so you have to add the resistor.
That makes it easy to connect to the 3,3V ESP.

BTW just a hint:
For questions like this it's better to open a new thread in the forum then attaching to an existing thread.
Other users searching for the same problem will never find it here ;)


Regards
Shardan

Re: Pulse Counter

Posted: 09 Apr 2017, 21:18
by The_Rascal
journeyman wrote: 04 Mar 2017, 17:32 Its working now on another ESP, giving some numbers but the only problem left its to set it correctly in domoticz its giving only 30 - 40watts and no kWh counting.


Thank you!
Hi. To get a reading from the pulse counter in Domoticz . Go back to your esp and change you formula to "%value%*60". The pulse counter resets its value every minute so this gives you the most accurate values.

Mind you it also means that as your only counting from 2 to 30 pulses a minute, your value will go up and down by 60 Watts in Domoticz.

Make sure that in Domoticz its computing the value and using "Instant & Electric Counter"

Re: Pulse Counter

Posted: 10 Apr 2017, 11:28
by lassiko
I got it working. Dummy device is: General, kWh. Type is: Usage and Computed.
In Espeasy i made settings for Pulse counter:

Delay: 60
Debounce Time (mSec): 100 (did not work correctly lower than this value).
Data so send: Delta

Formula for usage: "%value%*3600/60" (this gives me a Instant usage)
Formula for Total: %value%/1000 (this gives me a total evergy usage / hour / day / etc... )

With these settings, i got exactly same values than my electric company informed me. Hopefully this helps someone else with same case.

Re: Pulse Counter

Posted: 10 Apr 2017, 18:31
by Ton_vN
To get a 'standard' output to Domoticz, the 2 formulae in ESPEasy need to be corrected for the number of pulses per kWh coming out of the S0-interface, because kWh-meters exist with rates different from the 'nominal' S0-value of 1000pulses/kWh.
Examples known with pulse-output as low as 1/kWh (SDM120C, at the adjustable S0-interface) and as high as 3200pulses/kWh (for DDS238).

Re: Pulse Counter

Posted: 04 Aug 2018, 12:14
by Ton_vN
Just a check/question for understanding.

The Pulse-Counter-interface of ESPEasy also produces/provides a value Time.
What is the content of this value Time?
If the ESP8266 is connected to an S0-interface is there any meaningful application of this Time-value e.g. related to calculation of Usage?

The choice for upload to the controllers is
  • Delta
  • Delta/Total/Time
  • Total
Any rule of thumb for related optimal setting at the receiving end in Domoticz?

Re: Pulse Counter

Posted: 02 Oct 2018, 14:45
by vojtishek
Hi all,

I would like to get a Time value only from Pulse sensor as my termostat for heating turn on light when active.
If there is possibility to have a time in domoticz, then I can calculate somehow appr. consumption.

Any idea please?

Thanks
Vojta

Re: Pulse Counter

Posted: 02 Oct 2018, 21:20
by vojtishek
Another issue when tried to measure just count when thermostat turned on and light started to shine.
Its a light through the red cover, diode on pulse counter get it, but counter went mad and still increasing dozens of counts.

When tried normal handlight blink worked like a charm.

Kinda desparate :(

Re: Pulse Counter

Posted: 03 Nov 2018, 14:29
by Naesstrom
I'm planning on attaching a ESP to my S0 interface to and the connections seems clear... but could anyone share some info on what rules/calculations to use based on the imp/kwh on the reader? How often should the ESP send the value etc?
I'm not using domoticz but home-assistant so I don't have your nifty premade configs! :D

Re: Pulse Counter

Posted: 03 Nov 2018, 17:07
by grovkillen
Naesstrom wrote: 03 Nov 2018, 14:29 I'm planning on attaching a ESP to my S0 interface to and the connections seems clear... but could anyone share some info on what rules/calculations to use based on the imp/kwh on the reader? How often should the ESP send the value etc?
I'm not using domoticz but home-assistant so I don't have your nifty premade configs! :D
Here's my 1 year old config that is still running. You may use it as inspiration: https://testoftimes.com/2017/11/25/moni ... g-esp8266/

Re: Pulse Counter

Posted: 03 Nov 2018, 18:39
by Naesstrom
grovkillen wrote: 03 Nov 2018, 17:07 Here's my 1 year old config that is still running. You may use it as inspiration: https://testoftimes.com/2017/11/25/moni ... g-esp8266/
Sweet thanks, I can't see a difference between kWh and kWh (time)?

Re: Pulse Counter

Posted: 03 Nov 2018, 19:05
by grovkillen
No, it's not used (the time value). So they are the same.

Re: Pulse Counter

Posted: 04 Nov 2018, 13:10
by vojtishek
Hi all,

just installed counting as per scheme and it looks working properly. I've did one check after 8 hours to merge counter and my domoticz measures. Results were same on both sides.

One hint for you which will find S0 output on pins 20 and 21.
Polarity as per follow S0 - 20(+), 21(-).

Thanks for guidance ;).

Re: Pulse Counter

Posted: 10 Feb 2019, 06:25
by dony71
i have this smart meter attached
i use similar infrared sensor module and attached to infrared port on smart meter
and measure with oscilloscope, but cannot see any digital signal out from the module.
i'm wondering whether this infrared port on the smart meter needs to be enable?
if need to enable, then how to enable? only electric provider company can enable this?

Re: Pulse Counter

Posted: 10 Feb 2019, 08:03
by HomeJCL
There are gazillions types of this meter available.

Easiest is to check with you company what is available as output on their standard meter, if any 👎

Build from there

If scope says no IR most definitely it is a programming/communication port for service purposes