[Solved] 20x4 lcd problem. (Spent 1.5 day)

Note: The issue has been solved. It was just soldering problem.

Hi. I have spent several hours to find out and decided to ask here.

I bought 20x4 lcd and connected to Arduino Mega.
Followed this for schematic: http://tronixstuff.files.wordpress.com/2010/07/schematic12.jpg
And the code: http://tronixstuff.files.wordpress.com/2010/07/2004lcddemo2.pdf
Datasheet: http://tronixstuff.files.wordpress.com/2010/07/2004-lcd-data-sheet.pdf

Backlighting and contrast is ok. But i couldn't print anything.
And i couldn't understand why my display looking like this http://www.watercoolinguk.co.uk/images/product_images/large/20x4-3.jpg?1402594815834

Is the problem might be related with blank 2&4th lines?

Thank you.

probably the internal offsets of the visible characters differ frm

make a sketch with this loop

lcd.goto(0,0);
for (int i = 0; i< 200; i++)
{
Serial.println(i);
lcd.print( i % 10);
delay(100);
}

does it print at a sudden moment on line 2?

Actually i can't print anything on any line :slight_smile:

I also tried your code without goto function (because my library doesn't support it) but no result again.

I just wanted to understand that is the problem related with the display or the code.

Thanks in advance.

your title states Re: 20x4 lcd isn't showing 2 and 4th lines.
and now you say Actually i can't print anything on any line

so which of the 2 is your problem?

where did you buy the LCD?
do you have a link to the datasheet?

And i couldn't understand why my display looking like this http://www.watercoolinguk.co.uk/images/product_images/large/20x4-3.jpg?1402594815834

looks like wrong connections or voltage? is the device 3.3V and are giving it 5?
again - to be answered by the datasheet?

First of all i am trying to understand if there is any hardware or wiring problem. If not i will check the code side.
And you say it seems "wrong connections or voltage" problem.

Ok, here is the datasheet http://www.watercoolinguk.co.uk/images/product_images/large/20x4-3.jpg?1402594815834

Thanks in advance.

Ok, here is the datasheet http://www.watercoolinguk.co.uk/images/product_images/large/20x4-3.jpg?1402594815834

that's no datasheet .... .

OMG who put that link :slight_smile:

Sorry. http://www.systronix.com/access/Systronix_20x4_lcd_brief_data.pdf

And i couldn't understand why my display looking like this http://www.watercoolinguk.co.uk/images/product_images/large/20x4-3.jpg?1402594815834

Your display is looking like that because it is not properly initialized. You will get the same display even if you do not connect the Arduino (if you connect just the power, contrast, and backlight - pins 1, 2, 3, 15, and 16).

First of all i am trying to understand if there is any hardware or wiring problem. If not i will check the code side.

Any combination of those three can cause this problem. Did you connect LCD pin 5 (R/W) to GND.

Don

Did you connect LCD pin 5 (R/W) to GND.

Yes, i did.

It has been 12 hours trying to solve this and i am really curious about the mistake that i couldn't see.

It has been 12 hours trying to solve this and i am really curious about the mistake that i couldn't see.

Post a picture and give us a chance to see what might be the problem, otherwise we are just guessing. We need a photograph that clearly and unambiguously shows both ends of all of the connections between your LCD and Your Arduino.

Here's another suggestion. Get rid of the code in your loop. Leave the brackets with nothing in between them. If your display were working then the code in your loop would soon overwrite the entire display.

Don

The photo shows that the display hasnt been initialized. I can also deduce power and contrast are OK if its showing the two lines, but you wont have any visible text on it, until it is initialized.

Now, as said, without the wiring it gets hard, and we also dont know if any data is being printed into it, so place an oscilloscope in each of the data lines you are using to see if the display is actually getting data from the host uC

lstsly the schematic shows an arduino duemilnueve, which is more similar to the uno that to a mega. I guess that could be an issue depending on what you have on your code but clueless without further details

Now, as said, without the wiring it gets hard, and we also dont know if any data is being printed into it, so place an oscilloscope in each of the data lines you are using to see if the display is actually getting data from the host uC

What exactly would you look for? I have been dealing with these LCDs for decades and never considered using an oscilloscope for troubleshooting. It is the timing of the data that is important so a logic analyzer would be a better option than an oscilloscope, but I never considered using one of those either.

lstsly the schematic shows an arduino duemilnueve, which is more similar to the uno that to a mega. I guess that could be an issue depending on what you have on your code but clueless without further details

How could that be an issue? The code would be identical.

Don

floresta:
What exactly would you look for? I have been dealing with these LCDs for decades and never considered using an oscilloscope for troubleshooting. It is the timing of the data that is important so a logic analyzer would be a better option than an oscilloscope, but I never considered using one of those either.

Anyone serious about working with electronics should have an oscilloscope to test when things dont work.
Yould you drive a car if you were blind?

What data is in there is usually not relevant, unless there is some signal contamination. However, sometime a pin is not properly initialized and there is nothing there. this is what you will e looking for. Is there any data on the pin at all? If it is check all the pins. Still not working? Try another code. Still nothing? Time to get another display.

In most cases litle things on the code mean that the data on the pin will not be present. For example, the other day I was making a code to someone with an older arduino uno, using an atmega8. I could not get one of the motors to work. Checking with the oscilloscope the output was dead, so I went to check the datasheet and the atmega8 only had 3PWM and not 6, so i had to move one of the pins to a valid output.

Another example: Cortex STM32f103. LCD not working. Oscilloscope. Aparently for some reason reset assigned to PIN PB7 would not return anything. The pin was OK, so likelly some bug on the code. Attached reset to VCC display worked, so i had to change the pin to PB8 on the code.

Yet another example: SD card not operational at full Speed. Worked half speed, Full speed nothing.
Oscilloscope. Found signal data to be to low and distorted. Traced the circuit, apparently instead of using a buffer for the 5 to 3.3V the manufacturer employed 10K resistors on the data lines. Replaced resistors with 1K, card now working.

How many hours would you be struggling with any of these problems?

floresta:
How could that be an issue? The code would be identical.[/color]

Its not quite identical.
Some pins relly on interrupts to archieve certain functions. Those interrupts may be in a different location on the mega.
Colour screens for example have specific shields for the mega and uno, yet you could plug the uno shield on the mega (all pins are there). now guess why it wont work :wink:

casemod:
Now, as said, without the wiring it gets hard, and we also dont know if any data is being printed into it, so place an oscilloscope in each of the data lines you are using to see if the display is actually getting data from the host uC

Actually, I"m with don on this one. I've never used a scope to debug a simple connection issue.
When writing and debugging the actual low level code to drive a piece of h/w I've
sometimes used a logic probe to check signal levels, and often a logic analyzer to verify
signals and timing.
But in this case we aren't debugging the low level code but simply the wiring.
Visuals is often good enough for that.

I'm also guessing that the photo of the LCD we've seen so far is a stock photo
and not a photo of the actual LCD being used.

So the most important thing we need at this point is some photos of the actual
Arduino, LCD, and wiring being used since the most common issues with these types of LCD problems is
mis-wiring, or poor connections which can include bad solder joints.

--- bill

Hi again.
First of all the problem is solved after 1.5 day :slight_smile:

We have tried many many things with one of my friends from Australia :slight_smile:
Then he suggested me to check soldering.

I measured resistance between cables and soldered pins' heads. It was all fine.
Then i prepared the pictures to send here.
Then i noticed that i measured the resistance between cables and soldered pins not the resistance between cables and Pcb channels.

Then i tested again and found out that there is a problem at 5th pin. Soldered again. And worked :slight_smile:

Thank you so much for the help.

bperrybap:
Actually, I"m with don on this one. I've never used a scope to debug a simple connection issue.
When writing and debugging the actual low level code to drive a piece of h/w I've
sometimes used a logic probe to check signal levels, and often a logic analyzer to verify
signals and timing.

And your point is?
I believe we are doing the same thing.

bperrybap:
I'm also guessing that the photo of the LCD we've seen so far is a stock photo
and not a photo of the actual LCD being used.

The OP gave a description and backed up with a photo. Unless he was lying (why would he!?) this is a good hint.
So again, whats your point?

Glad to know its finally solved :wink:

Thank you casemode :slight_smile:

casemod:

bperrybap:
Actually, I"m with don on this one. I've never used a scope to debug a simple connection issue.
When writing and debugging the actual low level code to drive a piece of h/w I've
sometimes used a logic probe to check signal levels, and often a logic analyzer to verify
signals and timing.

And your point is?

A scope is not particularly a good tool to debug something like this.
A scope is typically used for looking at analog signals not for simple
digital signal levels.
Plus scopes (at least good ones) are much more expensive than other tools
that are better suited for looking at digital signals.
In close to 40 years of embedded s/w development I can probably count the times
I've needed a scope on 1 hand. And all those were all related to subtle analog ringing issues.
(Now for brining up a new high-speed h/w design, that is another story, but we aren't doing that here)

In this situation, we are working with known working s/w, and the signal transitions
going from the AVR to the LCD are not very fast so analog noise is not likely to be an issue.
Assuming the LCD isn't damaged, then all that is left is wiring/soldering
issues.

Assuming you did want to use a scope as expensive logic probe, then what?
The advice you gave was to just look at the data lines.
Just looking at the data lines isn't going to tell you much, you may see a few lines
wiggle and still be no closer to knowing what the issue is.
Plus it requires a substantial amount of knowledge to know what sort of "wiggling"
on the data lines would be normal.

From the final description, pin 5 (lcd R/W) was the issue.
So using a scope to look at the data lines wouldn't have helped.

In this, case, just as Don and I suspected, from seeing so many of these LCD issues,
the issue was a wiring/soldering issue and often those issues can be seen from
visual inspection which is why we asked for photos of the actual setup.

casemod:

bperrybap:
I'm also guessing that the photo of the LCD we've seen so far is a stock photo
and not a photo of the actual LCD being used.

The OP gave a description and backed up with a photo. Unless he was lying (why would he!?) this is a good hint.
So again, whats your point?

My point is that people often post photos of "their LCD" or similar products from photos on the web
that look like what they are seeing on their LCD instead of photos of their actual h/w being used.
It isn't that they are lying. No. They are just posting a photo that shows the same visual
rather than showing it on their h/w.

The solder joints in the photo all look really good in the photo we were shown,
plus the link has a look of being a product page since it is off on a commercial site
vs a personal photo.
That is what lead me to suspect it might not be a photo of the actual LCD in use.

Easy enough to settle.
beingobserver, is the link to the photo of the LCD you posted the actual LCD
you are using or was it a photo from a product web page?

--- bill

First of all thank you everyone for explaining some of diagnose tools. It was really informative for me.
And now i have better understanding of how i should use this forum.
I should have posted the pictures of my setup and even soldering.
But on the other hand if i could have thought the importance of sending soldering pictures i would have found the issue :slight_smile:

beingobserver, is the link to the photo of the LCD you posted the actual LCD you are using or was it a photo from a product web page?

Yes, it was from a web page. Because my phone's screen is broken by my son :slight_smile:

Thank you again.
Regards.