Interface Graphical LCD (KS0108) with Arduino

Last Updated on March 29, 2024

Simple Way to Interface Graphical LCD (KS0108) with Arduino, Here Graphical LCD termed as GLCD, The KS0108B is a LCD driver LSl with 64 channel output for dot matrix liquid crystal graphic display system. This device consists of the display RAM, 64 bit data latch 64 bit drivers and decoder logics. It has the internal display RAM for storing the display data transferred from a 8 bit micro controller and generates the dot matrix Liquid crystal driving signals corresponding to stored data. The KS0108B composed of the liquid crystal display system in combination with the KS0107B (64 common driver) Refer datasheet for more details.  By following Steps you can interface any type of 128×64 LCD with Arduino boards.

glcd_image

After Interface Graphical LCD (KS0108) with Arduino, Can you display any images or photos as you wish? Yes You can display your photo and selfie or pictures in glcd! (Graphic Liquid Crystal Display) to make this happen you have to follow some steps. First have arduino mega borad and glcd display and then some connecting wires.

MEGA_pinconnections

Components List

S.NoNameQuantity
1.Arduino MEGA board1
2.GLCD display (128×64)1
3.100 KΩ Variable Resistor1
4.Connecting Wiresas required

Then make connections as per the diagram shows, don’t make mistake in connection then you will see improper image in glcd. Here 100 KΩ variable resistor acts as a brightness control for glcd.
The numbers from 1 to 20 shown in right side of connection diagram is the pin number order in graphic lcd. Then corresponding arduino pin number also given straight to the glcd pin numbers.

glcd_arduino_wiring

After connecting all wires with arduino mega board and glcd, we have to chose the photo which we want to display in glcd.

For GLCD use Library file from Openglcd, the arduino library of display couldn’t directly support gld displays. Once you insert the openglcd library into arduino software you can see the example programs of GLCD in the arduino software. (refer how to insert new library in arduino.cc )

openglcd

Here we use 128×64 GLCD hence it can display any image that have 128×64 pixels. Make sure that your image should not exceed this pixel level. Resize and save your image as monochrome bitmap then your becomes black and white pixels.

bitmap

To display this bitmap in glcd we have to convert it into hex codes, for that download LCD Assistant software. (http://en.radzio.dxp.pl/bitmap_converter/)

lcd assistant

Load bitmap image in LCD assistant software, through file – Load image.

bitmapload

After that directly convert bitmap into hex file by choosing save output. Keep in mind that you have to store your output as .h that is hex (ex: 12134.h)

out
hexfile

Open the saved hex file through notepad and select hex file numbers only without any other terms.

gethexcode

Make another file through new notepad and put define terms and bitmap size like below image shows. (you can refer or modify the billshead hex file from the openglcd bitmaps library)

hexfilecode

After making the file save it as a hex file, and copy paste into openglcd bitmaps folder.

identi

You need to save your bitmap image also into the (openglcd/bitmaps/images) folder. Then only GLCD can clearly reproduce your image clearly.

placephoto

Finally we come to the end, here simple example arduino code given to display image that has been explained so far in this page.

Arduino code for Interface Graphical LCD (KS0108) with Arduino

/*
* Interface Graphical LCD (KS0108) with Arduino
* 128x64 Character (Green) Graphic LCD Display
* www.theorycircuit.com/interface-graphical-lcd-ks0108-with-arduino
*/

#include <openGLCD.h>
#include <bitmaps/12134.h>
#define DELAY 2000 // ms delay between examples
void setup()
{
GLCD.Init();
}
void loop()
{
GLCD.ClearScreen();
/*
* Display photo centered on Display
*/
GLCD.DrawBitmap(12134, GLCD.Width/2 - 32, 0);
delay(DELAY);
}

3 thoughts on “Interface Graphical LCD (KS0108) with Arduino

Leave a Reply

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