Best Method for Receiving Periodic Counter Values

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 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?


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.

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.

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).


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.

1 Like