Differing ESP32 Display boards

Development boards with TFT displays are effective and powerful IOT tools. Here are a few notes gained from working with two similar units, and the issues raised in moving applications between them.

The units at hand are the LILYGO ESP32 S2 T8 Display board, and the TTGO ESP32 T Display. To compare them:

TTGO T DisplayLILYGO S2
DisplayST7789 240x135px 1.14 inchST7789 240x135px 1.14 inch
Size51.52 x 25.04 mm65.48 x 26.025 mm
GenerationS2
(Must select ESP32 S2 board to compile)
Flash size4MB or 16MB4MB
SDCardCan be addedOnboard*
Battery supportYes, plug includedYes, plug included
SwitchesRST, 2 general usePower, RST, 1 General use
GPIO13 inc 7 touch24 inc 13 touch

The T Display is smaller and has fewer IO pins, lacks the SD card socket, but is 2/3 shorter. Performance is similar, but I have yet to run any tests apart from getting functionality and learning the “traps”.
Both connect via USB-C which is reassuring.

How good is the (unloved) ESP32 S2 ?

LILYGO S2 T8 Display


Getting this one going wasn’t easy.
Unlike the T-Display, there is very little information about this one apart from the manufacturer’s GitHub (which is useful), but there’s a distinct shortage of enthusiasts and projects !?

Using the ST7789 libraries all looked well but the screen remained stubbornly blank. The needs to be turned on (GPIO 33). Once settled, it’s a powerful board and despite the surprising lack of resources, does almost everything without complaint. My only reservation was in getting the SD card to cooperate with Bodmer’s TFT_eSPI library, however I am prepared to think that this is peculiar to my setup. Otherwise, as examples in dMeccano show, the results are brilliant. Powerful monitoring and useful display. Using wifimanager.h (my preferred wifi) is rock solid, and the battery support means that a small monitor can be made portable and inconspicuous. Files stored in LittleFS are reliably and quickly handled. I have broken the power switch on one of these, but it’s clearly not meant for regular use.

Programming the S2 means selecting the ESP32S2 board. This means having an up to date (or development) boards manager that includes support for S2.

Occasionally it stumbles at 921600 baud uploads but is happy with 460800 baud. Compile with PSRAM enabled.
Talking to the screen needs the following setup:
Define these in the code if using ST7789.h

TFT_CS    34
TFT_RST   38
TFT_DC    37
TFT_MOSI  35
TFT_SCLK  36
TFT_BL    33
// Turn on the Backlight:
void setup() {
  pinMode(33, OUTPUT);  
  digitalWrite(33, HIGH); 
.....
}

If using TFT_eSPI to control the screen, create a User_Setup.h (or selected option) that includes the above definitions. There’s no need to address the Backlight in this case, as TFT_eSPI does that.
As if to confirm it’s lack of popularity, the S2 is now proving hard to source.


Slightly quirky ESP32 T-Display ?

TTGO T-Display


Obviously not an S2 chip, and much loved compared with the S2. This board has many admirers and good online support.

In first use, it throws up a problem for OSX users, in that the comms protocol needs updating. This is evident when the Mac refuses to upload to the new port.
If this sounds like you, you’ll need https://github.com/WCHSoftGroup/ch34xser_macos to update the serial drivers.
Simple fix, but a “stone in the road”…

The same provisos apply regarding screen setups as S2 except the pinouts are different.
Define these in the code if using ST7789.h

// Screen settings for ESP32 T-Display
TFT_CS    5
TFT_RST   23
TFT_DC    16
TFT_MOSI  19
TFT_SCLK  18
TFT_BL    4
// Turn on the Backlight:
void setup() {
  pinMode(4, OUTPUT);  
  digitalWrite(4, HIGH); 
.....
}

Again, if using TFT_eSPI to control the screen, create a User_Setup.h (or selected option) that includes the above definitions. There’s no need to address the Backlight in this case, as TFT_eSPI does that.

The T display is a very powerful board. It is well supported, not expensive and available! Next project will be to add an SD card module.


Pin Reference for both variants

FunctionNotesTTGO-T-DisplayLILYGO S2 T8 Display
TFTTFT_BL433
TFT_CS534
TFT_MOSI1935
TFT_SCLK1836
TFT_DC1637
TFT_RST2338
TFT_MISO-1
SD CardI2C_SDA 21SD_CS 10
I2C_SCL 22SD_MOSI 11
RST 23SD_SCK12
SD_MISO 13
Get VoltageADC_EN14
ADC_PIN934
Button 10Reset..
Button 2350
Note that the S2 board has an SDcard interface onboard.
I2C reference for SDcard on T-Display is common usage.