esphome-docs/esphomeyaml/components/esp32_touch.rst

51 lines
3.1 KiB
ReStructuredText

ESP32 Touch Pad Hub
===================
The ``esp32_touch`` component creates a global hub for detecting touches on
the eight touch pads of the ESP32 as `binary senors </esphomeyaml/components/binary_sensor/esp32_touch.html>`__.
.. code:: yaml
# Example configuration entry
esp32_touch:
setup_mode: False
binary_sensor:
- platform: esp32_touch
name: "ESP32 Touch Pad GPIO27"
pin: GPIO27
threshold: 1000
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
- **setup_mode** (*Optional*, boolean): Whether debug messages with the touch pad value should
be displayed in the logs. Useful for finding out suitable thresholds for the binary sensors, but
spam the logs. See `setting up touch pads </esphomeyaml/components/binary_sensor/esp32_touch.html>`__
for more information. Defaults to false.
- **id** (*Optional*,
`id </esphomeyaml/configuration-types.html#id>`__): Manually specify the ID for this ADS1115 Hub. Use this if you
want to use multiple ADS1115 hubs at once.
Advanced options (the defaults are usually quite good, but if you're having accuracy issues, use these):
- **iir_filter** (*Optional*, `time </esphomeyaml/configuration-types.html#time>`__): Optionally set up an
`Infinite Impulse Response <https://en.wikipedia.org/wiki/Infinite_impulse_response>`__
filter should be applied to all touch pads. This can increase the accuracy of the touch pads a lot, but
higher values decrease the response time. A good value to start with is ``10ms``. Default is no IIR filter.
- **sleep_duration** (*Optional*, `time </esphomeyaml/configuration-types.html#time>`__): Set a time period
denoting the amount of time the touch peripheral should sleep between measurements. This can decrease
power usage but make the sensor slower. Default is about 27 milliseconds.
- **measurement_duration** (*Optional*, `time </esphomeyaml/configuration-types.html#time>`__): Set the conversion
time for all touch pads. A longer conversion time means that more charge/discharge cycles of the touch pad
can be performed, therefore increasing accuracy. Default is about 8ms, the maximum amount.
- **low_voltage_reference** (*Optional*): The low voltage reference to use for the charge cycles. See
the `esp-idf docs <https://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/touch_pad.html#optimization-of-measurements>`__
for a nice explanation of this. One of ``0.5V``, ``0.6V``, ``0.7V``, ``0.8V``. Default is ``0.5V``.
- **high_voltage_reference** (*Optional*): The high voltage reference to use for the charge cycles. See
the `esp-idf docs <https://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/touch_pad.html#optimization-of-measurements>`__
for a nice explanation of this. One of ``2.4V``, ``2.5V``, ``2.6V``, ``2.7V``. Default is ``2.7V``.
- **voltage_attenuation** (*Optional*): The voltage attenuation to use for the charge cycles. See
the `esp-idf docs <https://esp-idf.readthedocs.io/en/latest/api-reference/peripherals/touch_pad.html#optimization-of-measurements>`__
for a nice explanation of this. One of ``1.5V``, ``1V``, ``0.5V``, ``0V``. Default is ``0V``.