Black Boxes LCD


I know quite a few people have had the same problem but I haven't found a solution yet. Whenever I upload a sketch to my LCD the result is always just black boxes.

My setup and code I found from the Hacktronics site.

Does anyone know if I need to do something to initialize the LCD or is it most likely a wiring problem?


my LCD

... share the details! Make, model, datasheet, circuits you've tried, code you've tried

The model is DEM16101

#include <LiquidCrystal.h>

// Connections:
// rs (LCD pin 4) to Arduino pin 12
// rw (LCD pin 5) to Arduino pin 11
// enable (LCD pin 6) to Arduino pin 10
// LCD pin 15 to Arduino pin 13
// LCD pins d4, d5, d6, d7 to Arduino pins 5, 4, 3, 2
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
#define   CONTRAST_PIN   9
int backLight = 13;    // pin 13 will control the backlight
#define   CONTRAST       125

void setup()
  pinMode(backLight, OUTPUT);
  digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
  lcd.begin(16,1);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
  lcd.clear();                  // start with a blank screen
  lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
  lcd.print("Test");    // change this text to whatever you like. keep it clean.
  lcd.setCursor(0,1);           // set cursor to column 0, row 1

void loop()

ardielcd (183 KB)

Have you checked the LCD's datasheet to verify the pin assignments? Look at section 5 on page 3.

Are they numbered with plain numbers or are they marked by function? According to that, the LCD pins d4, d5, d6 and d7 are LCD pins 11, 12, 13 and 14.

The datasheet I found, which is 10 years old, says that pin 15 and 16 (backlight) are not used.

Thanks! I'll have a look and change around the wires.

Thanks! I'll have a look and change around the wires.

Don't confuse the LCD pin numbers with the Arduino numbers.... that's easy to do. 8)

avrdude: ser_drain(): read error: Device not configured

I'm getting this error. Is there a way to configure it?

Sorry it went away after I pushed the reset button on the arduino a few times. Still not much luck getting rid of the boxes :~

Maybe you should post a diagram (or a table) showing which LCD pin is connected to which Arduino pin.

Did you look at the table in the datasheet?

I know quite a few people have had the same problem ...

That would be an understatement.

... but I haven't found a solution yet.

You couldn't have tried very hard although the search box at the upper right is barely better than useless.
Try your search at google with something like this: LCD "black boxes"


Whenever I upload a sketch to my LCD the result is always just black boxes.

I see that you are using a 16x1 display. This makes the troubleshooting different, so the search I mentioned before may not help too much (sorry about that).

Does your display have one chip (or epoxy blob) on the back or does it have two?

Do you have black boxes in all 16 positions or only in 8 of them?

In your sketch why are you trying to write to the second line of a one line display?


More (bad?) news...

The display in your photograph does not match up with any of the DEM16101datasheets (such as the one in reply #3) that I have found.

The DEM16101 has it's terminals at the upper left of the pc board whereas your terminals are at the lower left.

Many (most?) of the displays with their terminals at the lower left use a non-standard pinout. It looks like I can see the number 16 printed on your display but that does not necessarily mean that pin 1 is at the other end. Some of those non standard pinouts actually go 14, 13, 12 .... 2, 1, 15, 16.

Also - once you get the pinout figured out you have to deal with the fact that a 'single blob' 16x1 display is configured as an 8x2. Positions 1-8 are on line 1 and 9-16 are on line 2.


Yes it's one blob and there are just 8 boxes. Thanks for the information. Sounds like I should've bought a better display!

You may very well find out that once you get your pin positions figured out that the display works properly.

A workable (but untested) sketch would then look something like this:

#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(8, 2);                          // this is what you need for a single chip 16x1
  lcd.print("hello, w");                    // display the left half of the screen
  lcd.setCursor(0,1)                        // this should put you at the center
  lcd.print("orld!");                       // display the right half of the screen

void loop()

Note that the ‘R/W’ pin is not listed in the constructor, make sure that you connect pin 5 of the LCD to GND.