2019-05-25 09:08:05 +02:00
|
|
|
Pulse Width Sensor
|
|
|
|
==================
|
|
|
|
|
|
|
|
.. seo::
|
|
|
|
:description: Instructions for setting up pulse width sensors in ESPHome
|
2021-11-16 03:19:33 +01:00
|
|
|
:image: pulse.svg
|
2019-05-25 09:08:05 +02:00
|
|
|
|
|
|
|
The ``pulse_width`` sensor allows you to measure how long a given digital signal
|
|
|
|
is HIGH. For example this can be used to measure PWM signals to transmit some
|
2023-10-09 20:36:40 +02:00
|
|
|
value over a simple protocol. The unit of measurement for this sensor is seconds.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
This component is intended for measurements in the microsecond to seconds range!
|
|
|
|
The largest period this component can measure is just over 70 minutes.
|
2019-05-25 09:08:05 +02:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
# Example configuration entry
|
|
|
|
sensor:
|
|
|
|
- platform: pulse_width
|
|
|
|
pin: D0
|
|
|
|
name: Pulse Width Sensor
|
|
|
|
|
|
|
|
Configuration variables:
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
- **pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The pin to observe for the
|
|
|
|
pulse width.
|
|
|
|
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor.
|
|
|
|
Defaults to ``60s``.
|
|
|
|
|
|
|
|
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
|
|
|
|
- All other options from :ref:`Sensor <config-sensor>`.
|
|
|
|
|
|
|
|
See Also
|
|
|
|
--------
|
|
|
|
|
|
|
|
- :ref:`sensor-filters`
|
|
|
|
- :apiref:`pulse_width/pulse_width.h`
|
|
|
|
- :ghedit:`Edit`
|