# High Speed Counter

**URL:** <https://discourse.nodered.org/t/high-speed-counter/29718>\
**Category:** Hardware\
**Created:** [8 July 2020 14:40 UTC](https://discourse.nodered.org/t/high-speed-counter/29718 "2020-07-08T14:40:35Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![BigWillow](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@BigWillow](https://discourse.nodered.org/u/BigWillow)\
**Post date:** [8 July 2020 14:40 UTC](https://discourse.nodered.org/t/high-speed-counter/29718/1 "2020-07-08T14:40:35Z")

</div>

Hi  
I am planning for my wind speed project. I need to read a pulse frequency from a rotation counter, but I have done some bench testing using a function generator & the **node-red-contrib-frequency-meter** node, and it seems to top out at about 20Hz. This seems to equate to approx 25-30mph, which isnt quite enough.

Any ideas as to what I could do instead ? Is there a HAT with a counter ?  
Needs to be simple, I'm only an engineer 😉  
Cheers.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 July 2020 15:05 UTC](https://discourse.nodered.org/t/high-speed-counter/29718/2 "2020-07-08T15:05:49Z")

</div>

Node red isn't really designed for that sort of work (counting rapid pulses on an input). I think you need to use a hardware counter or frequency meter to do that, as you have suggested. This may not be the best place to ask about Pi add-ons, though someone may be able to suggest something.

---

<div class="post-metadata">

**Author:** ![BigWillow](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@BigWillow](https://discourse.nodered.org/u/BigWillow)\
**Post date:** [8 July 2020 15:21 UTC](https://discourse.nodered.org/t/high-speed-counter/29718/3 "2020-07-08T15:21:47Z")

</div>

Thanks Colin. Yes, I agree, I wasnt hugely surprised tbh but always worth a go ! I am thinking someone must have written something that does the counting outside of node red, in a faster envirinment, then presents it as figure to Node Red. All I can do it count the GPI as it is presented, then maths it. I would like to avoid a chip if poss as my electronics is a bit rusty !

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 July 2020 15:37 UTC](https://discourse.nodered.org/t/high-speed-counter/29718/4 "2020-07-08T15:37:23Z")

</div>

Googling for pi hat counter gives lots of hits, though it would probably be much cheaper to use an ESP device or an Arduino or similar.

---

<div class="post-metadata">

**Author:** ![BigWillow](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@BigWillow](https://discourse.nodered.org/u/BigWillow)\
**Post date:** [8 July 2020 15:44 UTC](https://discourse.nodered.org/t/high-speed-counter/29718/5 "2020-07-08T15:44:36Z")

</div>

I actaully didnt have too much success looking for HATs. Would an Arduino counter have a high frequency ability then? How would I send data between the 2, could I do via MQTT, I just worked out how that works 🙂

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 July 2020 15:50 UTC](https://discourse.nodered.org/t/high-speed-counter/29718/6 "2020-07-08T15:50:11Z")

</div>

Wouldn't this do it?

> **[1-wire/counter/RTC Pi HAT (short tail)](https://homechip.com/collections/raspberry-pi/products/1-wire-counter-rtc-pi-hat-short-tail)**
>
> Description The I2C counter and 1-wire board HAT is for use with a Raspberry PI. It provides a 1-wire bus connection, able to support multiple 1-wire devices and brought out onto an RJ12 socket. 5v power is also fed to the 1-wire bus so devices...

I don't know about the capabilities of the devices to count, just making suggestions for research. I believe Arduino (which I havn't use) usually connect via serial and the ESP (which I have) via wifi and MQTT.

As I said this may not be the best place to ask about this unless someone here happens to have done something similar (a counter I mean).

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [8 July 2020 15:54 UTC](https://discourse.nodered.org/t/high-speed-counter/29718/7 "2020-07-08T15:54:55Z")

</div>

Here's a link to an article on the ESP Easy forum. It sounds like someone has managed 65Hz using the Generic - Pulse counter within ESP Easy.

[https://www.letscontrolit.com/forum/viewtopic.php?f=6&t=3476&p=18559&hilit=pulse+counter+speed#p18559](https://www.letscontrolit.com/forum/viewtopic.php?f=6&t=3476&p=18559&hilit=pulse+counter+speed#p18559)

---

<div class="post-metadata">

**Author:** ![BigWillow](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@BigWillow](https://discourse.nodered.org/u/BigWillow)\
**Post date:** [8 July 2020 16:12 UTC](https://discourse.nodered.org/t/high-speed-counter/29718/9 "2020-07-08T16:12:45Z")

</div>

Thanks @dynamicdave for this, but it looks a little too involved for me, hoping to find something a bit simpler.

---

<div class="post-metadata">

**Author:** ![BigWillow](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@BigWillow](https://discourse.nodered.org/u/BigWillow)\
**Post date:** [8 July 2020 16:13 UTC](https://discourse.nodered.org/t/high-speed-counter/29718/10 "2020-07-08T16:13:53Z")

</div>

Thanks @Colin , I like the look of that & I have played with 1-wire also. Little steep on price tho.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 July 2020 16:19 UTC](https://discourse.nodered.org/t/high-speed-counter/29718/11 "2020-07-08T16:19:47Z")

</div>

> [@BigWillow](#):
>
> Little steep on price tho.

The easy way is often not the cheapest.  
There may be other options though, maybe try a Pi forum.

---

<div class="post-metadata">

**Author:** ![BigWillow](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@BigWillow](https://discourse.nodered.org/u/BigWillow)\
**Post date:** [8 July 2020 16:23 UTC](https://discourse.nodered.org/t/high-speed-counter/29718/12 "2020-07-08T16:23:31Z")

</div>

@Colin thanks. I will keep hunting, I may have to dig out an old Arduino, pretty sure I had one with a counter on, just not sure of the performance.

---

<div class="post-metadata">

**Author:** ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)\
**Post date:** [9 July 2020 20:26 UTC](https://discourse.nodered.org/t/high-speed-counter/29718/13 "2020-07-09T20:26:24Z")

</div>

Maybe this Arduino library could do it? [https://www.pjrc.com/teensy/td\_libs\_FreqCount.html](https://www.pjrc.com/teensy/td_libs_FreqCount.html)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [7 September 2020 20:26 UTC](https://discourse.nodered.org/t/high-speed-counter/29718/14 "2020-09-07T20:26:35Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
