Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use 2inch OLED Display 240x320RGB ST7789: Examples, Pinouts, and Specs

Image of 2inch OLED Display 240x320RGB ST7789
Cirkit Designer LogoDesign with 2inch OLED Display 240x320RGB ST7789 in Cirkit Designer

Introduction

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.

Explore Projects Built with 2inch OLED Display 240x320RGB ST7789

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Wi-Fi Controlled RGB LED and OLED Display with ESP8266
Image of ESP thermometer reciever: A project utilizing 2inch OLED Display 240x320RGB ST7789 in a practical application
This circuit features an ESP8266 microcontroller interfaced with a 128x64 OLED display via I2C for visual output and an RGB LED controlled through current-limiting resistors. The ESP8266 provides power and control signals to both the display and the LED, enabling visual feedback and status indication.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Nano Controlled TFT Display with Multiple Pushbuttons
Image of rey: A project utilizing 2inch OLED Display 240x320RGB ST7789 in a practical application
This circuit features an Arduino Nano microcontroller connected to a ST7735 128x128 1.44 TFT I2C Color display and multiple pushbuttons. The display is interfaced with the Arduino via digital pins for control signals and SPI pins for data transfer. The pushbuttons are connected to various digital and analog input pins on the Arduino, likely intended for user input to control the display or other functions within the code.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP8266 NodeMCU OLED Display: Wi-Fi Enabled Hello World Project
Image of oled: A project utilizing 2inch OLED Display 240x320RGB ST7789 in a practical application
This circuit features an ESP8266 NodeMCU microcontroller connected to a 1.3-inch OLED display via I2C communication. The microcontroller initializes the display and renders basic graphics and text, demonstrating a simple interface for visual output.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Powered 1.3 inch TFT Display Module for Visual Data Output
Image of ESP32+ST7789: A project utilizing 2inch OLED Display 240x320RGB ST7789 in a practical application
This circuit connects an ESP32 microcontroller to a 1.3 inch TFT display module (ST7789). The ESP32 provides power and control signals to the display, enabling it to show graphical data.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with 2inch OLED Display 240x320RGB ST7789

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of ESP thermometer reciever: A project utilizing 2inch OLED Display 240x320RGB ST7789 in a practical application
Wi-Fi Controlled RGB LED and OLED Display with ESP8266
This circuit features an ESP8266 microcontroller interfaced with a 128x64 OLED display via I2C for visual output and an RGB LED controlled through current-limiting resistors. The ESP8266 provides power and control signals to both the display and the LED, enabling visual feedback and status indication.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of rey: A project utilizing 2inch OLED Display 240x320RGB ST7789 in a practical application
Arduino Nano Controlled TFT Display with Multiple Pushbuttons
This circuit features an Arduino Nano microcontroller connected to a ST7735 128x128 1.44 TFT I2C Color display and multiple pushbuttons. The display is interfaced with the Arduino via digital pins for control signals and SPI pins for data transfer. The pushbuttons are connected to various digital and analog input pins on the Arduino, likely intended for user input to control the display or other functions within the code.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of oled: A project utilizing 2inch OLED Display 240x320RGB ST7789 in a practical application
ESP8266 NodeMCU OLED Display: Wi-Fi Enabled Hello World Project
This circuit features an ESP8266 NodeMCU microcontroller connected to a 1.3-inch OLED display via I2C communication. The microcontroller initializes the display and renders basic graphics and text, demonstrating a simple interface for visual output.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of ESP32+ST7789: A project utilizing 2inch OLED Display 240x320RGB ST7789 in a practical application
ESP32-Powered 1.3 inch TFT Display Module for Visual Data Output
This circuit connects an ESP32 microcontroller to a 1.3 inch TFT display module (ST7789). The ESP32 provides power and control signals to the display, enabling it to show graphical data.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Portable electronic devices
  • IoT dashboards and smart home displays
  • Wearable technology
  • Embedded systems requiring graphical output
  • DIY projects and prototyping

Technical Specifications

Key Technical Details

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

Pin Configuration and Descriptions

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)

Usage Instructions

How to Use the Component in a Circuit

  1. Power Supply: Connect the VCC pin to a 3.3V power source and the GND pin to ground.
  2. SPI Communication: Connect the SCL (clock) and SDA (data) pins to the corresponding SPI pins on your microcontroller.
  3. Control Pins:
    • Connect the RES pin to a GPIO pin on your microcontroller for resetting the display.
    • Use the DC pin to toggle between data and command modes.
    • Connect the CS pin to a GPIO pin to enable or disable the display module.
  4. Initialization: Use the ST7789 driver library or write custom initialization code to configure the display.

Important Considerations

  • Ensure the logic level of your microcontroller matches the display's 3.3V requirement. Use a level shifter if your microcontroller operates at 5V.
  • Avoid prolonged exposure to extreme temperatures to maintain display longevity.
  • Use decoupling capacitors near the power pins to reduce noise and ensure stable operation.

Example Code for Arduino UNO

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
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. Display Not Turning On:

    • Verify the power connections (VCC and GND).
    • Ensure the CS pin is correctly configured and set low to enable the display.
  2. No Output or Garbled Display:

    • Check the SPI connections (SCL and SDA) for loose or incorrect wiring.
    • Ensure the DC and RES pins are properly connected and configured in the code.
    • Confirm that the ST7789 library is correctly installed and initialized.
  3. Flickering or Unstable Display:

    • Add decoupling capacitors (e.g., 0.1µF) near the power pins to reduce noise.
    • Verify that the power supply provides a stable 3.3V output.
  4. Arduino UNO Compatibility Issues:

    • Use a level shifter to convert the 5V logic level of the Arduino UNO to 3.3V.
    • Double-check the pin assignments in the code to match your wiring.

FAQs

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.