LCD wont display any letter

Hello everyone. I bought a board a week ago with a starter kit and I'm watching some tutorials. I've tried the "hello world" with the 16x2 LCD display. I tried many circuits but nothing would works for me. The LCD turns on (I can see the light), but it doesn't print anything.

Here's the code:

#include <LiquidCrystal.h>


//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7,8,9,10,11,12);

void setup() {
   lcd.begin(16, 2);                          // put your LCD parameters here
  lcd.print("hello, world!");
  lcd.setCursor(0,1);
  lcd.print("it works!");
  
}

void loop() {

}

and here's the circuit (hope it's clear to see and debug):

3.3v? Most LCD are designed for 5v use and generally refuses to work at lower voltage.

Actually you can probably get a 5v LCD to work at 3.3 volts if you can come up with a negative voltage supply for the contrast circuit.

You can check this out by temporarily using a battery with it's positive terminal connected to the Arduino GND line. Then disconnect the one end of the potentiometer from GND and instead connect that end of the potentiometer to the negative terminal of the battery.

Don

wilykat:
3.3v? Most LCD are designed for 5v use and generally refuses to work at lower voltage.

I've tried both 5v and the 3.3v "just for sperimental purposes", but it just doesn't work.

floresta:
Actually you can probably get a 5v LCD to work at 3.3 volts if you can come up with a negative voltage supply for the contrast circuit.

You can check this out by temporarily using a battery with it's positive terminal connected to the Arduino GND line. Then disconnect the one end of the potentiometer from GND and instead connect that end of the potentiometer to the negative terminal of the battery.

Don

I've tried and it ligts up just with the 5v, btw the problem sussist with using the 5v pin.

Does the 'light' that you are talking about go away when you disconnect pin 15 or 16. If so, then you are talking about the LED backlight which a different subject entirely from the contrast.

Don

floresta:
Does the 'light' that you are talking about go away when you disconnect pin 15 or 16. If so, then you are talking about the LED backlight which a different subject entirely from the contrast.

Don

Yes, that's it. The light turns off if I disconnect 15 or 16.

So at this point all you know is that the backlight works.

It's time for you to disconnect everything and start again using the step-by-step procedure outlined below. I have been periodically posting this for years now, the last time was in June I think. You may already have seen it since that's my sketch in your original post.

=================================================================================
I guess it's time for me to re-introduce my generic step-by-step approach.

(1) If the module has a backlight then get it working properly. This involves only pins 15 and 16 on most LCD modules. Make sure to use a current limiting resistor if there is none on the LCD module.

(2) Get the power and contrast working properly. This involves only pins 1, 2, and 3 on most LCD modules. You should be able to just barely see blocks on one row of a two row display and on two rows of a four row display.

NOTE: The Arduino has not been used yet, except as a possible source for the power needed for the first two steps. Do not try to go any further until this is working. If you don't see the blocks then no amount of program code will help.

(3) Connect the LCD R/W pin (pin 5) to GND.

(4) Connect the six control and data wires between your LCD module and your Arduino. Make sure that your wiring matches the numbers in the descriptor (or vice versa).

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
  LiquidCrystal lcd( 7, 8,  9, 10, 11, 12);      // put your pin numbers here

(5) Upload your sketch and it should work.

For troubleshooting a 'static' sketch, one that displays a simple message or two and then stops is recommended. All of your code should be in setup(), and loop() should be empty between the brackets.

#include <LiquidCrystal.h>

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
  LiquidCrystal lcd( 7, 8,  9, 10, 11, 12);      // put your pin numbers here

void setup()
  {
  lcd.begin(16, 2);                              // put your LCD parameters here
  lcd.print("hello, world!");
  lcd.setCursor(0,1);
  lcd.print("it works!");
  }

void loop()
  {
  }

==============================================================================

Don

floresta:
So at this point all you know is that the backlight works.

It's time for you to disconnect everything and start again using the step-by-step procedure outlined below. I have been periodically posting this for years now, the last time was in June I think. You may already have seen it since that's my sketch in your original post.

=================================================================================
I guess it's time for me to re-introduce my generic step-by-step approach.

(1) If the module has a backlight then get it working properly. This involves only pins 15 and 16 on most LCD modules. Make sure to use a current limiting resistor if there is none on the LCD module.

(2) Get the power and contrast working properly. This involves only pins 1, 2, and 3 on most LCD modules. You should be able to just barely see blocks on one row of a two row display and on two rows of a four row display.

NOTE: The Arduino has not been used yet, except as a possible source for the power needed for the first two steps. Do not try to go any further until this is working. If you don't see the blocks then no amount of program code will help.

(3) Connect the LCD R/W pin (pin 5) to GND.

(4) Connect the six control and data wires between your LCD module and your Arduino. Make sure that your wiring matches the numbers in the descriptor (or vice versa).

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);

LiquidCrystal lcd( 7, 8,  9, 10, 11, 12);      // put your pin numbers here




(5) Upload your sketch and it should work.


For troubleshooting a 'static' sketch, one that displays a simple message or two and then stops is recommended. All of your code should be in setup(), and loop() should be empty between the brackets.



#include <LiquidCrystal.h>

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
  LiquidCrystal lcd( 7, 8,  9, 10, 11, 12);      // put your pin numbers here

void setup()
  {
  lcd.begin(16, 2);                              // put your LCD parameters here
  lcd.print("hello, world!");
  lcd.setCursor(0,1);
  lcd.print("it works!");
  }

void loop()
  {
  }




==============================================================================

Don

I found the problem! I switched the first terminal of the potentiometer with the third terminal and I adjusted the potentiometer to get the contrast to see the letters.