Fix Corrupted 16x2 LCD Display Problem

Project Description

16x2 LCD character display, which initially worked well in an Arduino project, started to display corrupted characters randomly. We needed to identify the root cause of this problem and fix it.

This photo below shows normal, uncorrupted output from display. We see a couple of lines of text with a few words and a number.

Normal 16x2 LCD output - a couple of strings and a number
Normal 16x2 LCD display output - a couple of strings and a number

But here we see garbled text on the second line as our seconds counter (a number in the end) reaches 121.

Corrupted random characters on 16x2 LCD display
Corrupted random characters on 16x2 LCD display

Completion Notes

This Arduino project is a minor modification of the Hello World project for 16x2 LCD displays utilizing the LiquidCrystal library. Here is its entire code:

// 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("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print("good bye! ");
  lcd.print(millis()/1000);
}

LCD Hardware

We have tested the project with two types of 16x2 LCD displays. One purchased at Sparkfun, another on eBay from China. The problem was observed with both pieces of hardware, with slightly different manifestations.

LCD 16x2 hardware - front view
LCD 16x2 hardware - front view
LCD 16x2 hardware - back view
LCD 16x2 hardware - back view

Root Cause

The root cause of the issue turned out to be loose contacts between the LCD module and breadboard pins.

Solution - Header Pin Resoldering

Both displays were fixed by resoldering all 16 pins properly by making sure enough solder is put into the holes to fill them entirely.

Resoldering LCD 16x2 header pins solves corrupted text problem
Resoldering LCD 16x2 header pins solves corrupted text problem

Comments

jscampbe: had same problem, the compression connector between LED display and circuit board is sensitive to pressure variation, bending metal retaining tabs change pressure along connector. Also noted that my display needed at least 5.4V to fully light up the display pixels.