I2C Pulse Counter

I’m certain there exists I2C based 16-bit pulse counters, but I wanted flexibility to be able to deal with software debounce and possibly acquiring the wind direction (analog value) also. ATTINY85 came to mind as a great low power source for this effort.

Active current might be ~100uA

Why a pulse counter in the first place?

This could give many more options for measuring wind speed without keeping the ESP awake to do this action. The ESP32 will simply poll this device for anemometer revolution count on a desired ‘time-slice’ basis.

This will also make future ULP code cleaner to deal with as it will focus on acquiring data, not debounce logic.

Source code location

 

https://github.com/jhughes1010/I2C_pulse_counter

Design goals

Write commands to the I2C device and read the response from the device.

There may be future plans to create an independent command set for clearing the counter/ setting counter values, etc… but for now KISS

Added flexibility, not a replacement

This ‘module’ is an adder for people who want to increase wind sensing resolution without breaking the existing ability for the ESP32 to WAKE and perform wind measurement tasks. It will work in parallel.

This ‘module’ can be a plug in board with a minor modification of the I2C connect bus (need to get the WIN_PIN to the counter), or optional loading location on the main PCB. This will be TBD.

The design will have the flexibility to wake and retrieve the counter values as frequently as desired. More detailed wind sensing data could be resolved. ESP32 already has our timebase for all this.

Eventually, the ESP32 could have ULP code to support this acquire methodology.

This project should work, but testing will prove all this.

Â