16x2 LCD Black Boxes

HI! I hooked up and arduino to a 16x2 lcd but when i uploaded the sketch, all i saw were black boxes int the top row. I looked it up on Google bu nothing was helpful... what do i do. Here is a list of things i have done: 1. rewired everything 2. tried different pins 3. wiggled the wires

but nothing is working.. HELP! =(

arduino2399: I hooked up and Arduino to a 16x2 LCD but when I uploaded the sketch, all I saw were black boxes in the top row.

Incomplete information. Was the LED illumination working?

More to the point, where is the photograph (actually focused, with size no more than 1024 by 768 or so) of your setup and the circuit schematic?

Black boxes means that you are correctly supplying power and have your contrast pre-set potentiometer pretty close to correct, but your sketch is not communicating with the LCD.

arduino2399: I looked it up on Google but nothing was helpful.

Now why does that not surprise me?

arduino2399: 1. rewired everything

Can be a useful approach, but if you wire it up the same as before, unlikely to help.

arduino2399: 2. tried different pins

For what? The pins must match the sketch, if you did not get that right with the first configuration, what would make you think you would get it right with a different configuration? Russian Roulette?

arduino2399: 3. wiggled the wires

Inventive, eh?

OK, so the two common problems beyond the obvious, getting the wiring wrong, are failing to ground pin 5, the R/~W pin (but that is also of course, getting the wiring wrong), and a Chinese jumper wire which does not actually connect. You need to test them by using them to connect a LED in series with a 330 ohm resistor to V*cc* and GND, which is a little easier than using a multimeter.

A third, and why I mention the backlight, is connecting all the 16 pins in reverse. The backlight works, the display shows the blocks (because D7 is driving the contrast pin), but no action.

Here is my generic step by step approach that should work:

(1) If the module has a backlight then get it working properly. This involves only pins 15 and 16 on most LCD modules. Make sure to use a current limiting resistor if there is none on the LCD module.

(2) Get the power and contrast working properly. This involves only pins 1, 2, and 3 on most LCD modules. You should be able to just barely see blocks on one row of a two row display and on two rows of a four row display.

NOTE: The Arduino has not been used yet, except as a possible source for the power needed for the first two steps. Do not try to go any further until this is working. If you don’t see the blocks then no amount of program code will help.

(3) Connect the LCD R/W pin (pin 5) to GND.

(4) Connect the six control and data wires between your LCD module and your Arduino.

(5) Upload your sketch and it should work.


If you have a 16x1 display and there are blocks only on the left half of the row in step 2 then use

lcd.begin(8, 2);

in your sketch.

If you still don’t get a display then make sure that your wiring matches the numbers in the descriptor (or vice versa).

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

If you get a display but it is garbled or has some other problems then try again with a ‘static’ sketch, one that displays a simple message on the top row of the display and then stops. All of your code should be in setup() and loop() should be empty between the brackets.

#include <LiquidCrystal.h>

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

void setup()
  lcd.begin(16, 2);                          // put your LCD parameters here
  lcd.print("hello, world!");
  lcd.print("it works!");

void loop()

If you are still having problems then we need to see a photograph of your setup that clearly and unambiguously shows all of the connections between your Arduino and your LCD module. We also need a copy/paste version of the code that you are actually using, not a link to the code that you think you are using.