Pulse Counter

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
journeyman
Normal user
Posts: 14
Joined: 06 Dec 2016, 22:03

Pulse Counter

#1 Post by journeyman » 04 Mar 2017, 11:16

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)?

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Pulse Counter

#2 Post by Shardan » 04 Mar 2017, 11:59

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
Regards
Shardan

journeyman
Normal user
Posts: 14
Joined: 06 Dec 2016, 22:03

Re: Pulse Counter

#3 Post by journeyman » 04 Mar 2017, 13:51

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 38240 times

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Pulse Counter

#4 Post by toffel969 » 04 Mar 2017, 14:21

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?
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

journeyman
Normal user
Posts: 14
Joined: 06 Dec 2016, 22:03

Re: Pulse Counter

#5 Post by journeyman » 04 Mar 2017, 14:28

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?

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Pulse Counter

#6 Post by Shardan » 04 Mar 2017, 15:26

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
Regards
Shardan

journeyman
Normal user
Posts: 14
Joined: 06 Dec 2016, 22:03

Re: Pulse Counter

#7 Post by journeyman » 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!

User avatar
insippo
Normal user
Posts: 36
Joined: 28 Sep 2016, 09:01
Location: Estonia, Pärnu
Contact:

Re: Pulse Counter

#8 Post by insippo » 05 Mar 2017, 13:09

My electricity meter is 800 imp per kwh. How to configure esp for domoticz ?
Some Raspeberry Pi's, Arduinos, Esp8266, solar panels 1500w, 2 lakes,6 ha fields, German shepherd and more

miroslav.petrov
New user
Posts: 4
Joined: 26 Jan 2016, 15:05

Re: Pulse Counter

#9 Post by miroslav.petrov » 24 Mar 2017, 09:47

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 38103 times

User avatar
insippo
Normal user
Posts: 36
Joined: 28 Sep 2016, 09:01
Location: Estonia, Pärnu
Contact:

Re: Pulse Counter

#10 Post by insippo » 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.
Some Raspeberry Pi's, Arduinos, Esp8266, solar panels 1500w, 2 lakes,6 ha fields, German shepherd and more

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Pulse Counter

#11 Post by Shardan » 26 Mar 2017, 18:05

Hello Insippo,

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

Regards
Shardan
Regards
Shardan

User avatar
insippo
Normal user
Posts: 36
Joined: 28 Sep 2016, 09:01
Location: Estonia, Pärnu
Contact:

Re: Pulse Counter

#12 Post by insippo » 26 Mar 2017, 18:16

Yes. These 2 connectors
Some Raspeberry Pi's, Arduinos, Esp8266, solar panels 1500w, 2 lakes,6 ha fields, German shepherd and more

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Pulse Counter

#13 Post by Shardan » 26 Mar 2017, 20:45

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 36441 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
Regards
Shardan

User avatar
insippo
Normal user
Posts: 36
Joined: 28 Sep 2016, 09:01
Location: Estonia, Pärnu
Contact:

Re: Pulse Counter

#14 Post by insippo » 26 Mar 2017, 21:33

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 ?
Some Raspeberry Pi's, Arduinos, Esp8266, solar panels 1500w, 2 lakes,6 ha fields, German shepherd and more

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Pulse Counter

#15 Post by Shardan » 26 Mar 2017, 22:18

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
Regards
Shardan

User avatar
insippo
Normal user
Posts: 36
Joined: 28 Sep 2016, 09:01
Location: Estonia, Pärnu
Contact:

Re: Pulse Counter

#16 Post by insippo » 27 Mar 2017, 06:43

Okay.
Thank you.
Some Raspeberry Pi's, Arduinos, Esp8266, solar panels 1500w, 2 lakes,6 ha fields, German shepherd and more

lassiko
New user
Posts: 8
Joined: 31 Mar 2017, 15:40

Re: Pulse Counter

#17 Post by lassiko » 07 Apr 2017, 07:59

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!

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Pulse Counter

#18 Post by toffel969 » 09 Apr 2017, 16:34

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
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Pulse Counter

#19 Post by Shardan » 09 Apr 2017, 20:09

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 36299 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
Regards
Shardan

The_Rascal
New user
Posts: 4
Joined: 09 Mar 2017, 01:56

Re: Pulse Counter

#20 Post by The_Rascal » 09 Apr 2017, 21:18

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"

lassiko
New user
Posts: 8
Joined: 31 Mar 2017, 15:40

Re: Pulse Counter

#21 Post by lassiko » 10 Apr 2017, 11:28

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.

Ton_vN
Normal user
Posts: 300
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Pulse Counter

#22 Post by Ton_vN » 10 Apr 2017, 18:31

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).
Last edited by Ton_vN on 05 Aug 2018, 11:33, edited 1 time in total.

Ton_vN
Normal user
Posts: 300
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Pulse Counter

#23 Post by Ton_vN » 04 Aug 2018, 12:14

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?

vojtishek
Normal user
Posts: 70
Joined: 12 Jan 2017, 08:00

Re: Pulse Counter

#24 Post by vojtishek » 02 Oct 2018, 14:45

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

vojtishek
Normal user
Posts: 70
Joined: 12 Jan 2017, 08:00

Re: Pulse Counter

#25 Post by vojtishek » 02 Oct 2018, 21:20

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 :(

Naesstrom
Normal user
Posts: 23
Joined: 02 Jun 2017, 21:02

Re: Pulse Counter

#26 Post by Naesstrom » 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

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Pulse Counter

#27 Post by grovkillen » 03 Nov 2018, 17:07

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/
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Naesstrom
Normal user
Posts: 23
Joined: 02 Jun 2017, 21:02

Re: Pulse Counter

#28 Post by Naesstrom » 03 Nov 2018, 18:39

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)?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Pulse Counter

#29 Post by grovkillen » 03 Nov 2018, 19:05

No, it's not used (the time value). So they are the same.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

vojtishek
Normal user
Posts: 70
Joined: 12 Jan 2017, 08:00

Re: Pulse Counter

#30 Post by vojtishek » 04 Nov 2018, 13:10

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 ;).

dony71
Normal user
Posts: 16
Joined: 25 Apr 2018, 20:01

Re: Pulse Counter

#31 Post by dony71 » 10 Feb 2019, 06:25

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?
Attachments
IMG_0353.JPG
IMG_0353.JPG (1.76 MiB) Viewed 30259 times

HomeJCL
Normal user
Posts: 89
Joined: 03 Feb 2018, 10:42

Re: Pulse Counter

#32 Post by HomeJCL » 10 Feb 2019, 08:03

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
Belgium and land of ESP ... counting :D

Post Reply

Who is online

Users browsing this forum: No registered users and 39 guests