ESPHome & ILI9341 touchscreen

Hi all,

has anyone implemented any ESPHome project using an ILI9341, including touch control? I’m able to use the display aspect of the touchscreen, what I’m missing is the touch control.


According to what I have read, it has this touch controller

PS openhasp also supports it

I am using a 2.8 "ILI9341 display and trying to calibrate the touch screen.
I used code from the ESPhome documentation.
The result is the same value of 0 in each corner of the screen that does not change. What am I doing wrong?

 clk_pin: 18
 mosi_pin: 23
 miso_pin: 19
  id: touchscreen
  cs_pin: 17
  irq_pin: 16
  dimension_x: 240
  dimension_y: 320
    - lambda: |-
        if (touched)
          ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%d",
  - platform: ili9341
    model: TFT 2.4
    cs_pin: 13
    dc_pin: 27
    led_pin: 32
    reset_pin: 33
    rotation: 90
    id: tft_ha


did you manage to activate touch on this screen?

Yes, he did. I had the CLK pin badly connected.
Everything works fine, including virtual buttons.
I followed the documentation ESPhome.

1 Like

I have the same problem,
where did you connect the CLK pin?
and how did you set up esphome?

You must have all pins of the touch layer connected.
CLK, DIN, DO pins are shared. Connect them to the TFT(SPI) pins in the correct order.

Very good, now it is working like a charm
thank you very much