Stufin
Home Quick Cart Profile

ELECROW 2.4"-ESP32 HMI 320x240 SPI TFT LCD Touch Screen - Arduino/LVGL Compatible

Buy Now on Stufin

Resolution

320x240 pixels (QVGA)

Dot Pitch

0.05mm x 0.15mm

Aspect Ratio

43

Viewing Angle

80/80/60/60 (U/D/L/R)

Brightness

250 cd/m

Contrast Ratio

  • Touch Screen Functionality:
5001

Capacitive touch technology

Support for single-touch and multi-touch gestures

Touch resolution

320x240 pixels

  • Microcontroller Compatibility:

Compatible with ESP32 microcontrollers

Supports Arduino and LVGL (Light and Versatile Graphics Library) frameworks

  • Communication Interface:

SPI (Serial Peripheral Interface) bus for communication with the microcontroller

Supports 3-wire or 4-wire SPI modes

  • Additional Features:

Integrated power supply voltage regulator (3.3V)

Built-in LED backlight with adjustable brightness

Supports 65K colors

Operating temperature range

-20C to 70C

Functionality

  • IoT devices
  • Robotics
  • Industrial control systems
  • Medical devices
  • Home automation systems
  • Gaming consoles
  • Educational projects
This display module is designed to facilitate the development of interactive applications with a user-friendly interface. The capacitive touch screen allows users to interact with the device by tapping, swiping, and pinching on the screen. The high-resolution color TFT LCD screen displays graphics, images, and text with high clarity, making it suitable for a wide range of applications, including

Advantages

  • Easy to use and integrate with ESP32 microcontrollers
  • High-resolution color display with capacitive touch functionality
  • Support for popular frameworks like Arduino and LVGL
  • Compact design with a small form factor
  • Cost-effective solution for IoT and interactive projects

Applications

  • IoT devices: Remotely monitor and control IoT devices with a user-friendly interface.
  • Robotics: Develop interactive robotic systems with a intuitive user interface.
  • Industrial control systems: Create industrial control systems with a high-resolution display and touch functionality.
  • Medical devices: Design medical devices with a user-friendly interface for medical professionals and patients.
  • Home automation systems: Develop home automation systems with a touch-enabled interface.
This display module is suitable for a wide range of applications, including

In conclusion, the ELECROW 2.4"-ESP32 HMI 320x240 SPI TFT LCD Touch Screen is a versatile display module that provides a comprehensive HMI solution for IoT and interactive projects. Its high-resolution color display, capacitive touch functionality, and microcontroller compatibility make it an ideal choice for a wide range of applications.

Pin Configuration

  • ELECROW 2.4"-ESP32 HMI 320x240 SPI TFT LCD Touch Screen - Arduino/LVGL Compatible
  • Pinouts and Connection Guide
  • The ELECROW 2.4"-ESP32 HMI TFT LCD Touch Screen is a cutting-edge display module designed for IoT applications, compatible with Arduino and LVGL. This documentation provides a comprehensive guide to the pinouts and connections of this module.
  • Pinouts:
  • The module has a total of 20 pins, which can be divided into three categories: Power, SPI, and Touch Screen.
  • Power Pins (6):
  • 1. VCC: 3.3V Power Input (typical operating voltage)
  • 2. GND: Ground Pin (connect to system ground)
  • 3. VIN: External Power Input (optional, 5V or 3.3V)
  • 4. EN: Enable Pin (active high, connected to high level to enable the module)
  • 5. RST: Reset Pin (active low, connected to low level to reset the module)
  • 6. 3V3: 3.3V Power Output (for powering external devices, e.g., microcontrollers)
  • SPI Pins (6):
  • 1. SCK: Serial Clock Pin (clock signal for SPI communication)
  • 2. MOSI: Master Out Slave In Pin (data transmission from microcontroller to module)
  • 3. MISO: Master In Slave Out Pin (data reception from module to microcontroller)
  • 4. CS: Chip Select Pin (active low, selects the module for SPI communication)
  • 5. DC: Data/Command Pin (distinguishes between data and command transmission)
  • 6. BLK: Backlight Control Pin (adjusts the backlight brightness)
  • Touch Screen Pins (8):
  • 1. T_CLK: Touch Screen Clock Pin (clock signal for touch screen communication)
  • 2. T_CS: Touch Screen Chip Select Pin (active low, selects the touch screen for communication)
  • 3. T_DIN: Touch Screen Data In Pin (data transmission from microcontroller to touch screen)
  • 4. T_DOUT: Touch Screen Data Out Pin (data reception from touch screen to microcontroller)
  • 5. T_IRQ: Touch Screen Interrupt Pin (interrupt signal from touch screen to microcontroller)
  • 6. T_RST: Touch Screen Reset Pin (active low, resets the touch screen)
  • 7. X+: Touch Screen X-axis Positive Pin
  • 8. X-: Touch Screen X-axis Negative Pin
  • 9. Y+: Touch Screen Y-axis Positive Pin
  • 10. Y-: Touch Screen Y-axis Negative Pin
  • Connection Structure:
  • To connect the module to your microcontroller or development board, follow these steps:
  • 1. Connect the Power Pins:
  • VCC to 3.3V power source
  • GND to system ground
  • VIN to external power source (if used)
  • EN to high level (e.g., 3.3V) to enable the module
  • RST to low level (e.g., GND) to reset the module
  • 3V3 to power output pin (if used)
  • 2. Connect the SPI Pins:
  • SCK to microcontroller's SCK pin
  • MOSI to microcontroller's MOSI pin
  • MISO to microcontroller's MISO pin
  • CS to microcontroller's CS pin
  • DC to microcontroller's DC pin
  • BLK to microcontroller's BLK pin (if used)
  • 3. Connect the Touch Screen Pins:
  • T_CLK to microcontroller's T_CLK pin
  • T_CS to microcontroller's T_CS pin
  • T_DIN to microcontroller's T_DIN pin
  • T_DOUT to microcontroller's T_DOUT pin
  • T_IRQ to microcontroller's T_IRQ pin
  • T_RST to microcontroller's T_RST pin
  • X+ to touch screen's X-axis positive pin
  • X- to touch screen's X-axis negative pin
  • Y+ to touch screen's Y-axis positive pin
  • Y- to touch screen's Y-axis negative pin
  • Note: Ensure proper voltage levels and signal integrity when connecting the module to your microcontroller or development board. Consult the module's datasheet and your microcontroller's documentation for specific connection requirements and pinouts.

Code Examples

ELECROW 2.4"-ESP32 HMI 320x240 SPI TFT LCD Touch Screen - Arduino/LVGL Compatible
Overview
The ELECROW 2.4"-ESP32 HMI 320x240 SPI TFT LCD Touch Screen is a compact, high-resolution display module designed for IoT and embedded system applications. It features a 2.4-inch SPI TFT LCD display with a resolution of 320x240 pixels and a capacitive touch screen. The module is compatible with Arduino and LVGL, making it an ideal choice for various projects, from simple prototyping to complex industrial applications.
Technical Specifications
Display Type: 2.4" SPI TFT LCD
 Resolution: 320x240 pixels
 Touch Screen: Capacitive
 Interface: SPI
 Compatible with: Arduino, LVGL, ESP32
 Operating Temperature: -20C to 70C
 Storage Temperature: -30C to 80C
Pinouts
The module has a 14-pin interface, which includes:
VCC: 3.3V power supply
 GND: Ground
 SCLK: SPI clock
 MOSI: SPI data out
 MISO: SPI data in
 CS: SPI chip select
 DC: Data/command select
 RESET: Reset pin
 TFT_LED: Backlight control
 TOUCH_CS: Touch screen chip select
 TOUCH_IRQ: Touch screen interrupt
 TOUCH_CLK: Touch screen clock
Code Examples
Here are three code examples demonstrating how to use the ELECROW 2.4"-ESP32 HMI 320x240 SPI TFT LCD Touch Screen with Arduino and LVGL:
Example 1: Basic Display Initialization and Drawing (Arduino)
```c
#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();
void setup() {
  tft.begin();
  tft.setRotation(1); // Rotate the display 90 degrees
  tft.fillScreen(TFT_BLACK); // Clear the screen
  tft.setTextColor(TFT_WHITE);
  tft.setTextSize(2);
  tft.setCursor(10, 10);
  tft.println("Hello, World!");
}
void loop() {
  // Nothing to do here
}
```
This example initializes the display, sets the rotation to 90 degrees, clears the screen, and prints a "Hello, World!" message to the display.
Example 2: Touch Screen Calibration and Event Handling (LVGL)
```c
#include <lvgl.h>
#include <lv_driver_hal.h>
LV DISP_BUF_t disp_buf;
lv_indev_t indev;
void lv_init(void) {
  lv_init_disp_buf(&disp_buf, NULL, 320  sizeof(lv_color_t));
  lv_disp_drv_init(&disp_drv);
  disp_drv.disp_buf = &disp_buf;
  lv_disp_drv_register(&disp_drv);
  
  lv_indev_init(&indev);
  lv_indev_set_type(&indev, LV_INDEV_TYPE_POINTER);
  lv_indev_read_cb_t read_cb;
  read_cb = NULL;
  lv_indev_set_read_cb(&indev, read_cb);
  
  lv_indev_register(&indev);
}
int main(void) {
  lv_init();
  lv_obj_t label = lv_label_create(lv_scr_act());
  lv_label_set_text(label, "Touch me!");
  
  while(1) {
    lv_task_handler();
  }
  
  return 0;
}
```
This example initializes the LVGL library, sets up the display buffer, and registers the touch screen input device. It then creates a label on the screen with the text "Touch me!" and enters an event loop to handle touch events.
Example 3: Displaying Graphics and Handling Touch Events (Arduino)
```c
#include <TFT_eSPI.h>
#include <WiFi.h>
WiFiClient client;
TFT_eSPI tft = TFT_eSPI();
void setup() {
  tft.begin();
  tft.setRotation(1); // Rotate the display 90 degrees
  tft.fillScreen(TFT_BLACK); // Clear the screen
  
  WiFi.begin("your_wifi_ssid", "your_wifi_password");
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to WiFi...");
  }
  
  Serial.println("Connected to WiFi");
  client.setServer("http://example.com/image.jpg", 80);
}
void loop() {
  int16_t x, y;
  uint16_t w, h;
  uint16_t data;
  
  // Download an image from the internet
  client.print("GET /image.jpg HTTP/1.1
");
  client.print("Host: example.com
");
  client.print("Connection: close

");
  
  // Read the image data
  uint8_t imageData[1024];
  int bytesRead = 0;
  while (client.available()) {
    bytesRead += client.read(imageData, 1024);
  }
  
  // Create a bitmap from the image data
  data = (uint16_t)imageData;
  tft.pushImage(0, 0, 320, 240, data);
  
  // Wait for touch events
  while (true) {
    if (tft.getTouch(&x, &y)) {
      Serial.println("Touch detected at (" + String(x) + ", " + String(y) + ")");
      // Handle touch event here
    }
  }
}
```
This example initializes the display, connects to a WiFi network, downloads an image from the internet, and displays it on the screen. It then enters a loop to wait for touch events and prints the touch coordinates to the serial console when a touch is detected.