Free wiring guides
Wire the ST7789 2.0 in TFT screen to the ESP32-S3
TFT colour screen, 2.0 in, ST7789, 240×320, SPI. A wider screen for rows of numbers.
When buying: Buy the 8-pin version, which has a CS pin.
Which pin goes where
| On the part | On the ESP32-S3 |
|---|---|
| GND | GND |
| VCC | 3V3 |
| SCL | GPIO 12 |
| SDA | GPIO 11 |
| RES | GPIO 14 |
| DC | GPIO 13 |
| CS | GPIO 10 |
| BLK | leave unconnected |
Wire it with the USB cable unplugged. Follow the names printed on your own part: makers sometimes reorder the pins.
In 3D
Example sketch
// TFT colour screen, 2.0 in, ST7789, 240×320, SPI
// on the ESP32-S3-DevKitC-1 (N8R2 or N16R8)
// https://stem.manusignal.com/en/parts/st7789-2-inch-tft-esp32-s3
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>
const int PIN_SCL = 12;
const int PIN_SDA = 11;
const int PIN_RES = 14;
const int PIN_DC = 13;
const int PIN_CS = 10;
Adafruit_ST7789 tft(PIN_CS, PIN_DC, PIN_RES);
void setup() {
SPI.begin(PIN_SCL, -1, PIN_SDA, PIN_CS);
tft.init(240, 320);
tft.fillScreen(ST77XX_BLACK);
tft.setTextColor(ST77XX_WHITE);
tft.setTextSize(3);
tft.setCursor(20, 40);
tft.print("It works");
tft.fillRect(20, 100, 60, 60, ST77XX_RED);
tft.fillRect(90, 100, 60, 60, ST77XX_GREEN);
tft.fillRect(160, 100, 60, 60, ST77XX_BLUE);
}
void loop() {
delay(1000);
}
- Tools > Board > ESP32S3 Dev Module, then Tools > Port and choose the board's port.
- Adafruit GFX Library: install it from Sketch > Include Library > Manage Libraries.
- Adafruit ST7735 and ST7789 Library: install it from Sketch > Include Library > Manage Libraries.
This sketch is compiled for the board before the page is published. It has not been run on real hardware by us.
What you should see
The screen shows “It works” above a red, a green and a blue square.
If it does not work
- The screen stays black.
- Check VCC is on 3V3 and GND on GND, then the two data wires: SCL to the clock pin and SDA to the data pin. On these screens SCL and SDA are SPI, not I2C.
- The screen is lit but white, or shows noise.
- DC, CS or RES is on the wrong pin. Compare those three wires with the table.
Build something with it
These Build Packs use this part on this board, with the same pins.
More parts on the ESP32-S3
- ST7789 1.54 in TFT screenESP32-S3 · 7 wires
- GC9A01 round screenESP32-S3 · 7 wires
- SSD1306 OLED 0.96 in screenESP32-S3 · 4 wires
- SSD1306 OLED 0.91 in screenESP32-S3 · 4 wires
- 4.2 in e-paper screenESP32-S3 · 8 wires
- TTP223 touch sensorESP32-S3 · 3 wires
- Push buttonESP32-S3 · 2 wires
- Foot switchESP32-S3 · 2 wires
- Slide switchESP32-S3 · 2 wires
- SW-520D tilt switchESP32-S3 · 2 wires
- MC-38 door switchESP32-S3 · 2 wires
- AM312 PIR motion sensorESP32-S3 · 3 wires
- HC-SR04 ultrasonic sensorESP32-S3 · 4 wires
- Capacitive soil moisture sensorESP32-S3 · 3 wires
- BME280 sensorESP32-S3 · 4 wires
- MLX90614 infrared thermometerESP32-S3 · 4 wires
- SGP30 air quality sensorESP32-S3 · 4 wires
- HX711 load cellESP32-S3 · 4 wires
- KY-040 rotary encoderESP32-S3 · 5 wires
- 3×4 keypadESP32-S3 · 7 wires
- Passive buzzerESP32-S3 · 2 wires
- WS2812 LED ringESP32-S3 · 3 wires
- WS2812 LED stickESP32-S3 · 3 wires
- WS2812B LED stripESP32-S3 · 3 wires
- KY-016 RGB LEDESP32-S3 · 4 wires
- 2-channel relay moduleESP32-S3 · 4 wires
- 28BYJ-48 stepper motor (ULN2003)ESP32-S3 · 6 wires
- MAX98357A I2S amplifierESP32-S3 · 5 wires
- SX1262 LoRa module (Ra-01SH)ESP32-S3 · 9 wires