LCD contrast not working and not displaying text

Hello;

I am new to the arduino. I was making a portable weather station with and arduino NANO, DHT 11 temp and humidity sensor, and a 16 X 2 LCD. after i made the circuit I plugged it into the computer and everything was working as I intended it to but after I plugged it in the second time the LCD contrast stopped working and it stopped displaying text.

At first I thought I might have made a wrong connection; so I made another circuit with the UNO, LCD, and a 10K potentiometer; the problem was still there.
I tried it over again with two more 16 X 2 LCD's but the problem still continued.

I tried it with the I2C module and the contrast started working with the in built potentiometer. Then i thought the problem was with the arduino software so i deleted it and reinstalled it but the problem still continued. I tried with two arduino UNO's and one arduino NANO but nothing seems to be solving the problem.

does anyone know the solution??

thank you.

 #include <LiquidCrystal.h>

int rs = 7;
int en = 8;
int d4 = 9;
int d5 = 10;
int d6 = 11;
int d7 = 12;

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

int dt = 1000;


void setup() {
  // put your setup code here, to run once:
  lcd.begin(16, 2);
  

}

void loop() {
  // put your main code here, to run repeatedly:
  lcd.setCursor(0, 0);
  lcd.print("Hello World");
  lcd.setCursor(0, 1);
  lcd.print("I am Alive");
  delay(2000);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Watch me count");
  for (int j = 0; j <= 10; j+=1){
    lcd.setCursor(0, 1);
    lcd.print(j);
    delay(1000);
     
  }
  lcd.clear();


}

Your breadboard seems to have the power rails broken in the middle. Put jumpers there. You need ground for the contrast pot (but not Vcc, see below).
breadboard jumpers

Almost all of the LCD tutorials have the wiring of the contrast pot wrong. It is a mistake that has been perpetuated through the years. The right way is to wire the one end of the pot to ground and the wiper to LCD pin 3 (V0). The other end of the pot is left disconnected. So the pot is a variable resistor. Actually I find that a 1K fixed resistor from ground to Vo gives me satisfactory contrast on virtually every LCD that I have tried.

1 Like

@groundFungus Thank you soo much; The LCD is working now :grinning::grin:

1 Like

The code is same because I also wanna make, so the question is that did you make any change in the code or not ?

Plastic Injection

@pascal67
Hello!

yes the Code is the same. the only thing I changed was the potentiometer connection. I hooked up two potentiometer pins instead of three; one which connects to GND and the center one which connects to the contrast pin (V0; third pin from the right).

hope this answers your question :slight_smile:

1 Like

Jenuvandermerve

14h

(post deleted by author)

No, that is the point.

Not only do you not need to connect all three pins of the potentiometer, but that makes contrast setting much more difficult and wastes current which may not matter if using a mains supply, but does if using batteries.

And the proper variable resistor value is 1k. If you are experimenting with a 10k potentiometer, it actually works well to connect both ends to ground! :grin:

This topic will automatically close in 2 months.

Hmm, does that mean that topics now automatically lock four months after the first posting, not the most recent?

Yeah; I think so

the most recent.

For some peculiar reason, it still says in two months on this one. :face_with_raised_eyebrow:

some closes 2 months and some 4 months after the most recent.

I think so.

This topic was automatically closed after 120 days. New replies are no longer allowed.