16x2 LCD shows only Black Boxes

Hi Team,
I’m very new to Arduino.
Currently I’m testing Arduino with 16x2 LCD
Code is as below:

#include <LiquidCrystal.h>

int Contrast = 70;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
analogWrite(6, Contrast);
lcd.begin(16, 2);
lcd.clear();
}

void loop() {
lcd.setCursor(0, 0);
lcd.print(“Hello World”);
// delay(5000);
lcd.setCursor(0, 1);
lcd.print(“Hello”);
// delay(5000);
}

However LCD shows only black boxes when code is burned into Arduino.

I tried even with Potantiometer as well as current limiting circuit, still no change in output.
I’m attaching herewith picture of the connection made.

Kindly help…

LCD Pin ----> Arduino Pins

1 → GND
2 → 5v
3 → potantiometer middle pin
4 → RS(pin 12)
5 → GND
6 → E(pin 11)
7 →
8 →
9 →
10 →
11 → pin 5
12 → pin 4
13 → pin 3
14 → pin 2
15 → register with one end to 5v
16 → GND

register is 220 ohm and potantiometer is 10k

I’m getting contrast change with change in potantiometer but no output on LCD except black boxes.

It is absolutely essential to solder the connections to your display.

Don

Guys Hard to believe....
But Soldering does the Magic..

Finally Module is working great and as expected...

May I know what do you guys mean by soldering the LCD make it works? Because I am still struggling to make my LCD shows the words coded instead of just showing boxes...

alvenleo:
May I know what do you guys mean by soldering the LCD make it works? Because I am still struggling to make my LCD shows the words coded instead of just showing boxes...

LCD Connections.jpg
It means that this picture shows an LCD module sitting on top of a pin header that is inserted into a breadboard.

The header pins are loosely poking through the plated-through holes in the LCD board, but they are not all actually connected to the pads on the PCB. :astonished: Some might connect, but others do not.

It is a not universally realised matter in electronics, that one component must be electrically connected to another for current to flow and the device to work. It is kind of like sitting the power plug in the socket holes but not actually pushing it in to make the connections. :grinning: