Documentation

1.3" 240x240 IPS TFT LCD Display Module (ST7789, 7-Pin) for Arduino, ESP32 & STM32 | ShillehTek Product Manual
Documentation / 1.3" 240x240 IPS TFT LCD Display Module (ST7789, 7-Pin) for Arduino, ESP32 & STM32 | ShillehTek Product Manual

1.3" 240x240 IPS TFT LCD Display Module (ST7789, 7-Pin) for Arduino, ESP32 & STM32 | ShillehTek Product Manual

shillehtektft-lcd-1-3-240x240-st7789-esp32-arduino

Overview

This 1.3β€³ TFT display packs a 240Γ—240 IPS panel driven by the ST7789 controller into a module barely bigger than a postage stamp. IPS is the key word: unlike the washed-out TN panels on older hobby displays, colors stay vivid and readable from practically any angle, with deep contrast and 65K colors. For gauges, dashboards, thumbnails, and small game screens it is one of the best value displays in the hobby.

The 7-pin header keeps wiring lean: SPI clock (SCL) and data (SDA, which is SPI MOSI β€” the I2C-style names mislead), a reset line, the data/command line every SPI display needs, and a backlight control pin. What is missing is deliberate: this variant has no CS pin. The chip-select is tied active internally, which saves a wire but means the display permanently owns its SPI bus and wants SPI mode 3 β€” both handled in the code below.

The module is a 3.3Β V device, power and logic, which makes ESP32, Raspberry Pi, and Pico direct connections. This manual covers the pinout, wiring for all four platforms (including the safe way to drive it from a 5Β V Arduino), first-pixels code for each, and the usual questions about the missing CS pin, offsets, and backlight dimming.

At a Glance

Panel
1.3β€³ IPS, 240 Γ— 240
Controller
ST7789 (SPI)
Colors
65K (RGB565)
Supply / Logic
3.3 V
Pins
7 β€” no CS (tied internally)
Backlight
BLK pin, PWM dimmable

Specifications

Parameter Value
Display 1.3β€³ IPS TFT, 240 Γ— 240 pixels
Controller Sitronix ST7789
Color depth 16-bit RGB565 (65K colors)
Interface 4-wire SPI (SCL, SDA/MOSI, DC, RES)
Chip select None β€” internally tied active; use SPI mode 3
SPI speed Up to ~40 MHz (higher often works)
Supply voltage 3.3 V
Logic level 3.3 V (level-shift from 5 V boards)
Backlight BLK pin, high = on, PWM dimmable
Viewing angle ~170Β° (IPS)
Header 7-pin: GND Β· VCC Β· SCL Β· SDA Β· RES Β· DC Β· BLK

Pinout Diagram

Seven pins on the right edge. Note the naming trap: SCL is the SPI clock and SDA is SPI MOSI β€” this is not an I2C display. BLK is the backlight enable; leave it unconnected (it is pulled on) or drive it with PWM to dim.

1.3 inch 240x240 IPS TFT ST7789 display pinout diagram showing GND, VCC, SCL clock, SDA MOSI, RES, DC and BLK backlight pins

Wiring Guide

Arduino Uno Wiring

Display Pin Arduino Uno Pin Notes
GND GND Common ground
VCC 3.3V Not 5 V
SCL D13 (SCK) Through a level shifter
SDA D11 (MOSI) Through a level shifter
RES D8 Through a level shifter
DC D9 Through a level shifter
BLK Unconnected Backlight defaults on
The Uno is a 5 V board; the display is not. Use a level shifter (or at minimum ~1–2 kΞ© series resistors) on SCL, SDA, RES, and DC. Boards driven directly from 5 V logic often work for a while β€” and then stop. ESP32 and Pico avoid the problem entirely.

ESP32 Wiring

Display Pin ESP32 Pin Notes
GND GND Common ground
VCC 3V3 Direct
SCL GPIO 18 (SCK) VSPI clock
SDA GPIO 23 (MOSI) VSPI data
RES GPIO 17 Any free GPIO
DC GPIO 16 Any free GPIO
BLK GPIO 4 (optional) PWM for brightness
Crank the SPI clock. The ESP32 drives this panel happily at 40 MHz+, which is the difference between visible redraws and fluid animation. Set it with tft.setSPISpeed(40000000) after init.

Raspberry Pi Wiring

Display Pin Raspberry Pi Pin Notes
GND GND (Pin 6) Common ground
VCC 3.3V (Pin 1) Direct
SCL GPIO 11 / SCLK (Pin 23) SPI0 clock
SDA GPIO 10 / MOSI (Pin 19) SPI0 data
RES GPIO 25 (Pin 22) Reset
DC GPIO 24 (Pin 18) Data/command
BLK GPIO 18 (Pin 12, optional) PWM backlight
Enable SPI: sudo raspi-config β†’ Interface Options β†’ SPI. The Python code below pushes full frames from PIL images, so anything you can draw with Pillow β€” text, charts, photos β€” lands on the panel.

Raspberry Pi Pico Wiring

Display Pin Pico Pin Notes
GND GND (Pin 38) Common ground
VCC 3V3(OUT) (Pin 36) Direct
SCL GP18 / SPI0 SCK (Pin 24) Clock
SDA GP19 / SPI0 TX (Pin 25) MOSI
RES GP20 (Pin 26) Reset
DC GP21 (Pin 27) Data/command
BLK Unconnected Or any GPIO for dimming
Driver file: copy the pure-MicroPython st7789py.py driver to the board. It is not the fastest way to drive the panel (the C module is), but it needs no custom firmware and is perfect for text and gauges.

Code Examples

Arduino β€” Adafruit ST7789 (no CS)

st7789_demo.ino
// Library Manager: "Adafruit ST7735 and ST7789" + "Adafruit GFX"
#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>

#define TFT_CS   -1   // this module has no CS pin
#define TFT_DC    9
#define TFT_RST   8

Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);

void setup() {
  tft.init(240, 240, SPI_MODE3);   // mode 3 because CS is tied low
  tft.setRotation(2);
  tft.fillScreen(ST77XX_BLACK);

  tft.setTextColor(ST77XX_GREEN);
  tft.setTextSize(3);
  tft.setCursor(20, 100);
  tft.print("Hello IPS!");
}

void loop() {}

ESP32 β€” Fast Graphics

esp32_st7789.ino
#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>

Adafruit_ST7789 tft = Adafruit_ST7789(-1, 16, 17);  // CS=-1, DC, RST

void setup() {
  tft.init(240, 240, SPI_MODE3);
  tft.setSPISpeed(40000000);       // 40 MHz
  tft.fillScreen(ST77XX_BLACK);
}

void loop() {
  // color wipe animation
  uint16_t colors[] = {ST77XX_RED, ST77XX_GREEN, ST77XX_BLUE,
                       ST77XX_YELLOW, ST77XX_CYAN, ST77XX_MAGENTA};
  for (int i = 0; i < 6; i++) {
    for (int y = 0; y < 240; y += 8) {
      tft.fillRect(0, y, 240, 8, colors[i]);
    }
  }
}

Raspberry Pi β€” Python with PIL

st7789_demo.py
import st7789
from PIL import Image, ImageDraw, ImageFont

# pip3 install st7789 pillow

disp = st7789.ST7789(
    port=0, cs=0, dc=24, rst=25, backlight=18,
    width=240, height=240, rotation=0, spi_speed_hz=40000000)

img = Image.new("RGB", (240, 240), (0, 0, 30))
draw = ImageDraw.Draw(img)
draw.rectangle((10, 10, 230, 230), outline=(0, 200, 255), width=4)
font = ImageFont.load_default()
draw.text((60, 110), "Hello from Pi!", fill=(255, 255, 0), font=font)

disp.display(img)
input("Showing - press Enter to quit")

Raspberry Pi Pico β€” MicroPython

pico_st7789.py
from machine import Pin, SPI
import st7789py as st7789   # copy st7789py.py driver to the board

spi = SPI(0, baudrate=31250000, polarity=1, phase=1,
          sck=Pin(18), mosi=Pin(19))

tft = st7789.ST7789(spi, 240, 240,
                    reset=Pin(20, Pin.OUT),
                    dc=Pin(21, Pin.OUT),
                    cs=None, rotation=0)

tft.fill(st7789.BLACK)
tft.fill_rect(20, 20, 200, 60, st7789.BLUE)
tft.fill_rect(20, 100, 200, 60, st7789.RED)
tft.fill_rect(20, 180, 200, 40, st7789.GREEN)

Frequently Asked Questions

Where is the CS pin?
There is none β€” chip select is tied active inside the module. Two consequences: pass -1 (or None) as the CS pin in libraries, and initialize with SPI mode 3, because with CS permanently low the ST7789 samples the clock differently. The code examples above do both.
Can it share an SPI bus with other devices?
Not comfortably. With no CS the display listens to everything on the bus, so traffic meant for an SD card or a second display corrupts the screen. Give it its own SPI peripheral (the ESP32 and Pico both have two) or choose the 8-pin ST7789 variant that includes CS when bus sharing matters.
Can I power it from 5 V?
No β€” this 7-pin module expects 3.3 V on VCC and 3.3 V logic. On a 5 V Arduino, power it from the 3.3 V pin and level-shift the four signal lines. Getting away with direct 5 V wiring is common and also the most common way these panels die early.
How do I dim the backlight?
Drive BLK with PWM: full high is full brightness, and duty cycle scales it down smoothly. Left unconnected, the pin is pulled high and the backlight is simply always on. Turning BLK off is also the correct β€œscreen off” power saving, since the panel itself draws little.
My image is shifted or has a band of noise pixels. Why?
The ST7789 addresses a 240Γ—320 memory; a 240Γ—240 panel uses a window of it with an 80-pixel offset. Libraries handle this when told the right size β€” tft.init(240, 240) or the width/height arguments in the Python drivers. Wrong size or rotation settings are what produce the shifted image or the noisy stripe.
Is it sunlight readable / how good is IPS here?
Indoors it is excellent β€” wide angles, strong contrast, vivid color. In direct sunlight it washes out like most transmissive LCDs. For outdoor gadgets pair it with a shade or bump the backlight to full; for pure sunlight readability an e-paper panel is the better tool.
How fast can I refresh it?
Full-frame redraws are governed by SPI speed: a 240Γ—240 RGB565 frame is 115 KB, so at 40 MHz you can theoretically push ~40 fps. In practice the Adafruit/ESP32 combination manages fluid gauges and simple animation easily; the pure-Python Pico driver is best treated as a static-content display.

Related Tutorials