# Hall Effect Sensor connected to GPIO pins - How can I could pulses per minute?

**URL:** <https://discourse.nodered.org/t/hall-effect-sensor-connected-to-gpio-pins-how-can-i-could-pulses-per-minute/62482>\
**Category:** General\
**Tags:** function-node\
**Created:** [10 May 2022 22:39 UTC](https://discourse.nodered.org/t/hall-effect-sensor-connected-to-gpio-pins-how-can-i-could-pulses-per-minute/62482 "2022-05-10T22:39:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![championc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/championc/32/39754_2.png) [@championc](https://discourse.nodered.org/u/championc)\
**Post date:** [10 May 2022 22:39 UTC](https://discourse.nodered.org/t/hall-effect-sensor-connected-to-gpio-pins-how-can-i-could-pulses-per-minute/62482/1 "2022-05-10T22:39:38Z")

</div>

Hi all,

I have a hall effect sensor connected to my Pi GPIO pins and the pulses are coming in fine. It's a water flow meter connected to an irrigation system for a community.

However, I have no idea as to how best (or even how full stop) to count the pulses per minute (to monitor the flow). My main aim is to alert if a pipe is leaking but I'd like to also monitor usage.

Last year, we had a pipe which leaked for over a month and cost us €15k in water charges - which we had no choice but to pay !!!

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [10 May 2022 23:20 UTC](https://discourse.nodered.org/t/hall-effect-sensor-connected-to-gpio-pins-how-can-i-could-pulses-per-minute/62482/2 "2022-05-10T23:20:13Z")

</div>

The node node-red-contrib-msg-speed can tell you how many messages arrived in a given period.

A flow like this might work to display usage and detect leaks:

 ![Untitled 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/f/7f62962b7177d8f64b89996a30279196711b713e.jpeg)

---

<div class="post-metadata">

**Author:** ![championc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/championc/32/39754_2.png) [@championc](https://discourse.nodered.org/u/championc)\
**Post date:** [12 June 2022 18:17 UTC](https://discourse.nodered.org/t/hall-effect-sensor-connected-to-gpio-pins-how-can-i-could-pulses-per-minute/62482/3 "2022-06-12T18:17:58Z")

</div>

Hi again,

I am monitoring the flow of water to a irrigation system for an apartments complex. I have used the MSG-SPEED node as suggested.

I have this working somewhat nicely but I have a small issue. The count appears to be HIGHER when my flow rate is lower  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/d/7dc2cf7dcd8754d3ec57795dec757d3456b5c0c4.png)  
The high peak is Zone 7 which used about 70 litres per minute, whereas the starting peak to 100 is Zone 1 which used about 81 litres per minute.

My main aim is twofold - A) mainly to monitor that something has not failed and that we don't have water escaping when we should not and B) to monitor if a Zone is using more water than expected indicating a burst pipe or broken sprinkler valve.

---

<div class="post-metadata">

**Author:** ![championc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/championc/32/39754_2.png) [@championc](https://discourse.nodered.org/u/championc)\
**Post date:** [25 June 2022 13:01 UTC](https://discourse.nodered.org/t/hall-effect-sensor-connected-to-gpio-pins-how-can-i-could-pulses-per-minute/62482/4 "2022-06-25T13:01:13Z")

</div>

I resolved my issue by setting "Debounce" to ZERO

---

<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:** [5 August 2022 21:22 UTC](https://discourse.nodered.org/t/hall-effect-sensor-connected-to-gpio-pins-how-can-i-could-pulses-per-minute/62482/5 "2022-08-05T21:22:46Z")

</div>

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