Problem Connecting the STN 128x64 Graphic LCD

According to Arduino Playground - GLCDks0108 I try connecting the 5v and Gnd with arduino's same pins but the arduino goes Dump/off i think its taking a lot of power and as i de-link the pins 1 and 2 of my 128x64 stn led the arduino again lights up, i think its taking a lot of power than arduino can sustain , WHat to do? also please clear that how to connect the pot? i mean should i give +5 at vee?

external external Vee (Contrast out) 18 18 18 connect to one leg of 10k or 20k pot
external external Backlight +5 19 19 19 100 to 330 ohm resistor to +5v
Gnd Gnd Backlight Gnd 20 20 20 Also connect to other leg of contrast pot

Datasheet is here!

Connected like its given in here:

contrast stuff is working it means wiring for POT is fine but im getting SCRIBBLED screen as follows:

http://a2.sphotos.ak.fbcdn.net/hphotos-ak-snc7/401504_351577268188455_100000085552940_1374309_1119022170_n.jpg

NI$HANT:
WHat to do? also please clear that how to connect the pot? i mean should i give +5 at vee?

Did you resolve the contrast pot issue?
(I assume you did - and now the contrast pot can adjust pixels from all off to all on)

Do not connect +5v directly to the glcd Vee pin. That can cause damage to the glcd.
Vee is an output not an input.
Vee is the output of a negative power supply built into the glcd module.
Hooking Vee to +5v is shorting the negative voltage output to a voltage potential
that is greater than shorting it to ground.

The pot is used to adjust the voltage between gnd down to vee for the Vo contrast
level input.

As far as the pixels issues go, it is probably a wiring issue.
Have you run the diags sketch, that is in the glcd examples?

--- bill

Bill, Yes im able to adjust the pixels from all off to all on and middle setting too.

I haven't hooked the Vee to anyplace its lying like that im looking for the right pin on the pot to hook it too and now as per your sayings it has to be linked to the Gnd on the pot.

Currently im giving the following connections to the pot:

+5v(of arduino) and +5v Backlight-----(Middle)V0_Contrast-----Gnd and Gnd of backlight

and also in the datasheet its written that logic and LCD operating minimum voltage is 4.5v im giving 4v , is that a issue too?

Moreover as i click the 1(Power) and 2(Gnd) pins to the Arduino power supply the Arduino's system goes OFF(i mean power LED etc goes of) is LCD that demanding on mA's?

And, Yes im running the following GLCD example:(Compiling Fine!)

/*
 * GLCDexample
 *
 * Basic test code for the Arduino KS0108 GLCD library.
 * This code exercises a range of graphic functions supported
 * by the library and is an example of its use.
 * It also gives an indication of performance, showing the
 *  number of frames drawn per second.  
 */

#include <ks0108.h>
#include "Arduino.h"
#include "Wiring.h"
#include "Arial14.h"         // proportional font
#include "SystemFont5x7.h"   // system font
#include "ArduinoIcon.h"     // bitmap 

unsigned long startMillis;
unsigned int loops = 0;
unsigned int iter = 0;

void setup(){
  GLCD.Init(NON_INVERTED);   // initialise the library, non inverted writes pixels onto a clear screen
  GLCD.ClearScreen();  
  GLCD.DrawBitmap(ArduinoIcon, 32,0, BLACK); //draw the bitmap at the given x,y position
  GLCD.SelectFont(System5x7); // switch to fixed width system font 
  countdown(5); 
  GLCD.ClearScreen();
  introScreen();              // show some intro stuff 
  GLCD.ClearScreen();
}

void introScreen(){
  GLCD.SelectFont(Arial_14); // you can also make your own fonts, see playground for details   
  GLCD.GotoXY(20, 2);
  GLCD.Puts("GLCD  version  ");
  GLCD.PrintNumber(GLCD_VERSION);
  GLCD.DrawRoundRect(16,0,99,18, 5, BLACK);  // rounded rectangle around text area   
  GLCD.SelectFont(System5x7); // switch to fixed width system font 
  showCharacters();
  countdown(5);
}

void showCharacters(){
  byte line = 3; // start on the fourth line 
  for(byte c = 32; c <=127; c++){
     if( (c-32) % 20 == 0)
         GLCD.CursorTo(1,line++);  // CursorTo is used for fixed width system font
     GLCD.PutChar(c);    
  }   
}

void drawSpinner(byte pos, byte x, byte y) {   
  // this draws an object that appears to spin
  switch(pos % 8) {
  case 0 : GLCD.DrawLine( x, y-8, x, y+8, BLACK); break;
  case 1 : GLCD.DrawLine( x+3, y-7, x-3, y+7, BLACK);  break;
  case 2 : GLCD.DrawLine( x+6, y-6, x-6, y+6, BLACK);  break;
  case 3 : GLCD.DrawLine( x+7, y-3, x-7, y+3, BLACK);  break;
  case 4 : GLCD.DrawLine( x+8, y, x-8, y, BLACK);  break;
  case 5 : GLCD.DrawLine( x+7, y+3, x-7, y-3, BLACK);  break;
  case 6 : GLCD.DrawLine( x+6, y+6, x-6, y-6, BLACK);  break; 
  case 7 : GLCD.DrawLine( x+3, y+7, x-3, y-7, BLACK);  break;
  } 
}

void countdown(int count){
    while(count--){  // do countdown  
     GLCD.CursorTo(0,1);   // first column, second row (offset is from 0)
     GLCD.PutChar(count + '0');
     delay(1000);  
  }  
}

void  loop(){   // run over and over again
  iter = 0;
  startMillis = millis();
  while( millis() - startMillis < 1000){ // loop for one second
    GLCD.DrawRect(0, 0, 64, 61, BLACK); // rectangle in left side of screen
    GLCD.DrawRoundRect(68, 0, 58, 61, 5, BLACK);  // rounded rectangle around text area   
    for(int i=0; i < 62; i += 4)
      GLCD.DrawLine(1,1,63,i, BLACK);  // draw lines from upper left down right side of rectangle  
    GLCD.DrawCircle(32,31,30,BLACK);   // draw circle centered in the left side of screen  
    GLCD.FillRect(92,40,16,16, WHITE); // clear previous spinner position  
    drawSpinner(loops++,100,48);       // draw new spinner position
    //GLCD.FillRect(24,txtLINE3,14,14, WHITE);  // clear text area that will be drawn below 
    GLCD.CursorTo(5,5);               // locate curser for printing text
    GLCD.PrintNumber(++iter);         // print current iteration at the current cursor position 
  } 
  // display number of iterations in one second
  GLCD.ClearScreen();               // clear the screen  
  GLCD.CursorTo(14,2);              // positon cursor  
  GLCD.Puts("FPS= ");               // print a text string
  GLCD.PrintNumber(iter);           // print a number 
}

STOP! DO NOT hook Vee to +5v or GND!
Vee is output signal not an input.
Vee is a power supply output from an on board power supply that takes
5v (Vdd on your datasheet) from and generates a negative voltage.

Connecting Vee to GND or +5v is shorting out the internal
glcd negative power supply and can damage the glcd or possibly the arduino power supply.

Before proceeding, there are a few things that need to be done.

First go get the latest glcd library software.
The latest library is v3 vs v2 which is what you have.
There is a link to a v3 thread on the ks0108 playground page that has the link
to the v3 project code. (It is just above the photo of the board and glcd)
Here is the direct glcd library page link: Google Code Archive - Long-term storage for Google Code Project Hosting.
v3 is backward compatible with v2, is faster, has many more features, and more extensive
documentation.
v3 also includes more examples, and even a small "rocket" game.

NI$HANT:
Bill, Yes im able to adjust the pixels from all off to all on and middle setting too.

I haven't hooked the Vee to anyplace its lying like that im looking for the right pin on the pot to hook it too and now as per your sayings it has to be linked to the Gnd on the pot.

Currently im giving the following connections to the pot:

+5v(of arduino) and +5v Backlight-----(Middle)V0_Contrast-----Gnd and Gnd of backlight

Now lets take a closer look at how the pot is wired up.
On the ks0108 playground page you can look at the table, or the photo drawing,
but there is more text down lower on the page. There is a "NOTE" just below
the paragraph "Wiring up the external components:" which is just below the
photo/drawing of the board.

In the v3 library package (don't forget to read the download instructions and readme included
in the library) there is pdf and html documentation.
There are drawings that show how to wire up the board including how to wire up the pot.

In the htm documentation go to (click on links)
[GLCD Graphical LCD library]->[Wiring]->[KS0108 Family]

This section has the table as well as wiring diagrams for how to hook the panels
up to a Arduino.

The included pdf documentation in the v3 library package, has essentially
the same information in a slightly different format.

Do have a look at the included documentation as it describes all the API functions
available.

But here is the proper pot connections:

  • 1 leg (can be ground or 5v)
  • ---------------------------- middle to Vo
  • 1 leg to Vee

I say "can be ground or 5v" because many data sheets (like yours on page 9 of your data sheet)
show using VDD (+5v) on 1 leg of the pot, but at normal temperatures, gnd can also work.
So some datasheets and many people use gnd instead of +5v for the other leg.
You will see the glcd library documentation using gnd, vs +5v for this leg of the pot
and this should work fine.
Normally, using either +5v or gnd on the one leg of the pot will work.
Using gnd instead of vcc will save a little bit power.

Is the pot wiring clear?

and also in the datasheet its written that logic and LCD operating minimum voltage is 4.5v im giving 4v , is that a issue too?

Not sure what you are powering the Arduino with, or where/how you measured it,
but 4v is "probabaly" ok.
Some Arduino boards don't have very good power designs and create voltage drops because of that.
That said, If you measured it with the incorrect pot wiring then the voltage
may be artificially lower than it really is if there is a short happening.
What is vcc when the lcd is not hooked up?

Moreover as i click the 1(Power) and 2(Gnd) pins to the Arduino power supply the Arduino's system goes OFF(i mean power LED etc goes of) is LCD that demanding on mA's?

I believe you have a short due to a miswired pot.

Once the pot is wired correctly,
try to run the diag sketch that is included in the examples included with the glcd v3 library.

If you have a problem, post the serial output from the diags and that will help diagnose any issues.

--- bill

Thanks! Bill , yes pot wiring is clear in MY HEAD! and now i'll give precise connection to it, also after the pot wiring is right i will get back with results

OK Bill did POT wiring as:

Gnd-----Vo-----Vee

connecting the pin 1(5v) to +5v arduino and as soon as i connected the Gnd pin 2 of LCD to Gnd of arduino the same happened as quoted

Moreover as i click the 1(Power) and 2(Gnd) pins to the Arduino power supply the Arduino's system goes OFF(i mean power LED etc goes of) is LCD that demanding on mA's?

Something is still not wired right.
(Assuming the glcd isn't blown)

How was it hooked up when you took the photo?
What is different between the wiring when you took the photo
and what you have now?

What Arduino board are you using and how are you powering it?

What value pot do you have?
On the Pot you have:
1 end wire connect to GND and only ground.
middle wire goes to Vo and only Vo (glcd pin 3 on your datasheet),
1 end wire connected to Vee and only Vee (pin 18 on your datasheet)

Are you using a current limiting resistor on the backlight led?

What about the other connections?
Has anything changed from when you took the photo?

Can you take a clear closeup photo of your setup?

--- bill

1 end wire connect to GND and only ground.
middle wire goes to Vo and only Vo (glcd pin 3 on your datasheet),
1 end wire connected to Vee and only Vee (pin 18 on your datasheet)

Exactly connections to the POT are same as you suggested.

Don't you think the LCD would not show anything anyway if the Driver is screwed or LCD is burned , That scribble screen comes out when i just touch the +5v from a USB cut at the other extreme and not even connecting the ground and as soon as i connect the ground the things go off

I think its not burn because it is behaving the same from the very first point when i connected it to +5v and Gnd and nothing else connecting so as to know where the problem would be , i also changed the female headers.

picture:

http://a8.sphotos.ak.fbcdn.net/hphotos-ak-ash4/426108_351498058196376_100000085552940_1374140_611072046_n.jpg

I have a UNO, A Duemilanove(Dark Green), A Clone of Deumilanove (red)

Im thinking that what i should do now is to desolder and solder all the pins directly to my red deumilanove CLONE

Just checked the continuity between pin 1 and pin 2 connected to LCD while the socket was in the BEEP was there it means short circuit between pin 1 and pin 2 of LCD, female socket header is good but im now checking pin 1 and pin2 directly on the LCD

NI$HANT:

1 end wire connect to GND and only ground.
middle wire goes to Vo and only Vo (glcd pin 3 on your datasheet),
1 end wire connected to Vee and only Vee (pin 18 on your datasheet)

Exactly connections to the POT are same as you suggested.

Ok, that is great.

Don't you think the LCD would not show anything anyway if the Driver is screwed or LCD is burned ,

Not necessarily.
When things "fail" they don't necessarily totally break.
Also, if the wires are incorrect or if the software is going haywire, the glcd and the arduino
pins can be fighting each other on the data lines.
But lets assume that things still work and there is just some kind of simple wiring error.

That scribble screen comes out when i just touch the +5v from a USB cut at the other extreme and not even connecting the ground and as soon as i connect the ground the things go off

I'm not understanding what you mean by this. "from a USB cut at the other extreme".
From your picture, the wiring, especially the power, looks very odd.
(more below)

I have a UNO, A Duemilanove(Dark Green), A Clone of Deumilanove (red)

Im thinking that what i should do now is to desolder and solder all the pins directly to my red deumilanove CLONE

I wouldn't do that just yet.

The picture is kind of blury and a bit far away,
but one that I notice is that it looks like you are using USB to power green board, and then
using the green board to power the red one.
Then there is a breadboard with what looks like a standalone Arduino
and some power lines going to it.

It looks like the red board is the one that is driving the glcd.

On thing that concerns me is that there appears to be multiple power supples
and potentially multiple grounds. This can cause problems.
It looks like the glcd is connected (by a purple wire) to the breadboard power rail
which is different than the power going to the red board.
It is very important that the board that is talking to the glcd and the glcd share the same
gound and +5v power supply.

--- bill

That scribble screen comes out when i just touch the +5v from a USB cut at the other extreme and not even connecting the ground and as soon as i connect the ground the things go off

To power the board i took a USB cable and cut it from the other extreme to get the 5v/500mA supply from the laptops USB port to power the pin1 and pin2 of lcd but that was wrong as all the 5v and Gnd should be same between LCD and Arduino

I think the best way to wire the GLCD with Arduino is this Arduino Playground - HomePage only so im going to do the same leaving the POT part same as in the PIC they are using a 10k Preset which i dnt have currently.

Well that will do it. There is probably a ground loop and when you connect the ground,
the different grounds are trying to equalize potential and are creating a huge current draw.

Make sure that the glcd gets its power and ground from the board that is driving it.

BTW, how are you uploading the chip in the red board?

Do you need to have the green board involved?

--- bill

The pot value is not critical.
You can use pretty much anything 10k and up.
10k, 15k, 20k, 25k, 50k, won't matter.
The pot acts as a voltage divider between Vee and the other leg (gnd or vcc).
The larger the value the less wasted current is used as there is always a connection
between the two legs.
So while 10k wastes a small amount of current, the larger values
will waste even less.

--- bill

This is the Direct connection LCD http://a6.sphotos.ak.fbcdn.net/hphotos-ak-snc7/400508_352111928134989_100000085552940_1375765_1923280506_n.jpg as per the Arduino Playground - HomePage

but still nothings on the LCD i think all is power problem i mean till i give it atleast 4.5v its not going to work let me power everthing from 9v battery and then regulated current to lcd would be 5v atleast some high power , The arduino clone works but now it's power green led goes very DIM i think that is mainly bcz of power requirements.

Most Probably its gone! i have another colored one Color LCD - Breakout Board - LCD-08600 - SparkFun Electronics now i'll be running this, any suggestions i'll be using this library http://elec.tkjweb.dk/blog/wp-content/uploads/NokiaLCD.zip , want some help with connections?

The lcd itself draws very little current usually less than 10ma.
Backlights are what draw all the current on an LCD.
And most backlights are 200ma or less.

The photo is blurry but a few things look odd.

I see no current limiting resistor for your backlight.
Are you sure you don't need one? If you need one and are not using
one, then the backlight can draw way too much power and even burn
itself out.
Its hard to tell but the backlight looks like it is either wired backwards
or is using Vin instead of Vcc.

Where is power coming from?
Are you powering it through the DC power connector?

I can't tell from the photo, but it looks like Vo and Vee come from
the pot and are shorted together over on the right side of the board.
On the pot are all 3 yellow wires on different pins of the pot?

The black wire to glcd pin 1 (+5v) looks like it isn't connected to anything.
I can't tell where the brown wire connected to glcd pin 2 goes.

Are the black and brown wires on glcd pins 1 and 2
connected to the 6 pin connector on the left side of the board?
Most 6 pin Arduino connectors use an FTDI pinout. If yours does,
then the power connections may not be correct.
The black wire is on the Vcc pin and the purplish wire is on the
gnd pin. The brown wire is hooked to the CTS pin which on some boards
is connected to ground but on others is not connected to anything.
Depending on the board you may need to move the brown wired
down to where the purple wire is.
Depending on the board design, Vcc from the board may not connect
to Vcc on the FTDI connector when using the DC in jack.

My suggestion with all of this is keep things simple.

Power the backlight and the glcd using VCC and get that power from one place.
It is best to use the Vcc pin on the arduino board.
Use a single ground for both glcd pin 2 and glcd pin 20 and get that ground from one place.
Use a current limiting resistor on the backlight between pin 19 and Vcc
until you know for sure that you don't need one.

You can test the backlight separately. Hook up pin 20 to gnd, then hook up
pin 19 to a 220 ohm resistor then connect the other end of the resistor to 5v.
If the backlight lights up, then use the resistor if not or it is very dim, then use
a smaller resistor value.

--- bill

Bill, The POT is surely connected in the way it was desired as per concepts and as you told me to do so that thing is clear ,about the power intake im not even worried about the backlight yet and im not even powering it on switiching it on bcz i first want the graphics to come up on the LCD that is not coming as such.the moment i power up the lcd pin 1 and pin2 from the same power supply that is now 9volt battery everything goes dim on arduino it means something has shrted between pin 1 and pin 2 of lcd

NI$HANT:
Bill, The POT is surely connected in the way it was desired as per concepts and as you told me to do so that thing is clear ,about the power intake im not even worried about the backlight yet and im not even powering it on switiching it on bcz i first want the graphics to come up on the LCD that is not coming as such.the moment i power up the lcd pin 1 and pin2 from the same power supply that is now 9volt battery everything goes dim on arduino it means something has shrted between pin 1 and pin 2 of lcd

Your description does not match the latest photo and datasheet you provided.
In your latest, photo, the backlight pins (pins 19 and 20 white & blue wires) are hooked up and the power pins
(pins 1 and 2 brown & black) are not connected - at least not the black wire which is +5v for the lcd logic chips.
According to the datasheet, pin 1 is on the left side of the board when the pins are long the bottom.

Are you wiring it up and testing it differently than what is shown in the latest photo?

If you are using Vin instead of Vcc (in the photo it looks like your are powering the backlight (pin 19) with Vin)
I would advise against that.
Using Vin for the lcd logic power (glcd pin 1) could fry the glcd and possibly
the AVR chip as well if Vin is over about 6 volts.
Use the Arduino Vcc pin for both the lcd logic(pin 1) and the backlight(pin 19) power inputs.

There are many questions that I have asked that are still unanswered.

--- bill

Here's the Clear version of connection as per the Datasheet (http://www.sparkfun.com/datasheets/LCD/GDM12864H.pdf):

pin1(+ 5v from VCC) -- pin2(Gnd Arduino) -- pin3(middle pot pin) -- pin4-pin7(8-11 Digital pins on arduino) -- pin8-pin11(pin 4-7 on arduino) -- pin12((alog0)) -- pin13(alog1) -- pin14(reset on arduino) -- pin15(alog2) -- pin16(alog3) -- pin17(alog4) -- pin18(on one leg of pot other left leg connected to Gnd) -- pin19/pin20 not connected do not make sense to connect these as the LCD is not working what i will do with the LED lights :drooling_face: =( :zipper_mouth_face: