mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-12-25 17:17:54 +01:00
8d9b0d2375
* Netlify * Fix * Faster doxygen * Update Makefile * Try without api * Debug * Fix * Update Makefile * Debug * Try 1.8.13 * Remove debug * Update Makefile * Optimize
62 lines
3.2 KiB
ReStructuredText
62 lines
3.2 KiB
ReStructuredText
ESP32 Touch Pad Hub
|
|
===================
|
|
|
|
.. seo::
|
|
:description: Instructions for setting up the touch pad feature on the ESP32.
|
|
:image: touch.png
|
|
|
|
The ``esp32_touch`` component creates a global hub for detecting touches on
|
|
the eight touch pads of the ESP32 as :doc:`binary senors </components/binary_sensor/esp32_touch>`.
|
|
|
|
.. code-block:: 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 :doc:`setting up touch pads </components/binary_sensor/esp32_touch>`
|
|
for more information. Defaults to false.
|
|
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID for code generation.
|
|
|
|
Advanced options (the defaults are usually quite good, but if you're having accuracy issues, use these):
|
|
|
|
- **iir_filter** (*Optional*, :ref:`config-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*, :ref:`config-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*, :ref:`config-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://docs.espressif.com/projects/esp-idf/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://docs.espressif.com/projects/esp-idf/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://docs.espressif.com/projects/esp-idf/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``.
|
|
|
|
See Also
|
|
--------
|
|
|
|
- :doc:`binary_sensor/esp32_touch`
|
|
- :apiref:`binary_sensor/esp32_touch_binary_sensor.h`
|
|
- :ghedit:`Edit`
|
|
|
|
.. disqus::
|