

The 2-inch OLED Display 240x320RGB ST7789 (Manufacturer Part ID: GMT020-02-7P) by Diyuser is a compact, high-resolution display module designed for embedded systems and DIY projects. Featuring a resolution of 240x320 pixels and full RGB color support, this display is powered by the ST7789 controller, which ensures smooth rendering and efficient communication with microcontrollers. Its small form factor and vibrant visuals make it ideal for applications such as portable devices, IoT dashboards, and graphical user interfaces.








| Parameter | Value |
|---|---|
| Display Type | OLED |
| Resolution | 240x320 pixels |
| Color Support | RGB (65K colors) |
| Controller IC | ST7789 |
| Interface | SPI (4-wire) |
| Operating Voltage | 3.3V |
| Logic Level | 3.3V |
| Power Consumption | ~50mW |
| Dimensions | 2 inches (diagonal) |
| Operating Temperature | -20°C to 70°C |
The display module has a 7-pin interface for communication and power. 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 | 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 on your microcontroller 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 module.Below is an example of how to interface the display with an Arduino UNO using the Adafruit ST7789 library. Note that the Arduino UNO operates at 5V, so a level shifter is required.
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7789.h> // ST7789 driver library
#include <SPI.h>
// 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 solid color
tft.fillScreen(ST77XX_BLACK);
// Display a message
tft.setTextColor(ST77XX_WHITE);
tft.setTextSize(2);
tft.setCursor(10, 10);
tft.println("Hello, World!");
}
void loop() {
// Add your main code here
}
Display Not Turning On:
VCC and GND).CS pin is correctly configured and set low to enable the display.No Output or Garbled Display:
SCL and SDA) for loose or incorrect wiring.DC and RES pins are properly connected and configured in the code.Flickering or Unstable Display:
Arduino UNO Compatibility Issues:
Q: Can this display be used with 5V microcontrollers?
A: Yes, but you must use a level shifter to convert the 5V logic signals to 3.3V.
Q: What is the maximum frame rate supported by the display?
A: The frame rate depends on the SPI clock speed and the microcontroller's processing power. Typically, it can achieve up to 60 FPS with optimized code.
Q: Is there a backlight control for this display?
A: No, as an OLED display, it does not require a backlight. Each pixel emits its own light.
Q: Can I use this display with Raspberry Pi?
A: Yes, the display is compatible with Raspberry Pi. Use the SPI interface and appropriate libraries (e.g., luma.oled or Adafruit-ST7789).
This concludes the documentation for the 2-inch OLED Display 240x320RGB ST7789. For further assistance, refer to the manufacturer's datasheet or community forums.