

The LCD Display 128x64 (ST7920) is a graphical LCD module with a resolution of 128x64 pixels. It is widely used in embedded systems for displaying text, graphics, and images. The display is powered by the ST7920 controller, which supports both parallel and serial (SPI) communication, making it versatile and easy to integrate into various microcontroller-based projects.








| Parameter | Specification |
|---|---|
| Display Resolution | 128x64 pixels |
| Controller | ST7920 |
| Communication Interface | Parallel (8-bit/4-bit) or Serial (SPI) |
| Operating Voltage | 4.5V to 5.5V |
| Backlight Voltage | 4.2V to 4.6V |
| Current Consumption | 1.5mA (typical, without backlight) |
| Operating Temperature | -20°C to +70°C |
| Dimensions | Varies by module (e.g., 93mm x 70mm) |
| Pin No. | Pin Name | Description |
|---|---|---|
| 1 | VSS | Ground (0V) |
| 2 | VDD | Power supply (4.5V to 5.5V) |
| 3 | VO | Contrast adjustment (connect to potentiometer) |
| 4 | RS | Register Select (0: Command, 1: Data) |
| 5 | RW | Read/Write (0: Write, 1: Read) |
| 6 | E | Enable signal (latch data on high-to-low) |
| 7-14 | DB0-DB7 | Data bus lines (DB4-DB7 used in 4-bit mode) |
| 15 | PSB | Interface mode select (1: Parallel, 0: Serial) |
| 16 | NC | Not connected |
| 17 | A | Backlight anode (+) |
| 18 | K | Backlight cathode (-) |
| Pin No. | Pin Name | Description |
|---|---|---|
| 1 | VSS | Ground (0V) |
| 2 | VDD | Power supply (4.5V to 5.5V) |
| 3 | VO | Contrast adjustment (connect to potentiometer) |
| 4 | RS | Register Select (0: Command, 1: Data) |
| 5 | RW | Serial Clock (SCK) |
| 6 | E | Serial Data Input (SID) |
| 15 | PSB | Interface mode select (1: Parallel, 0: Serial) |
| 17 | A | Backlight anode (+) |
| 18 | K | Backlight cathode (-) |
VDD pin to a 5V power source and VSS to ground.VO pin to adjust the display contrast.PSB pin to 1 for parallel mode or 0 for serial mode.A and K pins to a 5V power source and ground, respectively, to enable the backlight.DB0-DB7 or DB4-DB7 for 4-bit mode) and control pins (RS, RW, E) to the microcontroller.RS, RW (SCK), and E (SID) to the microcontroller.#include <U8g2lib.h>
// Initialize the display in SPI mode
// U8G2_ST7920_128X64_F_SW_SPI: Constructor for ST7920 in software SPI mode
U8G2_ST7920_128X64_F_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10);
void setup() {
u8g2.begin(); // Initialize the display
}
void loop() {
u8g2.clearBuffer(); // Clear the display buffer
u8g2.setFont(u8g2_font_ncenB08_tr); // Set font
u8g2.drawStr(0, 10, "Hello, World!"); // Draw text at (0, 10)
u8g2.sendBuffer(); // Send buffer to display
delay(1000); // Wait for 1 second
}
Display Not Turning On:
VDD and VSS).A and K).No Text or Graphics Displayed:
VO pin.Flickering or Unstable Display:
Incorrect or Garbled Output:
Q: Can I use the display with a 3.3V microcontroller?
A: The display requires a 5V power supply. Use a level shifter for 3.3V microcontrollers to safely interface with the display.
Q: How do I switch between 8-bit and 4-bit parallel modes?
A: In 4-bit mode, only DB4-DB7 are used for data transfer. Leave DB0-DB3 unconnected or tied to ground.
Q: Is the backlight mandatory for operation?
A: No, the backlight is optional. However, it improves visibility in low-light conditions.