16x2 lcd screen text is very dim

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 10, 9, 8, 7);

void setup() {
  lcd.begin(16, 2);
  lcd.print("Hello world");
}

void loop() {
  // put your main code here, to run repeatedly:
  
}

Connections:
VSS → GND
VDD - > +5V
VO → GND
RS → 12
RW → GND
E → 11
D4 → 10
D5 → 9
D6 → 8
D7 → 7

I almost cannot see text. Strangely, when I hold reset button, the text is very visible. Why?

So the code is working.

You do not have a contrast adjustment. Connect a 1k potentiometer between Vo - pin 3 - and ground; one end of the potentiometer to ground and the wiper to Vo. Adjusting this should enable you to show the text.

With potentiometer I am only able to make it dimmer. The text is visible, but very hard to read. Only holding the reset button on arduino makes it very visible.

Not sure what is wrong with that, probably damaged display. It worked like month ago.

Power supply voltage checked with multimeter with and without reset pressed?

Oh I see now. My display must be damaged, because on datasheets it shows that it should work fine on 5V, but it needs at least 5.7V. Without reset button pressed, voltage on +5V pin was 5.3V and with reset pressed, it was 5.9V.

The LCD maybe fine yet.
check all connection specialy GND,V+ and the better is use 10K Pot for contrast.
by changing the Pot position you have to see change in the LCD character from dark to light.
check backlight connection too.

You may very well have a display capable of operating over an extended temperature range in which case the voltage on pin 3 must be more than 5 volts below the supply voltage VDD.

This is normally accomplished by using a negative voltage on pin 3 (requiring a second supply) but you have done it by increasing the supply voltage, possibly above it’s recommended voltage.

Look at your datasheet and see what it specifies for the voltage at pin 3 (typically called VEE or VO). This is typically referenced to the supply voltage rather than GND. A typical value is ‘4.5v less than VDD’. Your device probably specifies a value of 5v or more.

Don

bahman89:
and the better is use 10K Pot for contrast.

Complete rubbish!

I have explained the correct way to control the contrast pin. A mistake was made early on in the example circuits and has been mindlessly copied since.

Normally when VO is connected directly to GND the display is readable but usually with too much contrast. Sometimes all four rows of blocks are visible.

In this case the display is visible but dim which indicates that the contrast voltage is not as far from VDD as it should be and has to go negative with respect to GND.

This means that for this case both bahman89 and Paul_B are incorrect! The variable resistor should be connected between VO and a source of voltage that is negative with respect to ground as shown in Figure 21 of the HD44780U data sheet.

Don

HD44780U Fig 21.jpg

It is interesting to consider the 3.3 V version of these display boards.

It employs a “charge pump” IC - the position for this as well as its support capacitors and the jumpers to select whether or not it is present are on the PCB - to generate a minimum 5 V, not for operation of the HD44780 chip logic itself, but for the contrast ladder.
3f2d6d1b0e33dd5fb65cb482ce8ead9dfca9763d.jpg
I would not concede I was incorrect. As you cite from the original, it is a variable resistor that is supposed to be used, not a potentiometer. You may indeed need an extra voltage to supply to it.

Paul__B:
. . .
I would not concede I was incorrect. As you cite from the original, it is a variable resistor that is supposed to be used, not a potentiometer. You may indeed need an extra voltage to supply to it.

I guess you missed the part that said "for this case".

Also - I deliberately included the figure as a link rather than embedding it.

I guess you do not have to deal with slow and/or metered internet connections.

If you provide pictures as links rather than embedding them then those who do have such a connection do not have to 'pay' to reload the picture each time they return to the forum topic.

Don