AITEWIN ROBOT 2.8inch LCD TFT Module ESP32 Arduino LVGL

Contents

ESP32 LCD TFT Module User Manual

Models: 2.4 inch, 2.8 inch, 3.5 inch

1. Introduction

This manual provides instructions for setting up and programming the ESP32 LCD TFT Module. The module is available in 2.4, 2.8, and 3.5-inch variants, featuring an IPS resistive touch display. It integrates the ESP32 WiFi and Bluetooth chip, a dual-core 32-bit MCU with WiFi HT40 and Bluetooth/BLE 4.2 technology. The high-performance dual-core Tensilica LX6 MCU operates at 240 MHz, offering 600 DMIPS computing power, making it suitable for various standalone application developments.

ESP32 LCD TFT Module with menu interface
Figure 1: ESP32 LCD TFT Module with a sample menu interface.

2. Setup Guide

2.1. Installing Arduino IDE

To begin programming the ESP32 module, you will need the Arduino IDE. It is recommended to install version 1.8.19 or greater. You can download the installer from the official Arduino website. For Windows, a direct download link for version 1.8.19 is: https://downloads.arduino.cc/arduino-1.8.19-windows.exe

2.2. Adding ESP32 Boards to Arduino IDE

  1. Open the Arduino IDE.
  2. Click on the File menu in the top menu bar.
  3. Select Preferences to open the Preferences dialog box.
  4. Arduino IDE Preferences window
    Figure 2: Arduino IDE Preferences window.
  5. In the Preferences dialog, locate the textbox labeled Additional Boards Manager URLs.
  6. Paste the following link into the textbox. If there is existing text, add a comma before pasting: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
  7. Click OK to save the settings.
  8. Go to the Tools menu, then Board:, and select Boards Manager.
  9. Arduino IDE Boards Manager
    Figure 3: Arduino IDE Boards Manager window.
  10. In the Boards Manager search box, type esp32.
  11. Locate the entry for esp32 by Espressif Systems and click Install.
  12. Once installed, go to Tools > Board: and select ESP32 Dev Module.
  13. Arduino IDE Tools menu with ESP32 Dev Module selected
    Figure 4: Selecting 'ESP32 Dev Module' in Arduino IDE.
  14. Under Tools > Programmer, select esptool.

2.3. Installing TFT_eSPI Library

The examples provided for this module are based on the TFT_eSPI library, which supports various display driver chips (e.g., ST7735, ST7789, ILI9341, ILI9486, ILI9488). To install:

  1. In Arduino IDE, go to Sketch > Include Library > Manage Libraries...
  2. In the Library Manager, search for TFT_eSPI and click Install.
  3. Arduino IDE Library Manager showing TFT_eSPI library
    Figure 5: Installing TFT_eSPI library.

2.4. Configuring TFT_eSPI (User_Setup.h)

After installation, the TFT_eSPI library requires configuration specific to your screen type and driver chip. This involves modifying the User_Setup.h file within the library directory. The library location is typically C:\Users\<username>\Documents\Arduino\libraries\TFT_eSPI.

  1. Navigate to the TFT_eSPI library folder.
  2. Open User_Setup.h.
  3. Step 1: Modify the custom driver file. Comment out unused driver files and uncomment the one that matches your screen (e.g., ILI9341 for 2.8-inch).
  4. Step 2: Set width and height. Define TFT_WIDTH and TFT_HEIGHT according to your display's resolution (e.g., 240x320 for 2.8-inch).
  5. Step 3: Pin definition. Define your specific pins for MISO, MOSI, SCLK, CS, DC, RST, and TOUCH_CS/IRQ. For example, for ILI9488 320x480 display with XPT2046 touch: TFT_MISO = 12, TFT_MOSI = 13, TFT_SCLK = 14, TFT_CS = 15, TFT_DC = 2, TFT_RST = 27, TOUCH_CS = GPIO33, TOUCH_IRQ = GPIO36.
  6. Step 4: Turn on Backlight Pins. Define TFT_BL and TFT_BACKLIGHT_ON_HIGH as needed.
User_Setup.h code snippet for TFT_eSPI configuration
Figure 6: Example configuration in User_Setup.h.

2.5. Copying lv_conf.h

If you are using LVGL, ensure the lv_conf.h file is placed in the root directory of the TFT_eSPI library.

File explorer showing lv_conf.h and User_Setup.h
Figure 7: Location of lv_conf.h and User_Setup.h.

3. Operating Instructions

3.1. First Program Example

After setting up the Arduino IDE and libraries, you can upload your first program. A simple example to test the setup is to print "hello from ESP32" to the Serial port every second. Remember to reset the power of the device after uploading a new program to ensure it enters flashing mode again.

3.2. Basic Display Settings

The TFT_eSPI library provides functions for basic display control:

  • tft.init();: Initializes the screen.
  • tft.fillScreen(TFT_BLACK);: Fills the entire screen with a specified color (e.g., black).
  • void setRotation(uint8_t r);: Sets the screen rotation angle (0, 1, 2, or 3 for 0°, 90°, 180°, 270°).
  • tft.invertDisplay(bool i);: Inverts display colors (true for invert, false for normal).

Functions for displaying text on the screen:

  • void setCursor(int16_t x, int16_t y, uint8_t font);: Sets the text display coordinates and font.
  • void setTextColor(uint16_t fgcolor, uint16_t bgcolor);: Sets foreground and background text colors.
  • void setTextSize(uint8_t size);: Sets text size (1 to 7).
  • tft.print("Hello World!");: Prints text to the screen.
  • int16_t drawString(const String &string, int32_t x, int32_t y, uint8_t font);: Draws a string (left-aligned).
  • int16_t drawCentreString(const char * string, int32_t x, int32_t y, uint8_t font);: Draws a string (centered).
  • int16_t drawRightString(const char * string, int32_t x, int32_t y, uint8_t font);: Draws a string (right-aligned).
  • int16_t drawChar(uint16_t uniCode, int32_t x, int32_t y, uint8_t font);: Draws a single character.

3.4. Drawing Geometric Figures

The library supports drawing various shapes:

  • void drawPixel(int32_t x, int32_t y, uint32_t color);: Draws a single pixel.
  • void drawLine(int32_t xs, int32_t ys, int32_t xe, int32_t ye, uint32_t color);: Draws a line.
  • void drawFastHLine(int32_t x, int32_t y, int32_t w, uint32_t color);: Draws a horizontal line.
  • void drawCircle(int32_t x, int32_t y, int32_t r, uint32_t color);: Draws a hollow circle.
  • void fillCircle(int32_t x, int32_t y, int32_t r, uint32_t color);: Draws a filled circle.
  • void drawRect(int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color);: Draws a hollow rectangle.
  • void fillRect(int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color);: Draws a filled rectangle.
  • void drawTriangle(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t x3, int32_t y3, uint32_t color);: Draws a hollow triangle.
  • void fillTriangle(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t x3, int32_t y3, uint32_t color);: Draws a filled triangle.

Functions for displaying images:

  • void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t fgcolor, uint16_t bgcolor);: Displays a BMP picture.
  • void drawXBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t fgcolor, uint16_t bgcolor);: Displays an XBM (X BitMap) image.
  • void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint16_t *data, uint16_t transparent);: Pushes image data to the display, with optional transparency.
Display showing a game stats screen
Figure 8: Example of a game stats screen displayed on the module.
Display showing a dashboard with time and temperature
Figure 9: Example of a dashboard interface.

4. Maintenance

To ensure the longevity and optimal performance of your ESP32 LCD TFT Module, keep it clean and dry. Avoid exposing it to extreme temperatures, humidity, or direct sunlight. Handle the module with care to prevent physical damage to the screen or components.

5. Troubleshooting

  • Upload Issues: If a new program fails to upload, ensure you reset the power of the device to enter flashing mode.
  • No Output on Serial Console: If you don't see expected output, check your serial monitor settings (baud rate) and ensure your code is correctly initializing the serial port.
  • Setup Difficulties: The initial setup, especially pin identification and library configuration, can be challenging. Refer to the detailed steps in the Setup Guide and ensure all pins are correctly defined in User_Setup.h.
  • Touch Screen Unresponsive: If the touch functionality is intermittent or fails, verify the touch controller pin definitions (e.g., TOUCH_CS, TOUCH_IRQ for XPT2046) and check for any software loops that might interfere.
  • Firmware Compatibility (3.5-inch): Some users have reported that not all firmware works seamlessly with the 3.5-inch screen. Ensure you are using firmware and libraries compatible with the specific driver chip of your 3.5-inch module.
  • Incorrect Display/Colors: Verify the display driver chip (e.g., ILI9486 for 2.8-inch, ILI9488 for 3.5-inch) and ensure it is correctly selected in User_Setup.h.

6. Specifications

FeatureDescription
Brand NameAITEWIN ROBOT
Model Number2.8inch LCD TFT Module ESP32 Arduino LVGL
Display Sizes2.4 inch, 2.8 inch, 3.5 inch
Display ModeIPS Resistive Touch
Resolution320*240 (common, specific to model variant)
Main ChipESP32 (Dual-core 32-bit MCU, Tensilica LX6)
ConnectivityWiFi HT40, Bluetooth/BLE 4.2
CPU Frequency240 MHz
Computing Power600 DMIPS
Supported DriversST7735, ST7789, ILI9341, ILI9486, ILI9488 (depending on model)
Touch ControllerXPT2046 (common)
OriginMainland China
Package Dimensions16cm (L) x 14cm (W) x 3cm (H)
Package Weight0.088 kg
2.4 inch ESP32 LCD TFT Module with accessories
Figure 10: 2.4 inch module with included accessories.
2.8 inch ESP32 LCD TFT Module with accessories
Figure 11: 2.8 inch module with included accessories.
3.5 inch ESP32 LCD TFT Module with accessories
Figure 12: 3.5 inch module with included accessories.

7. User Tips

  • Viewing Angles: Be aware that color fidelity can be angle-dependent. For example, some colors might appear different when viewed from the side, especially near the USB-C connector.
  • Pinout Clarity: The setup process can be complex due to varying pin identifications. Double-check all pin connections and configurations in the User_Setup.h file.
  • Firmware for 3.5-inch: If you are using the 3.5-inch version, note that some firmware might not be fully compatible. Experiment with different firmware versions or consult community resources for specific recommendations.
  • Creative Applications: These modules are versatile for projects like displaying images in a Lego city, creating custom dashboards, or developing interactive interfaces.
  • Seller Support: If you encounter programming difficulties, the seller may provide additional guidance.

8. Frequently Asked Questions (FAQ)

Q: Is the Marauder software available for 3.5 inches?
A: Compatibility with specific third-party software like Marauder for the 3.5-inch display may vary. Please check the software's documentation or community forums for support for this specific display size.
Q: What resolution does the 3.5-inch display have?
A: The resolution for the 3.5-inch display is typically 320x480 pixels, though it's always best to confirm with the specific product variant's specifications or by checking the display driver chip (e.g., ILI9488).
Q: Is it available without the ESP32 module?
A: This product is sold as an integrated module with the ESP32. Individual display panels without the ESP32 module may be available from other suppliers, but this specific product includes the ESP32.
Q: Which kind of connector do we need to connect a speaker, microphone, or sensor?
A: The module provides various GPIO resources from the ESP32 chip. You would typically use standard jumper wires or custom PCBs to connect external components like speakers, microphones, or sensors to the available GPIO pins. Refer to the ESP32 pinout documentation for details on specific pin functions (e.g., I2S for audio, ADC for analog sensors).

9. Warranty and Support

For warranty information, technical support, or any product-related inquiries, please contact the seller directly through the platform where you purchased the module. They can provide assistance with specific issues, returns, or replacements according to their policies.

A PDF version of the user manual is also available for download: User Manual (PDF)

Documents and downloads

Ask a question about this manual

Ask about setup, troubleshooting, compatibility, parts, safety, or missing instructions. Manuals+ will review the question and use this page’s manual context to help answer it.

After a successful submission, we securely hash the supplied account or form email before sending it to Microsoft Advertising for conversion attribution. Privacy details.

Rate this product if you’ve used it

Was this page helpful?