Interfacing Arduino with ST7565 LCD – Graphics Test Example

This post shows the interfacing process of Arduino uno board with ST7565 monochrome 128×64 LCD display. This example shows how to print texts, draw bitmap images and some shapes (such as lines, circles …) on the ST7565 LCD.
Basically, The ST7565 is a popular LCD controller chip manufactured by Sitronix Technology Corporation. It is commonly used in small graphical LCD modules, often found in applications such as industrial equipment, consumer electronics, and DIY projects. The ST7565 controller is known for its compatibility with various microcontrollers and ease of use for displaying graphics and text.

Interfacing Arduino with ST7565 LCD display circuit

Here are some key features and characteristics of the ST7565 LCD controller:

  • Controller Type: ST7565 is a monochrome (usually black and white) graphical LCD controller.
  • Resolution: The commonly used resolution for the ST7565 controller based display is 128×64 pixel, but other LCDs with resolution such as 128×32 could be found.
  • Communication Interface: The ST7565 uses parallel interface or serial interface (SPI protocol) for communication with the microcontroller. This means it requires several GPIO pins to transfer data and commands. The parallel interface requires more pins than the serial SPI interface.
  • Display Modes: It supports both text and graphical modes, making it suitable for a wide range of applications.
  • Built-in RAM: The ST7565 controller typically has an internal display buffer (RAM) that it is used to store graphics and text before being displayed on the screen.
  • Voltage Requirements: Basically the ST7565 controller itself works only with 3.3V. LCD modules usually require a supply voltage of around 3.3V or 5V, depending on the specific module and configuration.
  • Backlighting: Usually LCD modules come with LED backlighting for improved visibility in low-light conditions.
  • Controller Commands: ST7565 controllers accept various commands for controlling display functions, such as setting the display contrast, addressing individual pixels, and more.

To use an ST7565 LCD module with a microcontroller, we will typically need to interface it by connecting the appropriate pins to our microcontroller’s GPIO pins and use a suitable library or driver to communicate with the display. In this example SPI (Serial Peripheral Interface) communication protocol interface is used which requires 5 GPIO pins at maximum.
The ST7565 LCD module used in this example is the one shown below (GMG12864-06D):

ST7565 LCD display module image

The ST7565 LCD used in this project has 13 pins numbered from right to left as shown in the above image. The LCD module also contains a small 6-pin integrated circuit (IC) labeled as U1, this IC named as 16S1Y and it is used to get simplified Chinese character set font in 15×16 dot size, this IC also works with SPI communication protocol and connected to the microcontroller via 4-wire interface. The 16S1Y IC is not used in this project.

ST7565 LCD module pin description (numbering starts from right to left seeing from module back view):

  1. CS: chip select pin, active low
  2. RES: controller reset pin, active low
  3. RS: register select pin, also named as A0
  4. SCL: serial clock signal input, also labeled as SCK
  5. SI: serial data input pin, also labeled as SDA or MOSI (Master Out Slave In)
  6. VDD: positive power supply pin
  7. VSS: negative (ground) power supply pin
  8. A: backlight LED anode terminal pin
  9. K: backlight LED cathode terminal pin
  10. IC_SCL: 16S1Y IC serial clock signal input pin
  11. IC_CS: 16S1Y IC chip select pin
  12. IC_SO: 16S1Y IC serial data output pin
  13. IC_SI: 16S1Y IC serial data input pin

Basically, the ST7565 controller works with 3.3V, applying a voltage of 5 Volts may damage it. The same thing applied to the LCD module I’m using in this example, we should use 3.3V both for power supply and control signals, connection of the LCD with the Arduino board is as shown in project circuit diagram below.

Hardware Required:

Interfacing Arduino with ST7565 LCD display circuit:
Project circuit diagram is shown below, the connection between the Arduino UNO R3 board and the ST7565 LCD module is very simple.

Interfacing Arduino with ST7565 LCD display circuit

Circuit description:
The connection between the Arduino uno Rev 3 board and the ST7565 LCD is very simple, only 5 GPIO pins are required.
As mentioned above, the ST7565 LCD display works only with 3.3V, applying a 5V directly to the display module may harm its controller circuit. In this project the ST7565 LCD module is powered directly from the Arduino board with 3.3V where VDD pin of the LCD (#6) is connected to Arduino 3.3V pin and GND pin of the LCD (#7) is connected to Arduino GND pin.

For the 5 control signal connection between the Arduino board and the ST7565 LCD, I used voltage divider circuit for each control signal to get a suitable voltage for the LCD. Each voltage divider consists of 1k and 2k resistors and they are connected as shown in the circuit diagram above.
By applying voltage divider equation and assuming a 5V output from the Arduino board we get: 5 x 2/(2+1) = 3.33V which is very nice voltage value for the LCD.

The ST7565 LCD module is connected to the Arduino board as follows (each control pin connected to Arduino through voltage divider):
CS: connected to Arduino digital pin 5
RES: connected to Arduino digital pin 6
RS (A0): connected to Arduino digital pin 7
SCL(SCK): connected to Arduino digital pin 8
SI(SDA, MOSI): connected to Arduino digital pin 9
VDD: connected to Arduino 3.3V pin
GND: connected to Arduino GND pin
LEDA: connected to Arduino 3.3V pin
LEDK: connected to Arduino GND pin
Other pins: Not connected

The not connected pins are for the 16S1Y IC which is not used in this project.
LEDA & LEDK are LCD backlight LED pins.

Note that with this connection software SPI is used and it is configured in project Arduino code.

Interfacing Arduino with ST7565 LCD display code:
To make the interfacing example code more simpler I used an Arduino library for the ST7565 LCD display. This library works in dependency of Adafruit graphics library (Adafruit_GFX). Both library could be installed online through Arduino Library Manager.

For the ST7565 LCD, in the Arduino library manager search box write ‘st7565’ and install the one published by Simple Circuit, Arduino IDE may ask for other library installation (“dependencies,” like Adafruit_GFX or Adafruit_BusIO), if thery’re not already installed then you have to add them.

The ST7565 LCD library and Adafruit GFX libraries could be installed offline, GitHub links are below:
ST7565 LCD library
Adafruit GFX library

Note that this example was tested with ST7565 library version 1.0.2 and Adafruit GFX library version 1.11.17.

Code description:
Arduino libraries needed for project code are included as shown below:

The connection between the ST7565 LCD and the Arduino are defined as:

And the ST7565 library is configured and initialized as below, with this configuration software SPI is used:

Full Arduino code:

The following video shows my DIY project circuit:

Interfacing Arduino with ST7565 LCD Proteus simulation:
We can simulate this project using Proteus simulation software since it contains ST7565 device library. Simulation result as shown in this video.

Arduino with ST7565 LCD Proteus simulation file download:
Proteus simulation file of this project can be downloaded from the below Google Drive link. Use Proteus version 8.15 or higher to open it.

1 thought on “Interfacing Arduino with ST7565 LCD – Graphics Test Example”

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top