Arduino and LCD display - Doesn't show data :(

This is my first post on this forum. I have tried searching for the problem, but I haven’t found a solution :frowning:

So I hope you can help me :slight_smile:

I have an Arduino Duemilanove and a LCD Display (2x16) GDM1602K.

The problem with the LCD is that it only shows blank white boxes (see picture below).

My sketch in Arduino:

#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);

int backLight = 13;    // pin 13 will control the backlight

void setup()
{
  pinMode(backLight, OUTPUT);
  digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
  lcd.clear();                  // start with a blank screen

  lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
  lcd.print("Hello, World");    // change this text to whatever you like. keep it clean.
  lcd.setCursor(0,1);           // set cursor to column 0, row 1
  lcd.print("www.adriantomic.se");
  
}

void loop()
{

  
}

I have tried different code examples from the LiquidCrystal library, as well as the modified 4bit LCD library. Maybe this is a common problem, but my coding skills are not so great (yet).

Thankful for all the help I can get.

One thing I noticed, you need a lcd.begin(16, 2); before the lcd.clear();. Won’t fix the problem, but will mean it works correctly when you do fix it.

Try connecting the R/W pin to ground and use LiquidCrystal lcd(12, 11, 5, 4, 3, 2); instead (see http://oomlout.com/LCDD/LCDD-Guide.pdf for how I have my LCD wired up).

I only see two wires coming from your potentiometer. You should have one end connected to +5V, the other end connected to ground, and the center connected to the LCD drive (pin 3). It's hard to make the required connections with only two wires....

Don

One thing I noticed, you need a lcd.begin(16, 2); before the lcd.clear();. Won't fix the problem, but will mean it works correctly when you do fix it.

Try connecting the R/W pin to ground and use LiquidCrystal lcd(12, 11, 5, 4, 3, 2); instead (see http://oomlout.com/LCDD/LCDD-Guide.pdf for how I have my LCD wired up).

Thanks for the detailed PDF Slugsie. I connected everything according to the schematic, but for some reason I get exactly the same result as before. The display only shows white boxes (as in the previous image). I now use the "Hello World" example from the LiquidCrystal Library in Arduino.

I only see two wires coming from your potentiometer. You should have one end connected to +5V, the other end connected to ground, and the center connected to the LCD drive (pin 3). It's hard to make the required connections with only two wires....

Don

Hi Don, thanks for taking the time to try to solve my problem. I've done as you said and connected another wire to +5V. It works as before (but I guess it's better to use three wires instead of two.

I'm starting to think it is something wrong with my LCD. I've connected and reconnected the cables several times. Unfortunately I don't have another display to check if it's something wrong with my Arduino.

Is there any good way to troubleshoot?

I solved it! :slight_smile:

The problem was that the contrast was too high (making all the pixels in the display too bright) and not showing the text. By accident i turned it and saw the text. I had turned the potetiometer before, but maybe there was some other problem.

Anyway:

Glad you got it figured out!

I had turned the potetiometer before, but maybe there was some other problem.

I think the problem was what floresta was referring to. A Potentiometer has 3 pins (generally). One is +5v (if using Arduino), one is Ground, and one is the "wiper". The "Wiper" is where the voltage comes out at variable amounts (depending on how the Pot is turned).