Connecting 128*64 LCD to Arduino Mega 2560 R3

Hi All,

I am trying to use this LCD display with my Arduino Mega 2560 R3. I tried to use this library in my work I have connected the LCD and Arduino as mentioned in IMPORTANT NOTE section of the above tutorial.

But when I tried to run this hello world program there. It shows a bright and dark dots all over the LCD. I tried different codes. But situation is the same. What has gone wrong in here?

GLCD Library - Hello World

This sketch prints “Hello World!” to the LCD
and shows the time in seconds since reset.

The circuit:
See the inlcuded documentation in glcd/doc directory for how to wire
up the glcd module. glcd/doc/GLCDref.htm can be viewed in your browser
by clicking on the file.


// include the library header
#include <glcd.h>

// include the Fonts
#include <fonts/allFonts.h>

void setup() {
// Initialize the GLCD

// Select the font for the default text area

GLCD.print(“hello, world!”);

void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
GLCD.CursorTo(0, 1);

// print the number of seconds since reset:

What is the make/model number of your LCD? (the photo has pinouts, but no model number).

It has a PSB pin, so it is a ST7920 based display. The ST7920 controller is not supported by GLCDks0108 library. You could use u8glib (

In the examples use "U8GLIB_ST7920_128X64_1X(sck, mosi, cs [, reset])"

Follow the instruction for this controller on this page (below the table)


Thanks oilkarus your solution works fine!