ESP32 Pulse Counter @JohnLauerGplus
ESP32 Pulse Counter  @JohnLauerGplus
Uploaded April 2019 | Updated September 2026, 1 week ago
This video shows off a new pulsecnt module for the ESP32 NodeMCU firmware. The pulsecnt library handles sophisticated and automatic pulse counting using the built-in hardware on ESP32. The pulsecnt library gives you a means to not rely on GPIO triggers to do your pulse counting and instead offload the work to independent hardware. You gain the ability to count pulses up to 80Mhz (speed of APB clock).

You can get a callback to Lua when different counting thresholds are reached, or when upper or lower counting limits are hit. You can count pulses on all GPIO ports. There is also a way to provide a control GPIO for ignoring or decrementing pulses when the control signal is high or low.

The Github repo for the pulsecnt library is at github.com/chilipeppr/nodemcu-firmware/tree/dev-esp32-pulsecnt-pr1

Example code for different types of pulse counter implementations is available as Gists on Github.

Example Pulse Counter for 1 channel with no control gpio
gist.github.com/chilipeppr/b4d67c61c3e051ff61fbe2beece767b5

Example Pulse Counter for hall effect sensor plus 1 push button to control direction of count
gist.github.com/chilipeppr/fee7d92cfb7d5fa981766857dfdcadd8

Example Pulse Counter for 1 channel for polling pulse count (no callback)
gist.github.com/chilipeppr/6528705eefb269d151a813bb36b4955a
ESP32 Pulse CounterInterview with Grbl Maintainer Sonny JeonCompiling ESP32 Lua (NodeMCU) FirmwareCreating the Tigershark ChiliPeppr WorkspacePart 3 - Fork the Template Widget to Make Your Own Widget
John Lauer |

ESP32 Pulse Counter

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER