ESP32 Touch Sense
Libraries:
Simulink Support Package for Arduino Hardware /
Common
Description
Use the ESP32 Touch Sense block to read the state of capacitive touch pins on Arduino®-compatible ESP32 boards. The block outputs a logical 1 (high) value indicating a touch on the pin and a logical 0 (low) value when the pin is untouched. The block can also output a raw sensor value that represents the capacitance measured at the touch pin.
Supported ESP32 Boards and Available Capacitive Touch Pins
The Arduino-compatible ESP32 boards have 10-channel capacitive touch sensor module. This module detects finger contact or proximity by measuring changes in capacitance.
The ESP32 Touch Sense block reads the states of these capacitive touch-enabled GPIO pins on the Arduino-compatible ESP32 boards. This table summarizes the ESP32 variant boards that the block supports, the number of accessible touch GPIO pins, and any associated limitations.
| Supported Arduino-Compatible ESP32 Board Variant | Available Capacitive Touch GPIO Pins | Description |
|---|---|---|
| ESP32-WROOM-DevKitV1 (30 pin) | Touch 0: GPIO 4 | On this board variant, you can use only 9 touch channels and GPIO 0 is not accessible. |
| Touch 2: GPIO 2 | ||
| Touch 3: GPIO 15 | ||
| Touch 4: GPIO 13 | ||
| Touch 5: GPIO 12 | ||
| Touch 6: GPIO 14 | ||
| Touch 7: GPIO 27 | ||
| Touch 8: GPIO 33 | ||
| Touch 9: GPIO 32 | ||
ESP32-WROOM-DevKitV1 (36 pin) ESP32-WROOM-DevKitC (38 pin) | Touch 0: GPIO 4 | On this board variant, you can use all 10 touch channels. |
| Touch 1: GPIO 0 | ||
| Touch 2: GPIO 2 | ||
| Touch 3: GPIO 15 | ||
| Touch 4: GPIO 13 | ||
| Touch 5: GPIO 12 | ||
| Touch 6: GPIO 14 | ||
| Touch 7: GPIO 27 | ||
| Touch 8: GPIO 33 | ||
| Touch 9: GPIO 32 |
Note
GPIO 0 (touch channel 1) is available on ESP32 variant boards with 32 or more GPIO pins.
Examples
Ports
Output
Parameters
Version History
Introduced in R2026a

