16x2 lcd does not display any text (only squares)

for three days I checked and changed all jumpers and connections, ı changed potentiometer, breadboard even ı changed the lcd(bought new one). At first ı could see the texts properly on lcd then it started to print out random characters and then I could only see blank squares. In each test I checked potentiometer.
My code:

LiquidCrystal lcd(11,12,30,32,34,36);
void setup() {
  // put your setup code here, to run once:
void loop() {
  // put your main code here, to run repeatedly:

get rid of everything else to test only the screen… (I can even see many wires going nowhere)

please edit your post, select the code part and press the </> icon in the tool bar to mark it as code. It’s unreadable as it stands. (also make sure you indented the code in the IDE before copying, that’s done by pressing ctrlT on a PC or cmdT on a Mac)

A 16x2 LCD connected to my Mega according to your code and running your code works fine. So it is not the code, it is by elimination your hardware. Like @J-M-L says, disconnect everything but the LCD and try the code. If it does not work, check the contrast adjustment, carefully inspect the wiring and test or replace the jumpers. Post a clearer photo of the wiring. You would be surprised how many times that we have spotted wiring problems that the poster did not see. More eyes are better.

may you can adjust the brightness at the rear side of the LCD.

I got rid of everything except lcd and I edited my post.

I did everything you said still not working. I checked all jumpers and connections to Arduino. At each start of Arduino I always check the contrast adjustment. I even suspected that 10k Potentiometer is not working so I replaced it with a new one still not working.

I don’t know how to change the brightness of a direct LCD. It doesn’t have a I2C module.

ok, you are right

1 Like

Well, like I said, the code and wiring work with my Mega and LCD so it is not code or the way that it is wired.

How about that nice clear photo of the wiring?

A difference between how your LCD and mine is wired has to do with the contrast adjuster. I find that a 1K fixed resistor from ground to Vo gives me satisfactory contrast on virtually every LCD that I have tried so I do not use the pot.

And speaking of the pot, almost all of the LCD tutorials have the wiring of the contrast pot wrong. It is a mistake that has been perpetuated through the years. The right way is to wire the one end of the pot to ground and the wiper to LCD pin 3 (V0). The other end of the pot is left disconnected. So the pot is a variable resistor.

after I replied to your comment i have decided to check the jumpers again and i don’t know how this is possible but i found out that the jumpers on rs, e and potentiometer was not working. After i changed these jumpers it is now wor

king. Thanks to all.

Kicking in a bit late here but yes, one of the obvious answers to this very commonly cited problem here is faulty jumpers and good advice is to test them by zig-zagging them all in series across a breadboard using a LED and series diode with 5 V from the Arduino.

The fact that you had the “squares” indicates that you did have the contrast potentiometer working and set appropriately though removing the spurious connection to 5 V makes setting easier and reduces the current draw by 500 µA which is useful if operating from a battery. :sunglasses: Since 10k is the wrong value for the potentiometer (1k would be correct), connecting both ends to ground actually makes contrast setting even easier.

I am most pleased to see that groundFungus has taken up my vendetta against this silly blunder. :+1:

1 Like

This topic was automatically closed after 120 days. New replies are no longer allowed.