Arduino LCD Screen doesn't show anything

Hi all,

I am currently trying to light up a LCD screen with Arduino Uno just using the basic code from 'hello world' tutorial (https://docs.arduino.cc/learn/electronics/lcd-displays). But although the screen lights up, it does not show anything - no words, no symbols, no blocks. I have checked through the connections multiple times and have followed the tutorial closely. LCD screen was bought at a shop fully soldered.
Would truly appreciate any help!

Could it be an issue with the code? Here is the 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); //LiquidCrystal lcd(RS, Enable, D4, D5, D6, D7)

// make some custom characters:
byte heart[8] = {0b00000, 0b01010, 0b11111, 0b11111, 0b11111, 0b01110, 0b00100, 0b00000};
byte smiley[8] = {0b00000, 0b00000, 0b01010, 0b00000, 0b00000, 0b10001, 0b01110, 0b00000};
byte frownie[8] = {0b00000, 0b00000, 0b01010, 0b00000, 0b00000, 0b00000, 0b01110, 0b10001};
byte armsDown[8] = {0b00100, 0b01010, 0b00100, 0b00100, 0b01110, 0b10101, 0b00100, 0b01010};
byte armsUp[8] = {0b00100, 0b01010, 0b00100, 0b10101, 0b01110, 0b00100, 0b00100, 0b01010};

void setup() 
{
  // set up the LCD's number of columns and rows:
  lcd.begin(20, 4);
  
  // create new characters
  // support up to 8 characters of 5x8 pixels
  // numbered as 0 to 7
  lcd.createChar(0, heart);
  lcd.createChar(1, smiley);
  lcd.createChar(2, frownie);
  lcd.createChar(3, armsDown);
  lcd.createChar(4, armsUp);
  
  // control contrast from Arduino PWM
  // use Timer 1, PWM at pin 9 or 10
  // connect LCD VO (pin 3) to Arduino pin 9
  //TCCR1B = (TCCR1B & 0b11111000) | 0b001;
  //analogWrite(9, 60);
}

void loop() 
{
  lcd.clear(); // clear screen 

  // lcd.rightToLeft(); // go right for the next letter
  // lcd.leftToRight(); // go left for the next letter (default)
 
  lcd.home(); // go to (0,0)
  
  // set the cursor to (col,row)=(0,0), counting begins with 0
  // lcd.setCursor(0, 0); 
  
  // print from 0 to 9:
  for (int thisNum = 0; thisNum < 10; thisNum++) 
  {
    lcd.print(thisNum);
    delay(500);
  }
   
  // set the display to automatically scroll
  lcd.autoscroll();
  lcd.setCursor(20, 3); // set the cursor to (col,row)
  
  // print from 0 to 9:
  for (int thisNum = 0; thisNum < 10; thisNum++) 
  {
    lcd.print(thisNum);
    delay(500);
  }
  lcd.noAutoscroll();  // turn off automatic scrolling

  lcd.clear();
  lcd.setCursor(0, 0);
  
  // Print a message to the LCD.
  lcd.print("hello, world!");
  for(int i=0; i<=4; i++)
  {
     lcd.scrollDisplayRight(); // scroll one position right
     delay(200);
  }
  for(int i=0; i<=4; i++) 
  {
     lcd.scrollDisplayLeft();  // scroll one position left
     delay(200);
  }
   
  for(int i=10; i<=20; i++)
  {
    // if (i >= 15) lcd.blink();     // Turn on the blinking cursor
    // if (i >= 15) lcd.cursor();    // Turn on the cursor
    // if (i >= 15) lcd.noDisplay(); // Turn off the display
    lcd.setCursor(16, 1);
    lcd.print(i);
    delay(300);
  }
  // lcd.noBlink();    // Turn off the blinking cursor
  // lcd.noCursor();   // Turn off the cursor
  // lcd.display();    // Turn on the display

  // Print a number on the lcd
  lcd.clear();
  float number = 78.12345678;
  lcd.setCursor(0, 0);
  lcd.print("number = ");
  lcd.print(number);
  lcd.setCursor(0, 1);
  lcd.print("no. = ");
  lcd.print(number, 5);
  lcd.setCursor(0, 2);
  lcd.print("01234567890123456789");
  lcd.setCursor(0, 3);
  char str[] = "20 characters / line";
  lcd.print(str);
  delay(3000);
  
// Print a message on the lcd
  lcd.clear();
  lcd.setCursor(0, 1);
  lcd.print("I ");
  lcd.write((byte) 0); // when calling lcd.write(data), data must be cast as a byte
  lcd.print(" BN2111 ");
  lcd.write((byte) 1); // or byte(1)
  lcd.print(" ! ");
  lcd.write((byte) 2);
  lcd.print(" ");
  lcd.write((byte) 3);
  lcd.print(" ");
  lcd.write((byte) 4);
  delay(3000);
} 

Hi and welcome.

Please read the forum guide. It has great advice about how to get help and advice on this forum. It will, for example, tell you how to post code correctly (which you haven't), and what else to include in your post, such as schematics, photos etc.

I have also moved your post to a more appropriate forum section. You should not have posted in the "installation and troubleshooting" section. There are several warnings in that section about not doing that, which you seem to have missed.

Hi, thank you for the advice! Have changed it accordingly

Thanks, that's an improvement.

How about that schematic, because your wiring is quite a mess. Hand drawn is fine.

There seems to be some masking tape on the LCD connector. What is that masking exactly?

Did you try one of the example sketches that came with the LiquidCrystal library? It's always wise to run these examples sketches to verify that your hardware is working and correctly connected, before trying code of your own.

OK, I need to know what that means. :roll_eyes:

Please explain the purpose of the masking tape. It is covering where the "Dupont" connectors go into the LCD board. What sort of connectors are soldered to the board?

Sometimes people attempt to "connect" wires to the LCD board without soldering and not surprisingly, end up here when as would be expected, it does not work. I doubt that the board came with wires soldered to it, so what have you actually done?

By the way - I trust you have tried adjusting the contrast potentiometer toward either end. It will help to remove the connection between one end of the potentiometer and the 5 V supply - that is a longstanding and silly mistake passed on from one designer to another without understanding how the display works. :grimacing: If using a 10k potentiometer, connect both ends to ground.

Hi this is the schematic I followed (provided by my sch and Arduino website), and this is my circuit on tinkercad (only difference is that VCC is VDD on my LCD, 220 ohms resistor) : Login | Tinkercad

Apologies, the masking tape was simply there to hold the wires in place, have removed them!

Yes, have tried adjusting the potentiometer to both ends.

This is how the wires are connected to the LCD (wires provided by my sch). VSS is the first from the top, K is at the bottom of this pic.

There appears to be an I2C backpack on the LCD. Why are you using the parallel connection when the LCD is I2C capable? The backpack is probably fighting the signals from the Arduino.

See this tutorial.

Use the hd44780 library (available via the IDE library manager) to make interfacing the I2C LCD easier.

So that is what "LCD screen was bought at a shop fully soldered" means. :rofl: :astonished: :crazy_face:

The Class is using a diagram that can be confusing. It shows the LCD in a configuration that is for units without an i2C backpack. Because the backpack is soldered into the unit, the student should only use the four pins on the backpack. (https://create.arduino.cc/projecthub/mitov/arduino-nano-i2c-2-x-16-lcd-display-with-visuino-3bda09) Hope this helps.

If you adjust the POT left and right, do you see any text? If you upload the 'Hello world' code of the LiquidCrystal example of the Arduino IDE?

@rpiloverbd adjusting the pot will not work, and the pot is not needed. The sketch you suggested will not work either. If you look at the photo in post #7 you will see that a second PCB has been soldered to the back of the display's PCB. This is an i2c adapter sometimes called a "backpack". The circuit, connections and code above will not work because of this adaptor. The advantage of these adaptors is that only 2 Arduino pins need to be connected, not 6, and no external pot is needed because one is already fitted to the backpack.

Hi all,

Thanks a lot for all your responses and help! Thankfully the problem has been solved. I decided to use another spare LCD screen and as it turns out, the words now appear on the screen and its working fine. I have a feeling that it could be due to the additional thing that was attached to the back of the screen that maybe was not compatible with my code or initial circuit connections. The spare LCD I had did not have this attachment. Once again thanks to everyone who replied!

If you have time, try returning to the LCD with the backpack to get that working. You will see how much easier the LCD is to use with the backpack.

I see... This is for a sch project with an approaching deadline so I'll take whatever works! But will definitely be returning to check out this LCD screen with the backpack as advised. Thank you!

It will as PaulRB points out, be much easier to use as you only have to make two data connections to the I²C pins on the Arduino as well as 5 V and ground, but you must install the "HD44780" library in the Library manager in the IDE and use the examples with that library.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.