LilyGO TTGO T-Display: ESP32 with TFT LCD
|
Development boards with ESP32 microcontrollers come in countless variants today. For example, we already looked at the M5StickC, ESP32-CAM, and TTGO T-Journal. In this blog, we look at the LilyGO TTGO T-Display. On this board, the ESP32 is combined with a 240×135 pixel IPS TFT display and a 3.7V battery charging circuit.


LilyGO TTGO T-Display and the Arduino IDE
You can program the LilyGO TTGO T-Display with the Arduino IDE. For this, you need to have the IDE installed together with the ESP32 core for the Arduino IDE. How to do this can be found in the blog “ESP32 with Arduino IDE on Linux and Windows“. In brief:
-
- Download and install the Arduino IDE. For more information, you can read the blogs “Installing the Arduino IDE on Windows 10” or “Install or upgrade to the latest Arduino IDE on Linux“.
- Start the IDE and open “Preferences” via menu File > Preferences.
- Enter this URL in the “Additional Board Manager URLs” field:
https://dl.espressif.com/dl/package_esp32_index.json
- Open “Boards Manager” via menu Tools > Board > Board Manager and install the esp32 platform.
If the above is successful, select the board “ESP32 Dev Module” from the Tools > Board menu.
Arduino libraries
To use the display and the two components on the T-Display, you also need to install two libraries in the Arduino IDE:
You can download the libraries from GitHub or install them with the ‘Library Manager’ from the Tools > Manage Libraries menu.
LilyGO TTGO T-Display Select Settings
Finally, you must activate the correct display in TFT_eSPI by changing the default setting to TTGO T-Display.
In the file TFT_eSPI/User_Setup_Select.h
change this line:
#include <User_Setup.h>
to:
//#include <User_Setup.h>
and change this line:
//#include <User_Setups/Setup25_TTGO_T_Display.h>
to:
#include <User_Setups/Setup25_TTGO_T_Display.h>
GPIO and pin mapping
The various parts on the development board use the following pins:
Function | Pin | Function | Pin |
---|---|---|---|
BUTTON1 | 35 | TFT_MOSI | 19 |
BUTTON2 | 0 | TFT_SCLK | 18 |
I2C_SDA | 21 | TFT_CS | 5 |
I2C_SCL | 22 | TFT_DC | 16 |
ADC_IN | 34 | TFT_RST | 23 |
ADC Power | 14 | TFT_BL | 4 |
In summary, the pin mapping looks like this:


This image and more information can be found at https://github.com/Xinyuan-LilyGO. There you can also find the demo sketch that is standard on the T-Display.




Downloaded https://dl.espressif.com/dl/package_esp32_index.json and it does not have the board “ESP32 Dev Module” included but it does have “ESP FM DevKit” and “TTGO T-Watch”. Tried the TFT_Clock_Digital example which hung on upload with ESP FM DevKit, loads and verifies with TTGO T-Watch but gives a blank display and no response to buttons or touch.
I managed to get ESP Dev Module included when I downloaded the file from github.
TTGO-T1 is not usable as card type ?
Trying to get my TTGO back to the factory program but it’s not working. I followed your instructions as written.
It uploads successfully but then all I get on the display is a backlit black screen. Nothing else shows up. I can open the Serial Monitor and the buttons do what they’re supposed to (voltage reading, network scan, reset info) but nothing on the TFT. Pulling my hair out!! Any help would be appreciated.
Thanks,
Dan
You can follow this tutorial it worked for me after modifying the header file.
Hi have problems reading external temperature sensors. I’ve done tests with DHT22 with pull-up resistor and checked cabling and software, but nothing. I dubt i’m missing something on port selection or software configuration.
Any suggestion?