How to Use ESP32 with ILI9488 3.5" TFT LCD Touch Screen
How to Use ESP32 with ILI9488 3.5” TFT LCD Touch Screen
This guide walks you through wiring and using a 3.5” TFT LCD (480x320) with touch functionality on an ESP32 board using the TFT_eSPI library.
Required Components
- ESP32 NodeMCU ESP-WROOM-32 board
- 3.5” ILI9488 TFT LCD 480x320 with touch
- Micro USB cable for uploading
- Breadboard and jumper wires
- 5V 2A power adapter
ESP32 to ILI9488 Wiring
Touch Panel Connections
| ESP32 | ILI9488 Touch |
|---|---|
| D18 | T_CLK |
| RX2 | T_CS |
| D23 | T_DIN |
| D19 | T_DOUT |
| - | T_IRQ (Not needed) |
Note: The MISO (SDO) pin on the display is optional and can be left unconnected.
Installing TFT_eSPI Library
Step 1: Download Library
Download from GitHub: Bodmer/TFT_eSPI or from the MediaFire link provided in the original article.
Step 2: Extract and Place in Libraries Folder
Use WinRAR or WinZip to extract, then copy the TFT_eSPI-master folder to:
This PC > Documents > Arduino > libraries
Step 3: Edit Config File for ILI9488
-
Open
User_Setup_Select.hin the library folder -
Scroll to line 22, column 1. You will see
#include <User_setup.h>. Add//at the beginning to comment it out. -
Scroll to line 47, column 3. You will see
//#include <User_setup.h>. Remove the//to uncomment it, leaving only#include <User_setup.h>
- Save and close the file.
Step 4: Configure PIN assignments for ILI9488
-
Navigate to the
User_Setupfolder inside the library -
Open
Setup21_ILI9488.h -
Edit the GPIO pin assignments according to your actual wiring
-
Save and close the file.
Uploading Graphics Test Code
Upload Steps
-
Open Arduino IDE
-
Navigate to
File > Examples > TFT_eSPI > 480 x 320 > TFT_grapicstest_one_lib -
Select the Port connected to your ESP32
-
Select Board as
ESP32 Dev Module -
Click Upload (Sketch > Upload)
-
Wait for Arduino IDE to finish processing
If Upload Gets Stuck
If the upload window is stuck at Connecting... for more than 3 seconds, press and hold the BOOT button on the ESP32 board until the display starts responding.
Once uploaded successfully, you will see completion messages in Arduino IDE and the ILI9488 screen will display various graphics patterns.
Touch Screen Calibration
Calibration Steps
-
Navigate to
File > Examples > TFT_eSPI > Generic > Touch_calibrate -
Upload this code to your ESP32 board
-
Open Serial Monitor and set Baud Rate to 115200
-
The ILI9488 screen will show 4 arrow targets
-
Use a touch stylus (recommended over finger) to tap precisely at the tip of each arrow - all 4 points
[image: ILI9488 screen displaying 4 calibration arrow targets at corners - top-left, top-right, bottom-right, bottom-left]
-
When calibration completes, Serial Monitor will display accuracy values
-
The screen will then show “Touch screen to test!”
-
Try touching the screen with the stylus or your finger - dots or lines will appear at the touch positions
If Touch Position is Inaccurate
If the displayed touch position differs significantly from where you actually touched, press the EN button on the ESP32 board to reset, then redo the Touch Calibration process.
Summary
After completing all setup steps, you can use the ILI9488 display for various projects such as:
- Displaying sensor data
- Creating UI menus for device control
- Showing real-time graphs
- Building games or touch-based applications
Reference Video
อยากทำโปรเจคแบบนี้?
รับทำโปรเจค Arduino / IoT จบงานไว ส่งงานครบ พร้อมสอน
If you need Arduino project service or urgent IoT development, see full service details on the home page
จ้างทำโปรเจคเลย