16x2 lcd not initializing

16x2 lcd not initialized properly.I wired with uno carefully and i used library example program(hello world) but still it showing black boxes on top row.please help me

.I wired with uno carefully

It may help if you show us a clear picture of your wiring.

i used library example program

Which library. Post the sketch that you uploaded to your Arduino. Which Arduino?

Please read the "how to use this forum-please read" stickies to see how to properly post code and some hints on what we need to know in order to help you. See # 7 & 11.

Check if the lcd is broken.

Unsigned_Arduino: Check if the lcd is broken.

Isn't that what he is trying to do?

By the way...

Ditch the string class before you post the code.

You really should correct this statement in your signature.

Don

i have used the below code
(s0rry i wiil send the image and ino file later)

#include<LiquidCrystal.h>

LiquidCrystal lcd (12,11,5,4,3,2);

void setup()
{
lcd.begin(16,2);
lcd.SetCursor(0,0);
lcd.print(“Hello world.!”);
}

void loop()
{
}

Do you have a contrast potentiometer connected? Does adjusting the contrast pot have any effect?

yes i have connected potentiometer for contrast but still it is not working

dharanivel:
i have used the below code
(s0rry i wiil send the image and ino file later)

The code should be the same as the “.ino” file. Do not “attach” “.ino” files. Read the posting instructions and post the code as code using the </> icon.

Until we get a proper photo of all your assembly, taken in outside daylight with a real camera, we probably cannot help you.

#include<LiquidCrystal.h>

LiquidCrystal lcd (12,11,5,4,3,2);

void setup()
{
 lcd.begin(16,2);
 lcd.SetCursor(0,0);
 lcd.print("Hello world.!");
}

void loop()
{
}

The RW pin is not configured in the constructor so the LCD RW pin should be connected to ground.

i had connected r/w pin to gnd pin in arduino.but still not working

floresta: Isn't that what he is trying to do?

I mean on the hardware side like a broken pcb.

Did you connect the backlight?

Maybe your lcd displays only with the backlight.

dharanivel:

#include<LiquidCrystal.h>

LiquidCrystal lcd (12,11,5,4,3,2);

void setup()
{
lcd.begin(16,2);
lcd.SetCursor(0,0);
lcd.print(“Hello world.!”);
}

void loop()
{
}

Next time you post code, post the actual code that you’re using. That code doesn’t even compile (hint: your computer can copy and paste better than you can manually).

Paul__B:
Until we get a proper photo of all your assembly, taken in outside daylight with a real camera, we probably cannot help you.

73cffe4fed646cad15315013c61078099751624a.jpg
a7695bd716b2d15e3704a6688d4345096d3570bb.jpg
Ugh! There was a reason I said what I did!

Unsigned_Arduino:
Did you connect the backlight?

Maybe your LCD displays only with the backlight.

Well, yes, it is pretty difficult to see what si going on in the dark, but

dharanivel:
it showing black boxes on top row.

is probably pretty specific, so the dodgy connections to the potentiometer are probably not the problem.

Just a little memo which I always remind - do not connect the potentiometer to Vcc. Leave that end unconnected. This is not the problem here but makes working with the display much easier. Connecting the backlight will make things much easier and if I had time, I would poke around in the murk and double check the connections shown.

Unsigned_Arduino: . . .

Don't touch the string class.

Ever.

That's even worse.

Don

HerE iS a HinT. capitalization Makes A Difference.

Don

floresta: That's even worse.

Don

Why are we talking about this here?

In the lower picture (who did upload these pictures?) it looks as if pin #1 (VSS) of the lcd display receives a red wire and pin #2 (VDD) a brown wire. If red means 5V and brown means GND then these wires are swapped. The wiper wire (also red) seems to be positioned OK that is connected to pin #3 (V0). Actually your pictures give the impression that there is some backpack print with connectors at a 90 degrees angle. Hard if not impossible to judge the connections. Please have a look at https://thesolaruniverse.wordpress.com/2018/07/07/how-to-display-arduino-sensor-data-on-a-classic-lcd-display/

It looks as if the LCD header pins are properly soldered with respectable Dupont wires.

However the potentiometer looks as if the wires are just twisted by hand. This in unwise (tm).

Quite honestly, you should get a visible display if you forget about the pot. Connect #2 to 5V. #1, #3 to GND with proper Dupont wires.

David.