LCD 16x2 is not showing text on screen [wrong wiring]

Hello,
I am trying to show text on lcd screen but it's not working.
I connected all cables as down below:

  1. LCD RS pin to digital pin 12
  2. LCD EN pin to digital pin 11
  3. LCD D4 pin to digital pin 5
  4. LCD D5 pin to digital pin 4
  5. LCD D6 pin to digital pin 3
  6. LCD D7 pin to digital pin 2
  7. LCD R/W pin to ground
  8. LCD VSS pin to ground
  9. LCD VCC pin to 5V
  10. V0 to ground

Here is my code:

#include <LiquidCrystal.h>
int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  lcd.begin(16,2);
}

void loop() {
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Hello");
  lcd.setCursor(0,1);
  lcd.print("World");
}

If you can help me I would be appreciated.

I'm missing a potentiometer in your set up; see e.g. SparkFun Inventor's Kit Experiment Guide - v4.1 - SparkFun Learn. I don't know much more about LCDs.

Thanks for using code tags in your first post :+1:

1 Like

Thank you for your response. Even if I use 10k potentiometer nothing changes. I changed jumper cables with new ones but again same result.

Please be more specific about how you installed and adjusted the 10k potentiometer. Is it currently installed? Have you tried adjusting it to both stops (ends of travel) and the middle? Did you observe a change in the darkness of the individual pixels? In my experience, the LCD contrast adjustment has the potential to cause the entire screen to change from completely light to completely dark. At both extremes, the content displayed will be completely invisible.

1 Like

your ground and VCC rail on your breadboard are not connected. There is a gap between left and right. You can see that the red and blue lines are separated. Bring all wires to either the left or right side of your breadboard.

grafik

1 Like

I installed potentiometer as down below. I switched to most left and get this output. There is a text scrolling from left to right. What is the error or is it a codding error?

I changed cables as down below. I moved ground cables to most left and 5V cables to most right. It worked but now I see different text from expected.

why only "most"? Do that with all cables which need ground or VCC.
The next photo should show ALL wire connections including to the Arduino.

1 Like

OK :slight_smile: I changed all of them to left. Here is the image. Now it turned to beginning. Not showing screen.

The two cables from the Arduino are still separated from all the others.
Your LCD doesn't get any ground nor VCC.

1 Like

Thank you so much. I forgot that 2 cable and I was wondering why does it not work. Thank you again,


now it's working properly.

1 Like

I see you're new here, so I'm guessing you're new to breadboards. Your breadboard has what is referred to as a split rail.

Read the below link. Note Step 3. That would have solved your problem.

1 Like

Another LCD tip:
For future projects consider either adding an I2C backpack to your display or purchase displays with it already installed.

Use the hd44780 LCD library with the hd44780_I2Cexp.h class. It only uses 2 pins, A4 and A5 and it's well documented and supported.

2 Likes

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