# Best Method for Receiving Periodic Counter Values

**URL:** <https://discuss.blues.com/t/best-method-for-receiving-periodic-counter-values/1216>\
**Category:** Notecard API\
**Created:** [January 30, 2023, 5:28pm UTC](https://discuss.blues.com/t/best-method-for-receiving-periodic-counter-values/1216 "2023-01-30T17:28:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitchell60](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@amitchell60](https://discuss.blues.com/u/amitchell60)\
**Post date:** [January 30, 2023, 5:28pm UTC](https://discuss.blues.com/t/best-method-for-receiving-periodic-counter-values/1216/1 "2023-01-30T17:28:43Z")

</div>

I would like to use an Aux input on the Notecard to count pulses and receive periodic (e.g. once per hour) updates of the cumulative counter value. I want to do this in stand-alone mode, without an attached MCU. I have somewhat successfully used the \_aux\_gpio\_report\_enable environment variable to enable reporting of the count values through an environment variable. But, I have had two problems with that approach:

- If frequent pulses are occurring I receive [extra \_env.dbs events](https://discuss.blues.com/t/extra-env-dbs-events-with-counter/1214) during each sync, consuming extra consumption credits because I Route that event.
- In a couple day testing session, the update of the \_aux\_gpio\_report variable stopped (frozen count) even though pulses continued and the internal pulse count continued to update, as reported by a “card.aux” request.

Is there a way to periodically report the count through a \_button.qo Note instead of through the \_aux\_gpio\_report Environment variable? Is that approach likely to remedy the above two problems?

Thanks,  
Alan

---

<div class="post-metadata">

**Author:** ![amitchell60](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@amitchell60](https://discuss.blues.com/u/amitchell60)\
**Post date:** [January 30, 2023, 10:50pm UTC](https://discuss.blues.com/t/best-method-for-receiving-periodic-counter-values/1216/2 "2023-01-30T22:50:47Z")

</div>

I should also mention that the other issue I’ve had with pulse counting is the hair-trigger sensitivity of the Aux input, resulting in extra counts. I put 4.7 uF and a 0.1 uF capacitors across the input, and that has helped quite a bit.

---

<div class="post-metadata">

**Author:** ![amitchell60](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@amitchell60](https://discuss.blues.com/u/amitchell60)\
**Post date:** [February 1, 2023, 6:06pm UTC](https://discuss.blues.com/t/best-method-for-receiving-periodic-counter-values/1216/3 "2023-02-01T18:06:28Z")

</div>

Actually, even with the capacitors, I am still getting a significant number of extra counts. This has caused me to abandon the use of a standalone Notecard as a pulse counter. An external MCU with debounce and noise filtering code coupled with a Notecard would be an alternative.

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [February 6, 2023, 7:13pm UTC](https://discuss.blues.com/t/best-method-for-receiving-periodic-counter-values/1216/4 "2023-02-06T19:13:28Z")

</div>

Hi @amitchell60 and welcome to the Blues community!

Sorry for the delay in our response. We’ve been looking into this issue, and it completely makes sense from a functional perspective. Unfortunately there is no available workaround given the current firmware. However, accommodating this feature is in our backlog and we hope to provide an update for the next developer release of the Notecard firmware (likely in the March timeframe).

Thanks,  
Rob

---

<div class="post-metadata">

**Author:** ![amitchell60](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@amitchell60](https://discuss.blues.com/u/amitchell60)\
**Post date:** [February 7, 2023, 8:18pm UTC](https://discuss.blues.com/t/best-method-for-receiving-periodic-counter-values/1216/5 "2023-02-07T20:18:36Z")

</div>

Hello Rob, and thanks for the response. That’s good news that pulse counting issues are in the queue to be addressed. Notecard as a stand-alone, no-MCU, pulse counter would be a valuable use case. I use Notecards now as stand-alone trackers and temperature monitors, and pulse-counting would be another valuable use. Hopefully, the following issues are on your radar:

- I was getting a lot of extra pulses, using an electronic (no mechanical bounce) input, even adding a few decoupling capacitors. It seems like some software filtering and debouncing (perhaps configurable) on your side could solve that.
- Reporting the Aux input states, including counts, through the \_session.qo event, just like temperature and voltage are reported now, would be my preference, even better than reporting through a periodic \_button.qo event.
- It would be great if Notecard configuration would allow the cumulative pulse count to be persisted across Notecard restarts, instead of resetting to zero.

Thanks for your attention to this. Hopefully I’ll be able to use your product for this application in the near future.  
–Alan
