Skip to content

Create pulse-catcher.rst #4782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,7 @@ Cookbook
Sonoff Fishpond Pump, cookbook/sonoff-fishpond-pump, cookbook-sonoff-fishpond-pump.jpg
Arduino Port Extender, cookbook/arduino_port_extender, arduino_logo.svg
EHMTX a matrix status/text display, cookbook/ehmtx, ehmtx.jpg
Pulse Catcher, cookbook/pulse-catcher, pulses.png

Contributing
------------
Expand Down
34 changes: 34 additions & 0 deletions cookbook/pulse-catcher.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Pulse Catcher
=============

.. seo::
:description: Example to use the pulse meter sensor as a pulse catcher.
:image: pulses.png

The :doc:`/components/sensor/pulse_meter` can be used as a very fast pulse catcher. This can be useful
if you would like to detect an incoming pulse on a GPIO pin shorter than the typical ``16ms`` loop interval.

.. code-block:: yaml

sensor:
- platform: pulse_meter
pin: GPIOXX
# internal_filter: 1ms # If a pulse shorter than this time is detected, it is discarded. Defaults to 13us.
id: trigger
filters:
- lambda: return {}; # Don't return any pulses/s to not spam the logs
total:
id: pulses
on_value:
then:
# Do something cool when a pulse is detected, like flashing a led e.g.
- output.turn_on: led
- delay: 500ms
- output.turn_off: led

See Also
--------

- :doc:`/automations/index`
- :doc:`/components/sensor/pulse_meter`
- :ghedit:`Edit`
Binary file added images/pulses.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.