Introduction: Arduino Powered GLCD (Graphic LCD) - I Made It at TechShop

Picture of Arduino Powered GLCD (Graphic LCD) - I Made It at TechShop

Displays are always nice. So far I've just been demonstrating how to use 7-segmented displays to display numbers using very few resources. But what if you want to display text? Or pictures? Or both? Well in order to do that, you're going to need a simple LCD screen.

Now there are simple led screens out there right now which work on serial communication and only display text. That might be good enough for you, but I like flexibility. With a GLCD, I can use different fonts, show pictures, and even animations!

What's also really nice is that the GLCD I'm using is only $20. Granted, this is a little bit more involved to program and to get to work above the super easy Serial.print("Hello World") commands.

As always, I made it at TechShop.
http://www.techshop.ws

Step 1: Materials

Picture of Materials

Be prepared for wires. Lots of wires. I made a jumper cable specifically for my device. You might not need it but it sure makes everything look a lot nicer.

1. Arduino Uno $40
This CAN work, but it takes up just about all of the pins. If you want to do anything else, I recommend a Mega $60

2. GLCD $20
based on a KS108B lcd
from sparkfun.
https://www.sparkfun.com/products/710

3. Breadboard

4. Header pins (row of 20)

5. Jumper wires

6. 10k ohm potentiometer (for contrast control)

7. 1k ohm resistor

8. soldering equiptment

Step 2: Circuit

Picture of Circuit

Heads up. There is going to be soldering. Also, to be clear, I am going to be using a Mega board. The wiring for the Uno is NOT THE SAME. But luckily, there is the wiring digram for that available in the provided manual in the GLCD library (next step).

1. Get the header pins and solder them to the GLCD. It is critical that a good connection is made! Just sticking jumper cables in will not cut it.

2. Follow the wiring diagram for the Mega version. Keeping track of what pins do what.

On the GLCD
1,2: Power/GND for the screen
3,18: Contrast through potentiometer
4-11: Data pins
12,13: Left/Right screen
14: Reset (Connect to V++ with 1kohm resistor)
15: Read/Write 
16: D/I
17: Enable
19,20: Power/GND for the Backlight

Make sure to get the power connections right. If you do not you could damage the GLCD.

Step 3: GLCD Library

Picture of GLCD Library

First thing you are going to need to do is download the library for this GLCD. It can be found at:
http://code.google.com/p/glcd-arduino/downloads/list

To INSTALL:
This library should be unzipped into a folder named glcd in the arduino libraries
directory. If you already have a folder called libraries in your Arduino
sketchbook directory, unzip the glcd files there. If not, create a
folder called libraries in the sketchbook folder, and drop the glcd library
folder here.

To locate your sketchbook directory
bring up the IDE and click on [File]->Preferences

You sketchbook directory can be anywhere you want.
The location that the IDE is looking for you sketchbook directory is
in the text box right there at the top of the "preferences" dialog.

Wherever that directory is, you will need to create a directory called
"libraries", then extract the zip image into that directory.
So you will end up with
{sketchbook directory}/libraries/glcd

Then re-start the Arduino programming environment, and you should see the glcd
library in the Sketch > Import Library menu.

Alternatively you can install the glcd library directly in the arduino distribution
by placing it in the libraries directory where the arduino distribution
was installed. For arduino release 0018 and later that would be:
{Arduino installdir}/libraries
So you will end up with {Arduino installdir}/libraries/glcd

Then re-start the Arduino programming environment (IDE), and you should see the glcd
library in the Sketch > Import Library menu.

After you unzip, then follow instructions in glcd/readme.txt file.
For full details of the library see the included HTML documentation
in glcd/doc/GLCDref.htm

Step 4: Arduino Programming

Picture of Arduino Programming

Now then. On to actual programming!

When ever you want to use the library, remember to include

into the sketch.

The library should automatically detect what type of board that you have. However, you can override this manually and select certain ports to act as the display pins. This may or may not be useful to you.

When ever you want to update the GLCD, you can access it with GLCD.[command]. Keep in mind that this does not need to be run all the time. The display will retain the information given to it until changed. When it does update it writes over what is on top, but it does not automatically clear anything. If you write over big font with smaller font, both will be visible because the new stuff did not fully displace the old.

There is a lot of examples included with the library. If you are having trouble, run glcdDiag. It will run a diagnostic on the serial monitor and it might tell you what's wrong.

Here's a simple example.

/*
  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

// include the Fonts
#include

void setup() {
  // Initialize the GLCD
  GLCD.Init();

// Select the font for the default text area
  GLCD.SelectFont(System5x7);

  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:
  GLCD.print(millis()/1000);
}


WHEN IN DOUBT, CONSULT THE REFERENCE MATERIAL

Comments

glomms (author)2017-02-16

I
keep getting the same error when compiling this sketch: Error compiling for
board Arduino/Genuino Uno. I am using an Arduino Uno and have Arduino/Genuino
Uno selected in Tools. I also have ArduinoISP selected for Programmer in Tools.
I have same error when trying to compile unzipped GLCD_BigDemo from my GLCD
folder I downloaded into my library. Any help is appreciated.

JoeK17 (author)glomms2017-03-31

Hi "GLOOMS" ... pls read this link, might help...

http://playground.arduino.cc/Code/GLCDks0108

DevaRags (author)2017-03-17

How can we connect arduino nano with GLCD ?

EmeirM (author)2017-02-14

someone send link for learning using GLCD and ARDUINO. im newbie to this.

fahmi_ibnu (author)2014-02-11

error: #error "Arduino pin mapping not defined for this board"..i dont know this problem..please help me..

amandaghassaei (author)2012-09-11

nice, what did the commands look like to draw the circle and lines in the main image?

madebyjoe (author)amandaghassaei2012-09-11

There are commands for making regular polygons like circles and squares, but for something as complicated as that, it was a bitmap placed in an image class. Looks something like:

Image_t icon;

icon=yourBitmap; //this is created in the header file as the hex representation of the bitmap

GLCD.DrawBitmap(icon, 0, 0);

About This Instructable

51,798views

30favorites

License:

More by madebyjoe:Arduino powered GLCD (Graphic LCD) - I made it at TechShopArduino Bluetooth Serial Connections! - I made it at TechShopAndroid Tablet PS3 / Xbox360 Controller Mount - I made it at TechShop
Add instructable to: