LILYGO ESP32 T-Display-S3 Development Board
$27.95 – $29.95
32-bit processor, WiFi /Bluetooth and 170×320 color display.
Description
The LILYGO ESP32 T-Display-S3 Development Board is a powerful 32-bit 240MHz processor with a large 16MB Flash program memory. It incorporates a 1.9″ full color LCD, 2 user buttons and has WiFi and Bluetooth capability. It packs a lot of power and functionality in a very small package.
PACKAGE INCLUDES:
- LILYGO ESP32 T-Display-S3
- Qty 2 – 1×12 male header pins (Optionally soldered on)
- JST 1.25mm 2-pin battery cable
KEY FEATURES OF LILYGO ESP32 T-DISPLAY DEVELOPMENT BOARD:
- Microcontroller: ESP32-S3R8 Dual-core LX7 32-bit
- Clock Speed: 240MHz
- USB Connector: USB-C
- Flash Memory: 16 MB
- RAM: 512Kb
- PSRAM: 8MB
- Display: 170 x 320 full color 1.9″ ST7789V TFT LCD. 8-bit parallel interface. Acrylic cover plate
- Digital I/O: 13
- PWM: 9 channels
- Analog Inputs: 10 channels, 12-bit
- Communications: Serial, SPI, I2C
- Connector Support: STEMMA QT / Qwiic JST-SH 1.0mm 4-pin
- Battery Voltage: GPIO04
- Integrated Sensors: IR remote, Hall sensor, temperature sensor, touch sensors, pulse counter, LNA
- Bluetooth: BLE 5 (Bluetooth Low Energy) + BT Mesh
- WiFi: 802.11 b/g/n 2.4GHz
- Buttons: 2 user programmable buttons GPIO0 and GPIO14 + Reset
- Programming: Compatible with Arduino IDE or Micropython
- Pin Spacing: 0.1″ pin to pin x 0.9″ row to row. Breadboard compatible with pins installed.
- Operating Voltage: 3.3V internal power and I/O.
- Power Source: 5V USB, 5V VIN pin, 3.7V lithium battery
The ESP32 based T-Display-S3 is a very flexible IOT board with significant processing power. It provides 16 MB of Flash memory for program space and runs at clock speeds of 240 MHz so has a fast processing speed. Because it incorporates an LCD for user feedback and has 2 buttons for user input, it can function as a complete little standalone system right out of the box simply by connecting it to a USB cable. Because of its WiFi and Bluetooth capabilities, it can also be used as a peripheral device in conjunction with another MCU just to provide WiFi, Bluetooth or other unique capabilities that it has.
With the pins installed, the 24-pin board is breadboard compatible and will leave one row of open contacts on each side of the board for making jumper connections. Be sure when using with a solderless breadboard to insert the T-Display-S3 into the breadboard by pressing on the pins and ends of the module and do not press directly on the LCD or damage could result. The USB end of the module with connectors on the bottom should overhang the end of the breadboard for clearance.
An enclosure shell is available for packaging the T-Display-S to help ruggedize it a bit. The enclosure provides access to the user buttons, reset button and has room for a battery of approximately 50 x 20 x 8mm in size. It works with pins installed or not.
If you already have your T-Display-S3 module in hand and are in a hurry to checkout it out , you can just plug it into a USB-C cable and it should come up and run the factory test application. It shows an animated graphic, then scans for WiFi networks and then attempts to connect to the LILYGO WiFi network, which it won’t be able to do and eventually times out. We tell you how to get past that down toward the bottom of the page in the Testing the T-Display-S3 Module section.
A good introduction video for the LILYGO T-Display-S3 module can be found here: https://www.youtube.com/watch?v=j8THAc1sMww
LEARNING ABOUT THE LILYGO T-DISPLAY-S3 MODULE
These are great little modules but information can be difficult to come by. We’ll cover some of the basics next to make it easier to get started.
Display Characteristics
The display is a 1.9″ IPS TFT LCD with a resolution of 170 x 320. It has an acrylic mount to help support the display and provide a more integrated package than on the base T-Display module.
Unlike most displays, this one uses an 8-bit parallel bus, so it has the potential for very fast graphic updates. The pins used to drive the LCD are dedicated and are not brought out to the edge of the module.
The display uses the ST7789V driver and is supported by the TFT-eSPI library and is also compatible with the LVGL library.
Pin Map for the T-Display-S3
One of the main limitations of the module for some applications is the relatively small number of I/O pins, but the ESP32 chip allows most of the I/O such as the serial ports, SPI and I2C to be multiplexed to any of the other GPIO pins for maximum flexibility.
This diagram shows how the pins are used on the T-Display-S3 module. Note that some pins are used internally for driving the LCD display and as inputs for two user buttons. Those pins are not brought out to the main header pins leaving 16 pins available for the user.
Digital I/O
There are 13 GPIO on the board that are brought out to the header pins. The pins are labeled GPIOx. When using with Arduino IDE, the digital pin number is the same as the GPIO pin number, so GPIO2 is referenced as just ‘2’.
All of the digital I/O support interrupts. In addition they can be configured to have pull-up or pull-down resistors. 9 of the pins support hardware PWM.
There are 3 pushbuttons included on the board. The two on top of the module are user programmable buttons on GPIO0 and GPIO14 which do not come out to the pins on the edge of the board. A third button on the side is a standard reset button that resets the ESP32 microprocessor.
Unlike some other development boards, the T-Display-S3 does not have a user controllable LED on any of its pins, but then again it has a complete display, so take that Arduino!
The digital I/O is limited to 3.3V. If using with 5V logic inputs, logic level translators must be used to prevent possible damage.
Analog I/O
Analog to Digital Converters
There are two 12-bit analog-to-digital converters (ADC1 / ADC2) on the ESP32. One or both of the A/D converters can be multiplexed across up to 10 input pins on this module. As with all the I/O pins, the analog inputs are limited to a voltage range of 0-3.3V. Higher voltages can damage the module
12-bit resolution provides readings in the range of 0-4095. The resolution of the A/D converters can be changed to a lower bit depth of 9-12 bits if desired. As with many high performance microcontrollers that have built in A/D converters on the same substrate, some amount of digital noise tends to get into the analog readings. Using a lower bit depth can help to reduce the impact of digital noise since the individual reading steps are larger.
Keep in mind that the A/D converters don’t have a completely linear behavior at the extreme ends of their range. If measuring a 0 to 3.3V voltage range, it may not be possible to differentiate between 0.0V and 0.1V or 3.2V and 3.3V so keep that in mind when interpreting the readings.
The ADC2 converter cannot be used when WiFi is also being used, in that case ADC1 should be used.
Internally GPIO4 is connected to the battery voltage and can be used to monitor the voltage level. It is connected via a divide by 2 resistor circuit, so the measured value will need to be multiplied by 2. When USB power is connected, this pin will measure the USB voltage, not the battery voltage.
Communication Buses
The module has the standard built-in buses and in many cases arbitrary GPIO pins can be assigned to those buses.
I2C
I2C is a common 2-wire bi-directional bus with a data line (SDA) and a clock line (SCL).
The default I2C is on GPIO 43 (SDA) and GPIO 44 (SCL) and these are available on the main pins as well as on the small STEMMA QT / Qwiic JST 4-pin connector along with 3.3V power and ground. These pins can also be repurposed to other functions such as serial TX/RX.
You can define the pins to use for I2C by using the command Wire.begin(SDA, SCL); where SDA and SCL are the pin numbers to use.
I2C requires pullup resistors to work properly. If the attached module does not have 2.2K – 4.7K pullups to 3.3V, they should be added to the SDA and SCL pins. 10K pullups may work OK for slower I2C communications.
SPI
SPI is a common 4-wire unidirectional bus which can support higher speeds than the I2C bus and often used for displays, SD cards or other modules that can benefit from a high data transfer rate.
A default SPI bus is available on pins 10, 11, 12 and 13.
To assign other pins as an SPI bus, the following code snippet can be used for guidance. In this example, the SPI bus is subsequently used to interface with an SD card and we are using GPIO pins 16, 17, 18 and 21.
#include "SD.h" #include <SPI.h> SPIClass SPI1(HSPI); #define MY_CS 16 #define MY_SCLK 21 #define MY_MISO 18 #define MY_MOSI 17 void setup() { SPI1.begin(MY_SCLK, MY_MISO, MY_MOSI, MY_CS); pinMode(MY_CS, OUTPUT); //Assuming use of SPI SD card if (!SD.begin(MY_CS, SPI1)) { Serial.println("Card Mount Failed"); } else { Serial.println("Mounted SD CARD"); } }
UART Serial
A default serial bus is brought out on pins 17 (TXD) and 18 (RXD).
Other pins can be assigned to serve serial duty by using a command such as the following to assign a RX and TX pin to use for a serial port. Serial.begin(9600, SERIAL_8N1, RX_PIN, TX_PIN);
WiFi / Bluetooth
As with all ESP32 processors, some level of WiFi and Bluetooth capability is included. The two functions are mutually exclusive e.g. you can use either one, but not both concurrently. You can however switch between them within the same application.
The Bluetooth is BLE 5 + BT mesh. BLE 5 (Bluetooth Low Energy) is a fairly new version of Bluetooth introduced in 2017. It is targeted toward low power applications like IoT. BT mesh refers to the ability to use Bluetooth in a mesh network with multiple nodes.
WiFi is the standard 802.11 b/g/n 2.4GHz. It uses the built-in PCB trace antenna by default. The module does have the capability to use an external antenna instead. It does require a small surface mount resistor to be moved to disconnect the PCB antenna and connect to the external antenna. The benefit of using an external antenna has not be evaluated.
Powering the Board
Internally, the board operates on 3.3V. A green LED lights when 3.3V is operational on the board.
There are four ways to provide power to the board as outline here. Note that there are some interdependencies as detailed down below.
- 5V applied to the USB-C port through the USB cable
- 5V applied to the 5V VIN pin
- 3.3V applied to the 3.3V pin
- 3.7V Lithium battery applied to the 2-pin JST connector
5V USB Power
Applying power through the USB cable is the first and most common way to power this board. With USB 5V connected via a USB-C cable the following is true:
5V (VIN) pin has 5V (4.8V nominal) on it and can be used to power other 5V circuits.
3.3V pin has 3.3V output power on it supplied by an AP2112K-3.3V regulator and could be used to power other 3.3V circuits. This 3.3V is also powering the on-board circuitry, so you should not pull too much power off this pin. Perhaps 250mA max, but it depends on how the T-Display is being used. Something like WiFi transmit for example takes more power than just running the LCD.
The 5V USB power is also fed to a TP4054 battery charger circuit that outputs 4.2V to the 2-pin JST connector. This can be used to charge any Lithium battery that may be connected. Having both 5V USB and battery power connected at the same time is fine. When USB cable is connected, the battery is charging and when the USB cable is disconnected, the module will continue to run on the battery power.
5V (VIN) Pin Power
With power applied to the 5V (VIN) pin of the module, the following is true:
The 3.3V pin has a 3.3V output on it.
The JST battery connector has 4.8V on it. Basically the 5V pin is connected directly to the battery, so using 5V VIN power is NOT compatible with also using a battery.
The 5V VIN pin is most commonly used when the module is embedded into a larger system.
There is a blocking diode from the 5V VIN power pin to the 5V USB power on the module. If a USB cable is connected, this will help to provide partial protection for the USB power coming from the computer. If it is planned to use both the 5V VIN pin to power the module and also connect the 5V USB power at the same time, such as to reprogram the module, a diode should be inserted between the 5V VIN pin and its 5V power source with the cathode of the diode facing towards the 5V VIN pin as shown on the left below. This ensures that neither power source can back feed current into the other power source. Whichever power source has the higher voltage will power the T-Display-S3 module. The diode can be a Schottky diode or a regular silicon rectifier type diode.
3.3V Pin Power
If 5V power or battery power is not being used on the module, the 3.3V pin can be used to power the module by applying a 3.3V source as an input.
This will put 3V on the 5V pin and the battery connector, so is not compatible with also using those connections. Using this method of powering the module is not recommended unless it is being embedded into a system where only 3.3V power is available.
3.7V Lithium Battery Power
While 3.7V is the nominal battery voltage, the actual battery voltage may range from 4.2V when fully charged down to about 3V. Most batteries will have a over-discharge cutoff circuit built-in. In our test example, the module ran OK down to 2.95V at which point the battery over-discharge circuit cut the battery output off.
The Battery connector is a 1.25mm 2-pin JST style which is very small. A pigtail cable is included with your module so if you have a battery with a larger connector, you can cut and splice on the smaller connector. Higher capacity batteries will tend to have larger connectors. Smaller batteries in the 100mAh range can be found with the small 1.25mm connector if you don’t want to mess with cutting and splicing. Be sure to observe proper polarity as shown here as the polarity of the battery connector may not necessarily match the LILYGO wiring.
If you have a battery with the large 2.54mm JST style connector, for experimenting to make it easy to connect/disconnect, a standard 2-pin header pin can be soldered to the 1.25mm pigtail cable to create a plug-in connection as shown here.
When working with battery power in your own program, be sure to enable battery power, GPIO15 (PWR EN) by setting it HIGH in your program as shown here.
#define PIN_POWER_ON 15 // LCD and battery Power Enable setup () pinMode(PIN_POWER_ON, OUTPUT); //triggers the LCD backlight digitalWrite(PIN_POWER_ON, HIGH);
If 3.7V battery power is applied to the JST battery connector, the 3.3V pin will have 3.3v output power and the 5V pin will have the 3.7V battery power on it. As the battery voltage droops, so will 5V pin and eventually the 3.3V output will also start to droop.
If 5V USB power is then connected, the JST battery connector has 4.2V applied to it through a TP4065 battery charging IC and the battery goes into a charging state. If the USB power is then removed, the battery will continue to power the module.
With USB power connected and no battery, the small red LED flashing quickly (which makes it look dim) indicates that the battery is not connected. If a battery is connected along with USB power, the LED will turn steady on (brighter red) indicating that the battery is charging. If the USB power is then removed, the red LED will go out, but the green 3.3V power LED will remain lit as long as battery power is available to power the module.
Operating current is about 80-90mA under normal operation and the maximum current draw is approximately 300mA when transmitting WiFi.
To conserve battery power and maximize battery life, the T-Display-S3 module can be placed into various low power sleep modes. The operating frequency of the CPU can also be lowered from the default 240MHz to something lower such as 80MHz if the full processing power of the module is not required for the application.
Important Note: Using a battery with the T-Display-S3 module is only compatible with also using the 5V USB power. A battery cannot be used when powering the module using either the 5V VIN pin or 3.3V pin.
Another Important Note: The battery charging current is set to a maximum of 580mA. When selecting a battery, be sure that it is compatible with at least that amount of charging current or it has its own built-in current limiting circuit.
Selecting a Battery
The key points to keep in mind when selecting a battery are these:
Battery Connection: Select a battery with the 1.25mm JST connector unless you are OK with cutting and splicing a smaller connector on.
Battery Capacity: The larger the capacity (mAh rating), the longer the battery will be able to supply power to the T-Display-S3. With a larger capacity also comes a larger physical size and a larger JST connector, so there are tradeoffs to be made in that regard. Smaller batteries of around 100mAh can be found with the 1.25 connector already installed. Higher capacity batteries will usually have 2.0 or 2.54mm JST connectors.
Battery Charge Rate: Since the T-Display-S3 is configured to provide up to 580mA of charging current, ensure that the battery can either handle that maximum charge rate or has its own built-in current limiting circuit to prevent overcharging the battery.
Battery Physical Size: This largely depends on whether you want to fit the battery into the optional enclosure. A battery of 50mm x 20mm x 7mm will fit snug and is what we are using here. It happens to have a capacity of 800mAh and a large 2.54mm JST connector. This size will also fit in the enclosure if the module has the pins installed.
Adding Pins to the T-Display-S3
The T-Display-S3 is a little different than most microcontroller development boards. Whether you want pins installed or not will depend on how you plan to use the board. Since it already includes a display and a couple of pushbuttons, many things can be done with it without hooking up anything to the pins and if installed into the enclosure, it makes a nice tidy little assembly.
If pins are installed, the T-Display-S3 can be installed into a solderless breadboard to make various I/O connections.
To install pins yourself, it is easiest to first insert them into a solderless breadboard to hold them in alignment. Insert the pins at the end of the breadboard so that the connectors on the bottom side of the T-Display-S3 can hang over the edge to let the T-Display-S3 seat fully down on the header pins.
To solder the pins, it is recommended to use no-clean flux solder. Attempting to clean the flux using something like IPA (isopropyl alcohol) can allow the liquid to wick under the LCD/acrylic and cause visible artifacts in the display. These may or may not go away after some period of time.
The acrylic covers the tops of the pins, so they must be soldered from the side which is a little awkward. To avoid this, you can order the version that already has pins installed.
If it is installed into the enclosure, the enclosure has slots in the back but the pins do not extend through. It does make it possible to use female jumper wires to attach to the pins to make connections. It can of course also be removed from the enclosure to work with it on a breadboard.
Programming the T-Display-S3
Important Note: This module uses the USB Type-C style connector like is used on cell phones. Make sure you have a standard USB type-A to USB-C cable that includes the data lines. Cables supplied with cell phones are usually charge only cables and do not have the required data lines. Usually called a ‘data cable’ or ‘sync cable’. The correct data cable can be ordered at the bottom of this page if needed.
On Win11 no special driver was required to be installed. This is how the board will look in the Windows Device Manager window. The ‘COM12’ will vary.
The board can be programmed in C/C++ using the Arduino IDE and is how the modules are most often used. The steps below show how to setup the Arduino IDE for the LILYGO displays. It assumes you already have the Arduino IDE installed. If the IDE is not installed, it can be downloaded from here: https://www.arduino.cc/en/software
There are many instructions for installing and using ESP32 based boards with the Arduino IDE, but here is a short version. In this case we are using IDE 2.x but IDE 1.8 works similarly.
1. Open the IDE File/Preferences window and in the Additional Board Manager URLs field enter the following: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json. If you already have links for other additional boards loaded, just open the window and add it as a new line to the existing list as shown here.
Click OK to close the window and close and restart the IDE.
2. Under Tools/Boards/Boards Manager, you can now find and install “ESP32 by Espressif Systems” as shown below. The current version as this is written is 3.03, but it does not work correctly with the T-Display-S3. Instead, install the 2.0.17 version. If you already have a newer version loaded, just hit REMOVE and then select an older version like 2.0.17 and hit INSTALL. Important note: If you don’t run a version under 3.x, you will get a GPIO compiler error.
3. Under Tools/Boards/ESP32 you can now select “LilyGo T-Display-S3“.
4. While you are messing around with the IDE, you will want to go ahead and install 2 main libraries for working with the T-Display-S3 Touch Screen and for compiling and running the example software. TFT_eSPI by Bodmer which is used to handle the built-in display and Button2 by Lennart Hennigs which is used to handle the two user buttons in some of the examples.
TFT_eSPI – Use the Library Manager to download the TFT_eSPI library to the Arduino default library location. Install the latest version.
Once the TFT_eSPI library is downloaded, locate the the User_Setup_Select.h file in the TFT_eSPI library folder and open it in a text editor like Notepad. You are going to modify this file to so the software knows knows that we are working with the T-Display-S3 module.
Comment out #include <User_Setup.h> on line 27 as shown here: //#include <User_Setup.h> // Default setup is root library folder
Uncomment //#include <User_Setups/Setup206_LilyGo_T_Display_S3.h> on about line 133 as shown here: #include <User_Setups/Setup206_LilyGo_T_Display_S3.h>
Then save the file.
Important Note: Keep in mind that if you do a library update in the future, it will overwrite this file, so you may need to go back and edit it again. The symptom when this is not correct is that the program will compile, download and run, but the display will be black.
5. Select LilyGo T-Display-S3 under Tools / Board.
Make sure the T-Display-S3 is plugged into the USB and select the port that the board is attached to. In my case it happened to be COM12.
Here is what the Tools menu looks like on my setup. Note that when the LilyGo T-Display-S3 board type is selected in the IDE, there are many more items added to the Tools drop down menu. To get started make sure your configuration matches what is shown below. The USB CDC On Boot: Enabled for instance allows the LILYGO to use USB for serial print commands. If you are going to later use the module with external 5V power instead of USB, you should change this to ‘Disabled‘ or else the module will wait forever for USB access.
Testing the T-Display-S3 Module
To test whether the board is basically working, plug the board into the USB and it should power up and display a logo screen. Then it will scan for Wifi networks and then attempt to connect to the LILYGO manufacturing WiFi network at which point it will stop since it is unable to do so.
Fortunately, Espressif (the mfr of all things ESP32) has a little phone app called ESPTouch to come to the rescue. It acts as a bridge between your ESP32 device and your local WiFi network. It allows devices such as this that have not been specifically programmed to access your network, to do so in a temporary fashion.
In your favorite phone app store, download the ESPTouch app and open it. Select ESPTouch (not ESPTouch V2) on the next screen and you will see a screen that looks similar to below, but may look a little different depending on if you have an Android or Apple phone. Enter your WiFi password and then select ‘Multicast’ and press ‘Confirm’.
A dialog box will come up once connection is made and just select OK. Once the T-Display-S3 establishes a WiFi connection, it will move on in the program and display a clock. The time shown will be pulled off the internet and will show the current time in China were the module was manufactured.
Pressing the bottom button will cause it to draw the LILYGO logo. Pressing the bottom button a second time will bring up a system information screen showing the chip type, PSRAM size, Flash size, whether an SD card is found and the power voltage level.
Downloading Software to the T-Display-S3
When the T-Display-S3 is selected in the IDE, many example programs are available. To play around with some quick graphic examples, use the TFT_eSPI examples since they will utilize the display. Most should run basically correctly. Examples that use a different LCD resolution other than the 170 x 320 on this module should still run though the image may be chopped off or otherwise be incorrect.
A fun program to see some of the graphic capabilities is the PokerS3 application which is designed for this specific display. It is not available in the examples, but a video explaining it and a link to download the software can be found here.
To run PokerS3, you will need to download the library OneButton.h in the library manager if you have not already installed it.
If you get into a mode where the USB port that the LILYGO is attached to cannot be found, you can manually enter upload mode using the following steps:
- Connect the module using the USB cable.
- Press and holding the BOOT button. It is the top mounted button near the Reset button
- Press and release the Reset button on the side of the module
- Release the BOOT button,
- Upload the sketch.
This can be necessary if you write a program that ties up the processor so it can’t service the USB or you are running a program that disables the USB.
Before they are shipped, these modules are:
- Power-up tested to verify factory software runs OK and display works correctly
Notes:
- None
Technical Specifications
Microcontroller | ESP32-S3R8 Dual-core LX7 32-bit |
Operating Voltage | 3.3V |
Input Power | 5V or 3.7V Lithium Battery |
Digital I/O Pins | 13 (4 input only) |
PWM I/O Pins (Shared with Digital I/O) | 9 |
Analog Input Pins | 10 (12-bit) |
Analog Output Pins (DAC) | None |
DC Current per I/O Pin | 10-40mA depending on total chip loading |
Hardware Serial Ports (UARTS) | 1 or more |
I2C Ports | 1 or more |
SPI Ports | 1 or more |
Touch Sensor Inputs | 7 |
Flash Memory | 16 MBytes |
ROM | 384 KBytes |
SRAM | 512 KBytes |
PSRAM | 8 MBytes |
Clock Speed | 240MHz (default) |
Network | 802.11 b/g/n 2.4GHz |
Bluetooth | BLE 5 |
USB Connector Style | USB Type-C Female |
Board Dimensions (L x W x H) | 62 x 26mm x 10 (2.44 x 1.02 x 0.39″) |
Pin Spacing (row-to-row) | 22.86mm (0.9″) |
Country of Origin | China |
Schematics (Down rev, shows CP2014 USB) | T-Display-S3 Schematic |
ESP32 Datasheet T-Display uses ESP32-DOWDQ6 chip | ESP32-S3 |
FURTHER READING
VOLOS Projects – Youtuber with very useful information and projects using the LILYGO products.
Randomnerdtutorials – Very good generic ESP32 reference information with lots of examples that can be adapted to the T-Display-S3
LILYGO T-Display Github – Alternate source for TFT-eSPI library if you have issues with Bodmer’s version. Also has some useful troubleshooting information under the ‘Issues’ list