Pulse meter based calculatons


I have finally installed my Emon Pi with pulse counter.

I have created only 1 feed PULSECOUNT which counts pulses, where I have added multiplier so readings are now accurate to kW.

However this feed only adds pulses, how I can move forward and make graph of how many kW i use now ( last minute) how many kW i uses from 16:00 to 16:15 etc…

Please advise

Hi Michal,

I assume you must have derived kWh from the pulses using this guide

One solution would be to use a time series database like influxdb and couple that with grafana. And that can be done on a Raspberry Pi. Check out Andreas Spiess’ excellent video on this. Of course, like all projects it all about time and effort.

A less time consuming one would be to use Node-Red dashboard with a simple graph that is fed from data collected via an MQTT message subscription.

As I don’t know your exact setup and experience I hope these suggestions might help to guide you to a solution.

You can’t, as a ‘pulse’, by definition, is only sent after a certain amount of energy is used. If it takes 15 minutes to use one pulse worth of energy, you will have no idea if it was mostly used at the beginning or end of the period. Of course if you are using a lot of energy and the pulses are very rapid, that will give you a different answer.

To get any sort of instantaneous reading you must use a CT.

Thanks for your propostions

Riht now my level of knowledge in this area is -1.

I did not use guide youhave mantioned, I have just installed EmonPi and created feed locally.

I have installed EmonPi with optical pulse sensor, and I do not have possibility to instal CT, because:
a) I’m using it on installation with max usage of 1000 kW /h
b) I have multiple feeding cables

Right now I have accurate measurement of all kWh’s I’ve used from instalation of EmonPi till now.

I would like to store the data and reset the count every day. I would like also have option of substraction of readings from f.ex 16:00 and 15:00 so one gauge on dashboard will show me # of kWh used last hour .

Is it possible with Emoncms/ EmonPi?
If not - is it possible to make it in external program like influxdb and grafana?

Have you looked at the pre-configured MyElectric App (top left of Emoncms)?

Yes, It can only show actual usage (wh) based on CT and total daily usage of kWh. and there are no possibilities to configure it

@TrystanLea can the My Electric App be configured for a pulse input?

The apps use both instantaneous and accumulative data, they don’t add any further assistance for this issue.

@michal.grygowski there is a kwh to power process available on a self-hosted emoncms (but not emoncms.org)

But as Brian has already pointed out, calculating realtime power from a pulse count is not ideal. the results can be pretty poor if the pulsecount is low. If you are monitoring a 1000KW supply then maybe this wouldn’t be an issue for you, it depends on the granularity of the pulsecount compared to usage, if you always get multiple counts per reporting period it might not be too bad.

That would be the kWh to kWh/d process perhaps?

That’s not so easy currently.

You could have a graph of todays delta in hourly bars so that the final bar on the right is the current hour.

Hi Michal

I hope this is not too late or too low level…

You need to be careful about kW and kWh. Pulses count kWh or Wh of energy - the number of pulses per kWh will be displayed on your meter. For example, my meter tells me that 3200 pulses are sent for every kWh, so each pulse is telling me that 0.3125 Wh of energy have passed through the meter (1000 Wh / 3200 pulses/kWh). If the pulses are t seconds apart, then the average power over the period since the last pulse is 0.3125*3600/t where the factor given here as 0.3125 will depend on your meter and the 3600 is the number of seconds in an hour. If for example you get a pulse every 2 seconds from my meter, then the average power is 562.5 W or 0.563 kW.

Alternatively, if you count the number of pulses, P, over a fixed period of time, Tf seconds, then the average power over the period just passed is 0.3125P3600/Tf for my meter. For electricity trading the period used is usually half-hours, so the average power over the last half-hour is 0.3125P2 This often causes confusion as the energy recorded in kWh per half hour implies and average power (kW) which is 2 times the kWh recorded. There is also potential confusion in data recording whether the data for a particular timestamp is kWh for the last half hour or for the following period – good practice is that the data at a particular timestamp is the kWh for the period ending at that time, so the data at 00:00 is the last period of the previous day for example.

You have no way of knowing what the maximum and minimum power was over a fixed time period unless you record the time between each pulse. If you do record this time, then you can find the minimum (longest period) and maximum (shortest period) during a longer recording period - this can significantly enhance the quality of data recorded over longer periods without leading to overwhelming amounts of data.

All the best

Simon Redford

You don’t mean kWh here, you mean 0.563 kW.

And even that will only give you the average power over the period between pulses.

Oops - yes!



1 Like

Just seen the second bit - yes of course if you only have pulses then that’s all you can possibly say, but I would presume you are getting a reasonable number of pulses otherwise you are looking at Watts - not a big deal. When you get sufficiently short pulses this tends to be due to a bigish load like a kettle if you are looking at domestic power. The thing you can’t easily get is starting transient current for some devices, but if you want to see these you will need a very fine sample period with a quality CT - I doubt this is what most people are after with this type of kit.

All the best



I’ve edited your post (no.9) to avoid any confusion.

1 Like

Thanks, for all of the posts.

I will give you a little bot background of what I wold liketo create on emonPi/emoncms.

In my factory we have power usage limit of 1000 kwh /h counted every 15 minutes so we cannot use more than 250kwh between 00:00 and 00:15. I think that it is not impossible to show number of kwh used last 15 minutes or average power from last 15 minutes ( which can be hard and not accurate )

This weekend I factory reste the Emon Pi and start it all over again.
@pb66 I have managed to create 3 feeds on local emoncms ; counting of pulses , counting the kwh used, and trhird one using the kwh to power for actual power usage.
I dont really understand how the 3rd one calculates the power - what is the time probe?
If I can understand how to calibrate it and change the time probe I can caluclate the 15 min average.
And putting it into app My electric gives me some base of what I want to see on my dashboard.

Hovewer I cannot transmit this data to remote Emoncms account. Apps and feeds are working only locally, remote emoncms does not have kwh to power option, and I’m a little bit blocked…!

Calcualtions here are accurate and I’m happy with kwh to power function, but the readings are not accurate I imitate powermeter by blinking bicycle light on my desk :slight_smile:


1 Like