Still struggling to get LCD 20x4 to work

I am now on my 4th LCD, they seem to keep failing or its just me doing something wrong. Using Arduino Mega board, and current LCD is a Adafruit 20x4 white type on blue.

Just to keep things simple I am running the “HELLO WORLD” sketch. I am using pins 7,6,5,4,3,2, I have attached a few photos of what the LCD is looking like with different settings on the potentiometer controlling the contrast.

For power I am using a 110 to 12v source and then through a converter to get 5v that is powering both the Arduino and the LCD. See my Fritzing wiring setup attached.

When I install a new LCD it works fine but after a few days starts to go weird as pictured. Anything else I can look at, I have double checked all wiring, solder points, etc.

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

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
//const int rs = 7, en = 6, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(7,6,5,4,3,2);

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

void loop() {


I see you have mounted the LCD in an enclosure. Maybe you are putting some pressure on the LCD.

Try with the LCD just sitting there by itself.

Also if you have a multimeter check your voltages.

I never thought of that. I made the hole large enough so the screen would not touch anything and then used plastic standoffs to keep the "electronics" from touching the plastic enclosure.

I have checked voltages many times, but if its a spike doing it, what can I do?

Just a thought, its says on the regulator/converter output of 5v 15W 3A. If I am going directly from it to the LCD could that be too much watts/amps? Should I be powering the LCD only from the 5v output pin on the Arduino? Would that explain why it works for a few days until it gets fried?

If you measure 5 V on the power supply output with your multimeter, then 5 V it is and that will not be a problem.

But if it is spiking, would the Arduino prevent that from hitting the LCD (using the 5v pin to power the LCD instead)?



Your images indicate grossly defective LCDs. It looks as if you have been supplied rejects.

Your Fritzing diagram is incomplete. It is not the problem, but an incidental reminder - you should not connect the 10k pot that supplies pin 3 on the LCD, to 5 V - leave that end unconnected.

Do you have a reason why the power supply would be defective and generating spikes?

Three of the LCDs were from an Amazon suppler, the last and current one is from Adafruit because I did think I was getting bad ones.

So leave the 5v side of the pot not connected to 5v? In all my research I never saw that wiring config but will give it a try.

No, I do not know if regulator is spiking, just guessing.

Can having that 5v connected to the pot cause the LCD to burn out?

Can having that 5v connected to the pot cause the LCD to burn out?

Not at all. It just makes it more difficult to set the contrast and wastes an extra 500 µA. It was simply a really silly mistake made by designers early in the piece without understanding what they were doing, looking at one early "test" circuit in a datasheet, and then mindlessly copied ever since. Remarkable!

That fault implies either faulty ICs or physical damage to the modules. I can't speak for what happens if you incorrectly initialise the module however - would have to check that out. I think you would have to ridiculously over-voltage the module to have such an effect.

If you reset the Arduino or power cycle it, does it fix itself?

What is inside the box. Is it getting hot?

--- bill

It does not, same after power off/on.

Box is still open, no heat buildup.

One thing I did notice from your diagram is that you are supplying 5v to the dc input jack. Possibly at the moment the reg is passing voltage through but at say 4.7v due to internal regulator components.

Using 5v at this point shouldn't really work as the dc input jack is meant for 7v to 12v dc.

This gives the necessary voltage overhead for the onboard 5v regulator. It requires a higher input voltage to get a regulated 5v output voltage.

To power the board from 5v you need to use the vin pin near the gnd and 5v pins

I would make the suggestion to try connecting the 5v for the lcd pin 2, to the 5v output of the Mega and also the ground pin to the Mega.

For testing over a few days leave the backlight disconnected. I had one lcd whereby the backlight heated the driver chip up enough to cause half of the display to blank.

If you have measured your 5v please make sure it is the range 4.9 to 5.1v for correct operation without causing damage or getting unknown effects.

I don’t know if your backlight has a dropper resistor but I doubt it.

There should be a say 390 ohm resistor in the positive line to the backlight to limit the current to it.

Some experimentation around that value will get you your brightness but with reduced current consumption.

It might be a bit hard to see from that cropped version of the Fritzing layout but it is connected to the 12v power supply.

But I am going to move it from the dc input plug to the vin pin.

I will also power the LCD from the Arduino board and not directly from the 5v regulator and see how that goes, but pretty sure I need to use a new LCD, the 5th one :frowning:

tasmond, the LCD does have a built in resistor.

100R would be a more common value for the dropper resistor.

Yes, some modules are shipped with 0R. If you connect them to 5V, they take a large current that will shorten the LED life.

It should make no difference to the LCD operation unless it damages your USB or other power supply.
Most PCs' USB will provide 500mA and more.

It is easy enough to find the dropper resistor on the pcb. Read the value printed on it. If sceptical, measure value with a DMM. Or measure the current taken by the LED with your DMM. 20mA - 50mA would be acceptable.

You can power the LED however you like. Simply put a 390R resistor in your 12V line. Or a 100R in the 5V line (if necessary)


Of course 5v, I’m so used to working with leds on 12v… :o

The vin is for 5v in not any other voltage.

The two displays are essentially the same (one is upside down).

It appears that the main HD44780 controller chip is working properly since the upper left area of the screen is working normally. This also indicates that the wiring is correct.

The rest of the screen, controlled by the other four auxiliary chips is not working properly.

These two photos are probably pictures of the same device. Do the other devices, especially the one from Adafruit, show a similar condition where the upper left 16 locations work properly and the others fail?

I suggest you remove all the extraneous components and wires, remove the display from the enclosure, use a wall-wart type power supply for the Arduino and LCD, and try again with the Adafruit display.

Stick with the program in your original post since it does not make any changes to the screen after the original message is displayed. This is a good technique for troubleshooting.


Yes, all the LCDs showed the exact same failure patterns after a few days. The two photos are the same screen, the Adafruit currently install in my enclosure.

I will try your suggestion.