Strange 16x2 LCD problem

Hi! This is my first post on this forum!!

I have a Duemilanove(ATmega328) and a JHD162A LCD.

Since two weeks I'm trying to get my LCD to work.

The first time, I interfaced the LCD with a 10K pot and loaded the "Hello World" example without any problems, sans the backlight.
I got it right even without the contrast pot.

Then I tried with the backlight. Nothing was getting displayed, it was all blank.
After reading a few posts on the web, I rewired everything but still it was the same.
Then I inserted pin headers and soldered all wires to a circuit board.
The LCD shows blocks on the right side of the first row with a few dots missing in the centre.

How can I rectify this??
Please help :cold_sweat:
Thanks in advance :slight_smile:

My configuration is

Pin Connected to
1:VSS Ard GND
2:VCC Ard +5V
3:VEE Ard GND
4:RS Ard DP5
5:R/W Ard GND
6:E Ard DP4
11:DB4 Ard DP3
12:DB5 Ard DP2
13:DB6 Ard DP1
14:DB7 Ard DP0
15:LED+ Ard +5V
16:LED- Ard GND

My code is

// include the library code:
#include <LiquidCrystal.h>

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

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}

void loop() {
}

15:LED+ Ard +5V
16:LED- Ard GND

These are the back light pins. Have you checked to see if there is a resistor in the back light? This is often configured by soldered links on the PCB somewhere.

Pin 3 is the contrast control and should be connected to the wiper of a pot, with one end to ground and the other end free.

Having said that if it worked once when you wired it up I can only assume you haven't wired it up correctly the subsequent times.

It appears that your LCD worked OK with the contrast pin grounded and with no power connected to the backlight. Then, when you connected the backlight the display went blank. This would imply that the problem is caused by the backlight but it doesn't rule out a contrast problem as well - both of which were mentioned by Mike.

All LED backlights require a current limiting resistor. Some LCD modules have this resistor on the pc board but many do not. Without a current limiting resistor the LCD module will draw excessive current which will (1) cause the supply voltage to drop to the point where your LCD will not function and (2) ultimately damage or destroy the LED backlight. I suspect that this is what is happening.

Also, it is possible that your LCD is visible with pin 3 grounded (contrast at 0 volts) with no backlight but that it is not visible with the backlight. In this case the addition of the potentiometer will allow you to raise the contrast voltage and make the display visible.

If you disconnect the backlight then hopefully your display should work again. At this point I would add the contrast potentiometer and adjust it for a nice display. If you have a voltmeter you will probably find that the voltage at pin 3 is around 0.5 to 0.9 volts.

Next connect the backlight through a current limiting resistor and see what happens. The datasheets that I have found don't have any useful information but 100 ohms might be a good place to start. Too large is better than too small.

Don

Your soldering job is poor. You need a better job on that. I suspect some shorting going on or you damaged the LCD by soldering for too long. That kind of pattern reminds me of that.

Take a look at a decent soldering job on LCD pins here: