LCD problems

Hello!

We are Caroline and Jukka from Finland/Brazil. We are trying to control Hitachi compliant LCD display with Arduino Duemilanova and Hello World codes from arduino.cc

The problem is that we get only display of two lines, two lines are blank. We cannot get any text printed on the LCD. The LCD is 4 lines and 20 characters.

One obvious candidate for errors would be connections. We copied connections from arduino.cc website.

Thanks for any suggestions!

Jukka

A picture of your hardware, showing the connections, would be helpful.

So would posting the code you are running.

Hello

First this simple message then I hope that I could put pictures of our arduino. :slight_smile:

Carolina

Hello PaulS,

Here are two pics of our connections. What do you think?

http://myy.haaga-helia.fi/~a0703497/parempi.JPG
http://myy.haaga-helia.fi/~a0703497/ihanOk.JPG
Connections we copied from

We tried to print first with this code:

#include <LiquidCrystal.h>

const int numRows = 4;
const int numCols = 20;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(numRows, numCols);
}

void loop() {
// loop from ASCII 'a' to ASCII 'z':
for (int thisLetter = 'a'; thisLetter <= 'z'; thisLetter++) {
// loop over the rows:
for (int thisRow= 0; thisRow < numRows; thisRow++) {
// loop over the columns:
for (int thisCol = 0; thisCol < numCols; thisCol++) {
// set the cursor position:
lcd.setCursor(thisCol,thisRow);
// print the letter:
lcd.print(thisLetter, BYTE);
delay(200);
}
}
}
}

and also with this one:

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

void setup()
{
lcd.print("hello, world!");
}

void loop() {}

Thanks!
Carolina

You should look at the data scheet of the lcd to see what each pin is. Or maybe there is a desciption on the pcb of the lcd.

The pins don't need to be in the same order.

The potentiometer is not used in either code example. Remove it.

You have two black wires connected to the potentiometer. I've never seen a potentiometer quite like that one, so I'm not user about the connections on it. But, the two black wires from the LCD are supposed to go to ground. Instead, they go to two different taps on the potentiometer. I can't see that a ground connection is made, at all.

I think that that is why the LCD does not show anything. It is not being properly grounded.

The potentiometer is not used in either code example. Remove it.

That's the contrast pot. It isn't used by the sketch, but have you tried turning it?

I've never seen a potentiometer quite like that one

:o

Carolina:

Your potentiometer is OK. The white haired programmers who hobble around with canes understand that before the introduction of printed circuits all potentiometers looked like yours.

You have an extra wire connected between LCD pin 7 and Arduino pin 10. This probably is not the source of your problem but it shouldn't be there.

You have a problem with 'lcd.begin()'. The correct syntax is lcd.begin(cols, rows). You have it backwards in your first example and missing from your second.

You have a problem with 'LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);' in your second example. This indicates that the LCD R/W pin (pin 5) is connected to Arduino pin 11 when in fact you have grounded it.

I recommend that you start out by abandoning both of your examples and instead use the 'HelloWorld' example that comes with Arduino v0017. Use cut and paste to avoid typing errors.

Also: when you post code you should take advantage of the formatting provided by the forum software. Highlight your code and click the 'code' button (it looks like a '#').

Don

The white haired programmers who hobble around with canes

Oi! I resent that. My hair isn't all white yet. ;D

Quote:
The white haired programmers who hobble around with canes

Oi! I resent that. My hair isn't all white yet

Mine is. No cane yet....

Don

Thanks a lot guys for the help! We will try new connections on Sunday, if we could get something on the screen.

Jukka from Finland

A couple things to take a look at, might have been explained already but I just did some quick-reading.

The backlight doesn't seemed to be plugged in, which wouldn't stop it from working but may not be able to see it either. :slight_smile:

And also, pin 5, R/W seems to be connected to, uh, some pin. lol, if you're using the examples from 0017 IDE, they don't mention anything.. but the RW pin should be grounded. Run a pin from the RW pin to ground.

Woops, just read that Floresta pointed out kind of the same thing, but I'm not seeing it grounded, unless it was updated.

Actually, it looks like you grounded the looks at my datasheet D0 (pin7)

Try removing that connection and trying again, I'm not sure how that effects it.. but I can foresee problems.

But other than that.. all I can think of is experimenting with the potentiometer. One of my LCD's you need to get within a few MM of the right contrast, or it's nearly impossible to see, or just blocks. :slight_smile:

Dear All,

We got our working now. Thanks a lot for help! This is probably why Arduino is best for testing, because of the large user base.

As a feedback, the potentiometer has nothing to do with the problems, extra cable seemed to have.

Quite good signal-to-noise ratio on this forum. I hope Arduino could come a life-long hobby for me.

EDIT: BTW, do you know what is the newline character for this model of LCD?

Jukka

BTW, do you know what is the newline character for this model of LCD?

These LCDs are not really designed for the display of long strings so they do not have a newline character as such. It's a problem for a general purpose library since the location of the start of the new line depends on the particular display. In other words, you can't just tell it to go to the 'next' line, you must tell it to put the cursor at a specific location.

Don