There are many types of LCDs used in Electronic Projects. 

The ST9720 Graphical LCD is totally different from the Ordinary LCDs. Ordinary LCD can only print simple text or numbers within a fixed size. But in Graphical LCDs we have 128*64 which is equal to 8192 dots or 8192/8 = 1024 pixels, so apart from character, we can display any Graphical Image on this GLCD.

 today we will interface Graphical LCD with Arduino to display text and images on it.

 

Material Required

  • Arduino UNO
  • 128*64 Graphical LCD ST9720
  • Potentiometer-10k
  • Connecting wires
  • Breadboard

 

Circuit Diagram

Interfacing circuit diagram of Graphical LCD with Arduino

Interfacing Graphical LCD with Arduino circuit hardware

 

128*64 Graphical LCD

This Graphical LCD is having low power consumption and also suitable for battery power portable device. It have wide operating voltage range 2.2v to 5.5v and supports both serial and 8/4-bit parallel communication and comes with ST7290 LCD controller/driver IC. Interface communication mode can be switched between parallel and serial using PSB PIN 15. This graphical LCD has an automatic power on Reset function and can be easily controlled by MCU such 

ST7290 Graphical LCD

You can go through with the datasheet for detailed information about ST7290 128*64 Graphical LCD

 

Pin Configuration

Pin No.

Pin Name

Description

1

Gnd

Ground terminal

2

Vcc

Input supply voltage (2.7v to 5.5v)

3

Vo

LCD contrast

4

RS


RS = 0: Instruction Register

RS = 1: Data Register

5

R/W

Read/Write control

6

E

Enable

7,8,9,10,11,12,13,14

DB0, DB1, DB2, DB3, DB4, DB5, DB6, DB7

Data Pins (used in parallel 8/4bit communication mode)

15

PSB

Interface selection:

Low(0) for serial communication mode

High (1) for 8/4-bit parallel bus mode.

16

NC

Not connected

17

RST

Reset Pin

18

Vout

LCD voltage doubler output. VOUT ≦ 7V.

19

BLA

Backlight positive supply

20

BLK

Backlight Negative supply

Applications

  • Industrial device
  • Embedded Systems
  • Security
  • Medical 
  • Hand-held equipment

 

Converting Image into Hex Code:

To show any image on Graphical LCD, we need HEX code of that image, so here are few steps to convert Image into HEX code. Before that you have to make sure that the size of image should not exceed 128*64.

Step-1: Decrease the size of the normal image to 128*64 or less, which you can do using any image editing software like MS paint.

Decreasing size to 128*64

As shown in the picture above, we are setting the width and height of the image to 128*64.

 

Step-2: Then you need to save the image in “image_name.bmp” format.

Saving image in bmp format

Select the format shown in the above image and save the file for further process.

 

Step-3: After saving it into “.bmp” format you need to convert the image into hex code for printing. For this, I am using the software named GIMP 2, which convert Bmp file to hex code.

Open the bmp formatted image in GIMP 2 software

As shown in the image above, we opened the “.bmp” format file in the GIMP 2 software.

 

Step-4: After downloading the software, open the BMP format image file which you want to print and then save as it in .xbm (X BitMap)format. After saving it open that file using Notepad and you will get the Hex code of the image.

As shown in the picture below, choose the Export option to save the file in the xbm format:

Export image using GIMP 2 software

Select the format shown in the picture below and export the image file.

Chosse xbm format to save hex code of image

After exporting the file, you will get the file in “.xbm” format. Open the xbm file using Notepad and you will get the HEX code as shown in picture below.

Hex code of IPL image

 

Arduino Code and Working Explanation

Interfacing Graphical LCD with Arduino in action

To interface graphical LCD with Arduino, first we need to define the library used for the Graphical LCD. Arduino don’t have this library, you have to download and install this library from this link. Then you can include the library like below:

#include "U8glib.h"

Here, ‘u8g(10)’ is defining the connection of RS(Register Select) pin of graphical LCD with the 10th pin of the Arduino UNO. RS pin used as ‘chip select’ and ‘Register Select’ when used in Serial and Parallel mode respectively. So, we are using the serial mode and RS pin set to High (1) for chip enabled and Low (0) for chip disabled.

U8GLIB_ST7920_128X64_4X u8g(10);

 

Now, for printing the image we need to place the Hex code of the image in the below code. You can print any other image all you just need to do is paste the hex code of the image.

const uint8_t rook_bitmap[] U8G_PROGMEM = {
Paste the Hex code of image here
};

Check the Full Arduino Code at the end of this Article.

 

The below function is used for printing image, the command used for printing is

There are no reviews for this product.

Write a review

Please login or register to review