The 2-inch LCD Module (Manufacturer: Waveshare, Part ID: ST7789V) is a compact display module designed for visual output in embedded systems and electronics projects. With a diagonal size of 2 inches, this module offers vibrant color representation and high resolution, making it ideal for applications requiring clear and detailed image or text display. It is commonly used in IoT devices, handheld gadgets, and DIY electronics projects.
Below are the key technical details of the 2-inch LCD Module:
Parameter | Value |
---|---|
Manufacturer | Waveshare |
Part ID | ST7789V |
Display Size | 2 inches (diagonal) |
Resolution | 240 x 320 pixels |
Display Type | TFT LCD |
Color Depth | 65K/262K colors |
Interface | SPI (Serial Peripheral Interface) |
Operating Voltage | 3.3V |
Backlight Voltage | 3.0V to 3.3V |
Operating Temperature | -20°C to 70°C |
The module features a standard pin header for easy interfacing. Below is the pinout:
Pin Number | Pin Name | Description |
---|---|---|
1 | GND | Ground connection |
2 | VCC | Power supply (3.3V) |
3 | SCL | Serial Clock Line for SPI communication |
4 | SDA | Serial Data Line for SPI communication |
5 | RES | Reset pin (active low) |
6 | DC | Data/Command control pin |
7 | BL | Backlight control (connect to 3.3V for always on) |
8 | CS | Chip Select (active low) |
VCC
pin to a 3.3V power source and the GND
pin to ground.SCL
and SDA
pins to the SPI clock and data lines of your microcontroller, respectively.RES
pin to reset the display during initialization.DC
pin determines whether the data being sent is a command or display data.CS
pin enables or disables communication with the module.BL
pin to 3.3V to keep the backlight on, or use a PWM pin from your microcontroller for brightness control.Below is an example of how to interface the 2-inch LCD Module 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("2-inch LCD Module Test");
// 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 text
tft.setTextColor(ST77XX_WHITE);
tft.setTextSize(2);
tft.setCursor(10, 10);
tft.println("Hello, World!");
}
void loop() {
// Add your code here for dynamic updates
}
No Display Output:
CS
pin is correctly toggled during communication.Flickering or Unstable Display:
Incorrect Colors or Artifacts:
Backlight Not Working:
BL
pin is connected to 3.3V or a PWM signal.Q: Can I use this module with a 5V microcontroller?
A: Yes, but you must use level shifters to convert the 5V logic signals to 3.3V to avoid damaging the module.
Q: What is the maximum SPI clock speed supported?
A: The module typically supports SPI clock speeds up to 10 MHz. Check the microcontroller's SPI capabilities for compatibility.
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 module compatible with Raspberry Pi?
A: Yes, the module can be used with Raspberry Pi via SPI, but you may need to install the appropriate libraries and drivers.
By following this documentation, you can effectively integrate the 2-inch LCD Module into your projects and troubleshoot common issues.