LCD,PC1602ARS, not displaying

I am having issue on my LCD display where I follow this guidelines:

Pin 1 to Arduino GND
Pin 2 to Arduino 5V
Pin 3 to wiper ( this is the middle pin of the 10k potentiometer )
Pin 4 to Arduino pin 12
Pin 5 to Arduino GND
Pin 6 to Arduino pin 11
Pin 11 to Arduino pin 5
Pin 12 to Arduino pin 4
Pin 13 to Arduino pin 3
Pin 14 to Arduino pin 2

and using this code:
/*
LiquidCrystal Library - Hello World

Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.

This sketch prints “Hello World!” to the LCD
and shows the time.

The circuit:

  • LCD RS pin to digital pin 12
  • LCD Enable pin to digital pin 11
  • LCD D4 pin to digital pin 5
  • LCD D5 pin to digital pin 4
  • LCD D6 pin to digital pin 3
  • LCD D7 pin to digital pin 2
  • LCD R/W pin to ground
  • 10K resistor:
  • ends to +5V and ground
  • wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe

This example code is in the public domain.

http://www.arduino.cc/en/Tutorial/LiquidCrystal
*/

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

// initialize the library with the numbers of the interface pins
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(" Text for line 1 of LCD");
lcd.setCursor(0, 1);
lcd.print(" Text for line 2 of LCD");
}

void loop() {

}

However, there is no words being displayed except black boxes in both of the lines. I am using 5k potentiometer. I am not sure if this is the cause of the problem.

Thanks in advance for your help.

However, there is no words being displayed except black boxes in both of the lines. I am using 5k potentiometer. I am not sure if this is the cause of the problem.

Most likely it is the cause. Black boxes in both rows is typically caused by voltage on pin 3 that is too low. This means that your potentiometer is either connected improperly or is defective.

The ends should go to pins 1 and 2 and the wiper should go to pin 3. With the wiper at one end the display should be blank and at the other end you should see the two rows of boxes. The correct position is typically near, but not at, the low end.

Don

Basically, you need about 0.5Vdc to 0.8V dc on the contrast pin (3) of the lcd. You can also get this using a voltage divider consisting of a 10k resistor in series with a 1 k resistor with the 10k connected to Vcc (+5V) and the 1 k connected to ground, and the union of the two resistors (where they connect to each other) tonnected to the lcd contrast pin-3. This will give you the proper contrast to see the text. It may not be perfect but it will certainly be usable until you can replace it with a pot .