Component guide · Intermediate · 3 min read
128x64 Graphic LCD (ST7920)
Wiring and U8g2
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
The 12864 graphic LCD is a 128 by 64 pixel monochrome screen, usually with an ST7920 controller and a blue or green backlight. It is large and readable, and is the display on many 3D printer control panels. Use its serial mode with three signal wires (RS, R/W and E) by tying PSB low, then draw text, icons and graphs with the U8g2 library. Set contrast with the potentiometer on the back.
Key specs at a glance
- Resolution
- 128 x 64 pixels, about 3.2 inch class
- Controller
- ST7920 (most common), some use KS0108
- Interfaces
- 8-bit parallel or 3-wire serial (PSB low)
- Supply
- 5 V on most modules; some 3.3 V versions
- Backlight
- LED, pins BLA/BLK (A/K), often with a resistor fitted
- Library
- U8g2 (constructor U8G2_ST7920_128X64_F_SW_SPI)
Serial mode wiring
Connect VSS to GND, VDD to 5 V, and BLA/BLK to 5 V and GND for the backlight. Tie PSB to GND to select serial mode. Then:
- RS (CS) to a digital pin, for example D10.
- R/W (data) to D11.
- E (clock) to D13.
- RST to 5 V or a spare pin.
On a 3.3 V board, check whether your module accepts 3.3 V logic; many work, but the 5 V versions are not guaranteed to. Adjust the contrast potentiometer if the screen looks blank or fully dark.
Drawing with U8g2
Full-buffer mode uses about 1 KB of RAM, half an Uno's memory; use the page-buffer "_1_" constructor if you run short.
#include <U8g2lib.h>
// clock, data, cs, reset
U8G2_ST7920_128X64_F_SW_SPI lcd(U8G2_R0, 13, 11, 10, 8);
void setup() { lcd.begin(); }
void loop() {
lcd.clearBuffer();
lcd.setFont(u8g2_font_6x12_tr);
lcd.drawStr(0, 12, "Geekobot");
lcd.drawFrame(0, 20, 128, 20);
lcd.drawBox(2, 22, (millis() / 50) % 124, 16); // moving bar
lcd.sendBuffer();
}12864 LCD vs OLED vs TFT
Common mistakes to avoid
- Leaving PSB floating or high in serial mode.
- Contrast pot turned all the way, so nothing shows.
- Full-buffer mode on an Uno with a big sketch, running out of RAM.
- Assuming every 12864 board is 3.3 V compatible.
- Using a KS0108 library on an ST7920 board.
Frequently asked questions
How do I know if my 12864 is ST7920?
The controller is usually printed on the listing or board; ST7920 boards have a PSB pin and 20 pins.
Why is my 12864 screen blank?
Adjust the contrast pot, check PSB is low for serial mode, and confirm the U8g2 pin order.
Can I use it with ESP32?
Often, with 3.3 V logic and the backlight on 5 V, but check your module's logic level.
Is this the 3D printer display?
Yes. The RepRap Discount Full Graphic Smart Controller uses a 12864 ST7920 LCD.
Does it show Hindi or other scripts?
With U8g2's Unicode fonts you can draw many scripts, limited by available fonts and memory.
Parts for this guide
Terms in this guide
Projects that use it
Put this into practice: 1 step-by-step build in our project library uses parts from this guide.
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.




