The Waveshare 2" LCD, powered by the ST7789V driver, is a compact liquid crystal display designed for visual output in electronic devices. With its vibrant color rendering and high resolution, this display is ideal for applications requiring a small yet high-quality screen. It is commonly used in projects such as portable devices, IoT displays, gaming consoles, and embedded systems.
The following table outlines the key technical details of the Waveshare 2" LCD:
Specification | Details |
---|---|
Display Type | TFT LCD |
Driver IC | ST7789V |
Screen Size | 2 inches |
Resolution | 240 x 320 pixels |
Color Depth | 65K/262K colors |
Interface | SPI (4-wire) |
Operating Voltage | 3.3V |
Backlight | LED |
Viewing Angle | Wide-angle |
Dimensions | 40.4mm x 34.8mm |
Operating Temperature | -20°C to 70°C |
The Waveshare 2" LCD features an 8-pin interface. Below is the pinout and description:
Pin | Name | Description |
---|---|---|
1 | GND | Ground connection |
2 | VCC | Power supply (3.3V) |
3 | SCL | Serial Clock Line (SPI clock input) |
4 | SDA | Serial Data Line (SPI data input) |
5 | RES | Reset pin (active low) |
6 | DC | Data/Command control pin |
7 | BL | Backlight control (active high) |
8 | CS | Chip Select (active low) |
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.BL
pin can be connected to 3.3V or controlled via PWM for adjustable brightness.Below is an example of how to interface the Waveshare 2" LCD 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, 320); // Initialize with 240x320 resolution
tft.setRotation(1); // Set display orientation (1 = landscape)
// Fill the screen with a color
tft.fillScreen(ST77XX_BLUE);
// Display a message
tft.setTextColor(ST77XX_WHITE);
tft.setTextSize(2);
tft.setCursor(10, 10);
tft.println("Hello, World!");
}
void loop() {
// Add your code here for dynamic updates
}
Note: Install the Adafruit GFX and Adafruit ST7789 libraries via the Arduino Library Manager before running the code.
No Display Output:
CS
pin is correctly toggled to enable the display.Flickering or Distorted Graphics:
Backlight Not Working:
BL
pin is connected to 3.3V or a PWM signal.Incorrect Colors or Orientation:
Q: Can I use this display with a 5V microcontroller?
A: Yes, but you must use level shifters to convert 5V logic to 3.3V for the SPI and control pins.
Q: What is the maximum SPI clock speed supported?
A: The ST7789V supports SPI clock speeds up to 15 MHz. However, lower speeds may be required for longer cables or noisy environments.
Q: Can I control the backlight brightness?
A: Yes, you can use a PWM signal on the BL
pin to adjust the brightness.
Q: Is this display compatible with Raspberry Pi?
A: Yes, the display can be used with Raspberry Pi via the SPI interface. Use libraries like luma.lcd
or ST7789-python
for easier integration.