16x4 LCD stopped working

My LCD was working until a few days ago. backlight lights up, potentiometer works controlling contrast, but can not get any data to show up on screen. Even have tried the simple HELLO WORLD setup, I get nothing.

My pin assignments are a bit different but it was working that way. I am using pins 2,3,4,5,6,7. Is it possible the LCD just died?

Here is my code.

#include <LiquidCrystal.h>

//lcd setup
LiquidCrystal lcd(2,3,4,5,6,7); //initialize the liquid cystal library pins on 2,3,4,5,6,7

lcd.begin (16,4); //defines lcd is 16 characters long in 4 rows

Any suggestions on if this is set up wrong of you feel my LCD has died.

Thanks.

Hi.

You forgot to put your code in [code] [/code] tags, so i had to look a few times to see what was code and what was your text around that code.

I can't see anything wrong with this code.
Your description is that nothing is displayed.
Well, that's exactly what that code is supposed to do; it initialises the display (which would clear any contents previously displayed by that display) and then does nothing.

So i don't know what's wrong.
With the given data; everything seems to be, as to be expected.

But it will not even print the HELLO WORLD?? Guess I should have added that when I start a loop it should display something. Here is a brief bit of the code.

for (int j=1;j<=numShootMoveLRvariable; j=j+1){
    
      lcd.clear(); //clears the lcd
      lcd.print("TAKING PHOTO"); //alerts camera is shooting
      digitalWrite(cameraFirePin, HIGH); //fires camera shutter through relay board
      delay(3000);
      digitalWrite(cameraFirePin, LOW); //de-powers relay board
      delay(3000);
      lcd.clear(); //clears the lcd
      lcd.print("MOVING TO NEXT"); //alerts camera is moving
      myStepperMOVINGLeft.step(25000);    // moves camera to left
      lcd.clear(); //clears the lcd

laughingcamera:
Here is a brief bit of the code.

Snippets are entirely useless.

I could post the entire basic HELLO WORLD code but thought it would be silly. I can not get that to work either.

. . . but can not get any data to show up on screen.

What does show up?

  • Nothing.
  • First and third rows of boxes.
  • All four rows of boxes.
  • Other (explain).

Don

If I adjust the contrast I see all four rows as "boxes". When printing to it I see absolutely nothing.

I doubt your display is defective. I suspect a wiring problem of some sort.

Make sure you do your troubleshooting with a program that writes something to the display once and then does nothing after that. In other words loop() should be empty.

Don

I have tried this:

 /*
  LiquidCrystal Library - Hello World

 Demonstrates the use a 16x4 LCD display.  The LiquidCrystal
 library works with all LCD displays that are compatible with the
 Hitachi HD44780 driver. There are many of them out there, and you
 can usually tell them by the 16-pin interface.

 This sketch prints "Hello World!" to the LCD
 and shows the time.

  The circuit:
 * LCD RS pin to digital pin 7
 * LCD Enable pin to digital pin 6
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * LCD VSS pin to ground
 * LCD VCC pin to 5V
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)

 Library originally added 18 Apr 2008
 by David A. Mellis
 library modified 5 Jul 2009
 by Limor Fried (http://www.ladyada.net)
 example added 9 Jul 2009
 by Tom Igoe
 modified 22 Nov 2010
 by Tom Igoe
 modified 7 Nov 2016
 by Arturo Guadalupi

 This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/LiquidCrystalHelloWorld

*/

// include the library code:
#include <LiquidCrystal.h>

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 7, en = 6, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 4);
  // 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(millis() / 1000);
}

You are aiming at a moving target. As I said previously, for troubleshooting loop() should be empty.

Have you checked the continuity of your interconnecting leads? Do your solder joints look solid?

Don

Yes, I double checked all the wire leads for continuity and even replaced a few thinking they were not good connections. Undid all connections and reconnected three times. I ordered a new LCD, should have it later today and will try that. Is there some possibility I fried the Arduino Mega itself?

Replaced the LCD with a brand new one, checked all connections, still nothing. Pulling my hair out. Here is the HELLO WORLD code I am using. Its correct right? I am not using a resistor because I am using a 10K pot that does decrease and increase the contrast.

// include the library code:
#include <LiquidCrystal.h>

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 7, en = 6, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 4);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {

}

We can't tell if your code matches your wiring without seeing a photo of your setup.

How is the contrast set?

Don

laughingcamera:
I am not using a resistor because I am using a 10K pot that does decrease and increase the contrast.

Note sure exactly what you mean here and it is not what is preventing it from working, but the contrast potentiometer should not be connected to Vcc - 5 V. It should only be connected as a variable resistor from Vo - pin 3 - to ground. In fact, given this correction, a 1k potentiometer would give much better control of the contrast.

He has said that he can adjust the setting and he has told us what happens as he adjusts the pot. He has NOT told us where he left the pot when he finished adjusting it.

If he left it at a setting that puts too high a voltage (with respect to GND) on pin 3 then his screen will always be blank no matter what else he does.

He should start with a setting that has only two rows of boxes that are faintly visible.

Of course the problem could be as simple as his neglecting to connect pin 5 to GND.

Don

Using the pot to control the contrast works fine. I rechecked all connections last night and think I ether have a bad pin or its connection. I am going to try re-asigning all the pins to different ones, if that works, then problem solved. If it still happens then will check the wires from the LCD to the board. It can't be the LCD, this testing was done with a new one.

A simple photo would answer a lot of questions for us.

Don

Solved, bad pin (or connection) on the Arduino, changed to different pin and it worked. Thanks everyone!