Arduino LCD lights up but doesn't print anything

Hello

I am a complete newbie and im doing a project for my studies.

I have hooked up the arduino with lcd and it seems that everything is hooked up correctly.
The lcd lights up and I can change the contrast with the potenciometer. However, whenever I try to print the hello world nothing appears. Also, I heard something about squares appearing when the lcd is hooked up and I dont see any squares as well.

Here is the code

// 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
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

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() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis() / 1000);
}

I am also adding some screenshots of what the setup looks like.

Is there any specific wires which are in charge of this? Maybe I should try to wiggle or replace them but which ones tho?

Thank you for your help!

I can provide more photos if this is not clear enough

How can you see the change in contrast if the squares do not show up?

Try this: disconnect everything except the ground and 5V (Vss and Vdd) from the LCD. Connect the VO pin to ground (disconnect the pot). You should see a line of blocks on the top row of the LCD.

lcd 1602 blocks

Is this what you see?

I guess you mean like this?

As soon as I removed 2 - 5 arduino pins from the lcd it went black and there is nothing showing up on it

Also by change of contrast I meant that when I turn the pot the screen gets darker or brighter

You will never see the "Hello World" message or a clear count of millis. You are overwriting the display as rapidly as the processor can send data to the display, much too fast for your eyes to see, and likely too fast for the actual LCD display to respond. Put some delays in the code for testing to give some time to read the display.

Thank you for the answer david.

I am still not sure about what groundFungus said yet.
Because I connected everything like that and nothing shows up on my lcd right now.

So I wonder what could this be

Sorry, I should have included to connect the backlight pins, A and K.

A being the resistor and K goes to ground right?

I did this like ssen in photo.
Still not working tho

I have a 16x2 LCD wired to an Uno and the code actually works fine even without a delay. The display is updated rapidly, but the data only changes once per second and the top row with the "hello world " is persistent.

Yes, the backlight looks to be wired right.

Your breadboard has the split power rails. You need to jumper the split so the whole rails are powered as shown in this image. Sorry, I missed that before. Due to the split the LCD is getting no power.

Yes this fixed it!!
Thank you soo much.
So I assume when I connect everything back it should work fine now? :slight_smile:

If adding the jumpers helps, go ahead connect the rest of the wires and the pot. But be aware that 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 (middle terminal) to LCD pin 3 (V0). The other end of the pot is left disconnected. So the pot is a variable resistor. Actually I find that a 1K fixed resistor from ground to Vo gives me satisfactory contrast on virtually every LCD that I have tried.

Sorry, I read the code a bit too fast, didn't notice the hello world was on a separate line, and the millis count was being divided by 1000 - meaning you are repeatedly sending the same number to the displays dozens if not hundreds of times a second.

I sure hope so. If not we will get you there.

Like I said, I tested the code on my setup and it does work.