• sales

    +86-0755-88291180

1.54inch Touch LCD Module User Guide

Specifications

ParameterSpecification
Operating Voltage3.3V / 5V
Resolution240 × 240 pixels
Display DriverST7789S
Touch ChipCST816D
Display Interface4-wire SPI
Touch InterfaceI2C
Display PanelIPS
Touch TypeCapacitive
Display Size27.72 × 27.72 (mm)
Pixel Size0.1155 × 0.1155 (mm)
Product Size40.2 × 40.2 (mm)

Interface Description


Function PinDescription12PIN Number18PIN Number
VCCPower positive (3.3V / 5V input)11
GNDPower ground23
MOSISPI data pin (Master Out Slave In)35
SCLKSPI clock pin44
LCD_CSLCD chip select, active low59
LCD_DCLCD data/command control, low for command, high for data67
LCD_RSTLCD reset, active low78
LCD_BLLCD backlight control82
TP_SDATouch panel I2C data pin914
TP_SCLTouch panel I2C clock pin1013
TP_RSTTouch panel reset, active low1112
TP_INTTouch panel interrupt output1215

Dimensions


ESP-IDF

This chapter contains the following sections. Please read as needed:

ESP-IDF Getting Started

New to ESP32 ESP-IDF development and looking to get started quickly? We have prepared a general Getting Started Tutorial for you.

Please Note: This tutorial uses the ESP32-S3-Zero as a teaching example, and all hardware code is based on its pinout. Before you start, it is recommended that you check the pinout of your development board to ensure the pin configuration is correct.

Setting Up Development Environment

NOTE

The following guide uses Windows as an example, demonstrating development using VS Code + the ESP-IDF extension. macOS and Linux users should refer to the official documentation.

VERSION SELECTION

The screenshots in this section use ESP-IDF V5.5.2 as an example. When installing, please select the ESP-IDF version that matches your board's example.

Install the ESP-IDF Development Environment

  1. Download the installation manager from the ESP-IDF Installation Manager page. This is Espressif's latest cross-platform installer. The following steps demonstrate how to use its offline installation feature.

    Click the Offline Installer tab on the page, then select Windows as the operating system and the ESP-IDF version you need (the version shown in the screenshot is for reference only — choose the version that fits your actual needs).


    After confirming your selection, click the download button. The browser will automatically download two files: the ESP-IDF Offline Package (.zst) and the ESP-IDF Installer (.exe).


    Please wait for both files to finish downloading.

  2. Once the download is complete, double-click to run the ESP-IDF Installer (eim-gui-windows-x64.exe).

    The installer will automatically detect if the offline package exists in the same directory. Click Install from archive.


    Next, select the installation path. We recommend using the default path. If you need to customize it, ensure the path does not contain Chinese characters or spaces. Click Start installation to proceed.

    Select installation path
  3. When you see the following screen, the ESP-IDF installation is successful.


  4. We recommend installing the drivers as well. Click Finish installation, then select Install driver.


Install Visual Studio Code and the ESP-IDF Extension

  1. Download and install Visual Studio Code.

  2. During installation, it is recommended to check Add "Open with Code" action to Windows Explorer file context menu to facilitate opening project folders quickly.

  3. In VS Code, click the Extensions icon Extensions Icon in the Activity Bar on the side (or use the shortcut Ctrl + Shift + X) to open the Extensions view.

  4. Enter ESP-IDF in the search box, locate the ESP-IDF extension, and click Install.


  5. For ESP-IDF extension versions ≥ 2.0, the extension will automatically detect and recognize the ESP-IDF environment installed in the previous steps, requiring no manual configuration.

Demo

01_ESP32S3_test

Demo Description

  • This example demonstrates how to drive the 1.54inch Touch LCD Module based on an ESP32-S3 development board. It implements a color cycle test and touch functionality test, while also reserving image display capability based on the LVGL graphics library, supporting image switching via left and right swipe gestures.

Hardware Connection

1.54inch Touch LCD ModuleESP32-S3-DEV-KIT-N16R8-M
VCC3.3V
GNDGND
LCD_DINGP7
LCD_CLKGP6
LCD_CSGP5
LCD_DCGP4
LCD_RSTGP38
LCD_BLGP40
TP_SDAGP15
TP_SCLGP14
TP_RSTGP39
TP_INTGP13
  • Connect the screen to the development board using a GH1.25 12PIN cable
  • Connect the development board to the computer

Code Analysis

  • image_slider_init():

    • Implements left and right swipe gesture recognition and image switching based on the LVGL v9.3.0 graphics library, providing users with a smooth image browsing experience.
  • app_main():

    • Initializes the display, touch screen, and LVGL graphics library. It implements the color cycle test and basic touch function verification, laying the foundation for subsequent graphical interaction applications.

Operation Result

  • LCD Color Cycle Test:


  • LCD Touch Test:


  • LVGL Image Switching Test:


Working with Arduino

This chapter contains the following sections. Please read as needed:

Arduino Getting Started

New to Arduino ESP32 development and looking for a quick start? We have prepared a comprehensive Getting Started Tutorial for you.

Note: This tutorial uses the ESP32-S3-Zero as a reference example, and all hardware code is based on its pinout. Before you start, we recommend checking the pinout of your development board to ensure the pin configuration is correct.

Setting Up Development Environment

1. Installing and Configuring Arduino IDE

Please refer to the tutorial Installing and Configuring Arduino IDE to download and install the Arduino IDE and add ESP32 support.

2. Installing Libraries

  • When installing Arduino libraries, there are typically two methods: Install Online and Install Offline. If the library installation requires Install Offline, you must use the provided library file.
  • For most libraries, users can easily search for and install them via the Arduino IDE's online Library Manager. However, some open-source or custom libraries are not synchronized to the Arduino Library Manager and therefore cannot be found through online search. In this case, users can only install these libraries manually via offline methods.
  • You can click this link to download the demo package for the 1.54inch Touch LCD Module board from the Arduino directory. The Arduino-uno\libraries directory inside this package contains all the necessary library files required for this tutorial.
Library/File NameDescriptionVersionInstallation Method
GFX_Library_for_ArduinoST7789 GFX graphics libraryv1.4.9"Install Offline"
VERSION COMPATIBILITY NOTES

There are strong dependencies between versions of LVGL and its driver libraries. For example, a driver written for LVGL v8 may not be compatible with LVGL v9. To ensure that the examples can be reproduced reliably, it is recommended to use the specific versions listed in the table above. Mixing different versions of libraries may lead to compilation failures or runtime errors.

Installation Steps:

  1. Download the demo package.

  2. Copy all the folders (GFX_Library_for_Arduino) from its Arduino-uno\libraries directory to your Arduino libraries folder.

    INFO

    The path to the Arduino libraries folder is typically: c:\Users\<username>\Documents\Arduino\libraries.

    You can also locate it in the Arduino IDE by going to File > Preferences and checking the "Sketchbook location". The libraries folder is the libraries subfolder within this path.

  3. For other installation methods, please refer to: Arduino Library Management Tutorial.

Installation Instructions for the 1.54inch Touch LCD Module Required Board

Board NameBoard Installation RequirementVersion Requirement
Arduino AVR Boards"Install Offline" / "Install Online"v1.8.6

Demo

The Arduino_Uno_test demo is located in the Arduino-uno directory of the demo package.

01_Arduino_Uno_test

Demo Description

  • This demo uses the GFX_Library_for_Arduino to drive the ST7789 screen, implementing text display, color cycle testing, and touch testing functions.

Hardware Connection

1.54inch Touch LCD ModuleArduino-Uno
VCC3.3V
GNDGND
LCD_DINGP11
LCD_CLKGP13
LCD_CSGP9
LCD_DCGP8
LCD_RSTGP7
LCD_BLGP6
TP_SDASDA
TP_SCLSCL
TP_RSTGP2
TP_INTGP3
  • Connect the screen to the development board using a GH1.25 12PIN cable
  • Connect the development board to the computer

Code Analysis

  • setup():

    • Initializes the serial port, ST7789 display (including backlight), and CST816D touch controller. Performs text display and color cycle tests to verify basic display functionality.
  • loop():

    • Continuously reads touch coordinates, prints them to the serial monitor, and draws a red dot at the touch position on the screen, providing visual touch feedback (at 10ms intervals for real-time response).
  • LCD_display_test():

    • The screen sequentially fills with red, green, blue, and white colors (each for 1 second) to verify display color accuracy and full-screen refresh capability.

Operation Result

  • LCD Touch Test:



Resources

1. Hardware Resources

2. Demo

3. Software

4. Other Resource Links

Support

Monday-Friday (9:30-6:30) Saturday (9:30-5:30)

Email: services01@spotpear.com