The 1.54-inch TFT Display is a compact and vibrant display module with a resolution of 240x240 pixels. It utilizes the ST7789 driver and communicates via the SPI (Serial Peripheral Interface) protocol, making it an excellent choice for embedded systems and small devices. This display is ideal for applications requiring a high-quality graphical interface, such as IoT devices, handheld gadgets, and wearable electronics.
Below are the key technical details and pin configuration for the 1.54'' TFT Display:
Parameter | Specification |
---|---|
Display Type | TFT (Thin-Film Transistor) |
Resolution | 240x240 pixels |
Driver IC | ST7789 |
Communication Protocol | SPI (4-wire) |
Operating Voltage | 3.3V (logic and backlight) |
Backlight | LED |
Display Size | 1.54 inches (diagonal) |
Color Depth | 65K (16-bit RGB) |
Viewing Angle | Wide (all directions) |
Operating Temperature | -20°C to 70°C |
Pin Name | Pin Number | Description |
---|---|---|
GND | 1 | Ground connection |
VCC | 2 | Power supply (3.3V) |
SCL | 3 | Serial Clock Line (SPI clock input) |
SDA | 4 | Serial Data Line (SPI data input) |
RES | 5 | Reset pin (active low) |
DC | 6 | Data/Command control pin |
CS | 7 | Chip Select (active low) |
BLK | 8 | Backlight control (connect to 3.3V for always on) |
VCC
pin to a 3.3V power source and the GND
pin to ground.SCL
(clock) and SDA
(data) pins to the corresponding SPI pins on your microcontroller.RES
pin to a GPIO pin for resetting the display.DC
pin to toggle between data and command modes.CS
pin to a GPIO pin to enable or disable the display.BLK
pin to 3.3V for constant backlight or to a PWM pin for brightness control.BLK
pin.Below is an example of how to use the 1.54'' TFT Display with an Arduino UNO using the Adafruit_GFX and Adafruit_ST7789 libraries:
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7789.h> // ST7789 driver library
#include <SPI.h> // SPI library
// Define pin connections
#define TFT_CS 10 // Chip Select pin
#define TFT_RST 9 // Reset pin
#define TFT_DC 8 // Data/Command pin
// Initialize the display object
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);
void setup() {
// Initialize serial communication for debugging
Serial.begin(9600);
Serial.println("Initializing display...");
// Initialize the display
tft.init(240, 240); // Initialize with 240x240 resolution
tft.setRotation(1); // Set display rotation (0-3)
// Fill the screen with a color
tft.fillScreen(ST77XX_BLACK);
tft.setTextColor(ST77XX_WHITE);
tft.setTextSize(2);
tft.setCursor(10, 10);
tft.println("Hello, World!");
}
void loop() {
// Example: Draw a red rectangle
tft.fillRect(50, 50, 100, 100, ST77XX_RED);
delay(1000);
// Example: Clear the rectangle
tft.fillRect(50, 50, 100, 100, ST77XX_BLACK);
delay(1000);
}
Display Not Turning On:
VCC
and GND
).BLK
pin is connected to 3.3V or a PWM signal.No Output on the Screen:
SCL
, SDA
, CS
, DC
).RES
pin is properly connected and initialized in the code.Flickering or Unstable Display:
Incorrect Colors or Artifacts:
Q: Can I use this display with a Raspberry Pi?
A: Yes, the display is compatible with Raspberry Pi. Use libraries like luma.lcd
or Pillow
for Python-based development.
Q: What is the maximum SPI clock speed supported?
A: The ST7789 can support SPI clock speeds up to 15 MHz, but start with lower speeds for stability.
Q: Can I power the display with 5V?
A: No, the display operates at 3.3V. Use a voltage regulator or level shifters if working with a 5V system.
Q: How do I control the backlight brightness?
A: Connect the BLK
pin to a PWM-capable GPIO pin and adjust the duty cycle to control brightness.
This concludes the documentation for the 1.54'' TFT Display 240x240 SPI ST7789.