Pulse_counter vs pulse_meter

I recently discovered pulse_meter and have been using pulse_counter. The power meter examples are near identical — which is also my use case. I’m keen to understand the two platforms a bit better (out of curiosity). Why would I use the one over the other?

The pulse counter has a bit more flexibility with the mode that can be configured, but except for that, does the one pose any other significant advantages over the other?

I hope I understood it correct. I will explain it for an electric power meter, as this is my use case.

Pulse Counter is counting for some period of time and after that time, it shows you the number of counts per minute (multiplied by a factor => electric power in my case).

  • the power is representative for each time period
  • you don’t get an update on every pulse, but only after the specified time period

Pulse Meter calculates the current power every time it gets a pulse (time difference to the last pusle)

  • you get the power in a better time resolution
  • when the consumer is switched off (or uses low power), the power sensor remains on the previous high value as there is no new pulse that triggers a power update. That’s why you have to specify a timeout.

I use the pulse counter, because I want to be able to calculate power * time = consumption afterwards.
For this device, I could use the integrated counter, but I have many devices that only deliver a power value and not a counter. That’s why I calculate the usage afterwards via AppDaemon every night. And therefore, I need a power value that is representative for the time period it is shown => Pulse Counter for me. But I’m a “special case” here I think :slight_smile:

5 Likes

This is a great answer, thanks.

I wasn’t sure what was meant by resolution before but now it’s clear. The pulse meter gives a more instantaneous value.

1 Like

How would you recommend calculating the speed of a vehicle? I have a wheel that is 7inches in diameter, so 22 inches of circumference. I have one inductive sensor that senses when the wheel has completed a turn but I don’t have the time that takes to complete the turn. Thanks for any feedback.

Speed is per definition a function of time. You need both distance and time.

It depends on what you are interested. You can “translate” the explanation to your application.
“Electric Power” => “Speed” in your case
“Energy Consumption” => “Travel-Distance” in your case

Can you tell roughly what frequency you expect (how fast the wheel rotates), how often you want to get updated for the speed and what is a typical “Travel-time”?

That’s what Pulse Meter and Pulse Counter do. They calculate values that are a function of time.

Yeah, you’re right. I wasn’t considering that these give you a rate (and not just a count). It’s been a while…

Also need to know the output unit (mi/h, km/h, m/s).

I really appreciate your help and input. This the nominal speed based on the specs of the motors (20rpm) and the wheel diameter. But I would like to calculate the actual speed.

1 pulse = 1 circumference

if your sensor reads 20 pulses the reading is expressing an instantaneous reading but expressed as per minute. therefore to get m/s you divide by 60. So the formula you need to write is (55.86/1,000)/60=0.00093m/s

i am still learning but I think that is correct.

PS. You then need a template to calculate the number in mph or km. I have used this in an anenometer.

2 Likes

I think that’s right. I quickly thought about it last night to reply with a similar answer, but didn’t have the time to write a reply. In fact, I had a quick look at the ESPHome anemometer to see if one couldn’t just use that for the purpose required here, but I don’t think it’s worth the effort. Your proposal is simple enough to implement.

The one thing I’d add would be to maybe measure the actual circumference as accurately as possible and to use a high-precision value for that numerically – not sure how precise OP needs this to be.

1 Like

I really appreciate all of your feedback and input. Sometimes things look simple enough but I just wanted to make sure I was not missing something. Thanks again for your help and time.