Electronic – arduino – LCD prints black text on blue screen, but can print white on blue when bugged out

arduinolcdlight

I am using the esp8266 which can supply 3.3V to power on an LCD 16×2.

However, I am running into trouble regarding the visibility of the LCD's contents. The LCD prints black text on a blue background and it is very dim, and you need to look from a certain angle to see it properly. I tried to make it print out white text on blue background, and eventually the LCD "bugged out" and gave me this (the second picture).

enter image description here

enter image description here

So the LCD is indeed capable of producing white text on blue background, but I haven't been able to do it on command… Does anyone know why this happens, or how I can command it to print white text on blue background?

By the way, I'm programming in the Arduino IDE, and the only functions with respect to the LCD I use are

lcd.begin();
lcd.print();
lcd.write();

// For example
lcd.begin(16,2);
lcd.print("Locked");

The wiring between the esp8266 and the LCD is like this:

enter image description here

Best Answer

That is a contrast pot. Not a brightness pot. And it is a white backlight, with inverse segments. So background should be dark and the pixels white.

So the pot must not be set to maximum brightness, as it means you have zero contrast and you can see it extremely poorly.

When there is something on the screen, adjust the contrast pot so that you have dark background and bright letters and good viewing angle.

Also, many displays don't work with 3.3V and require 5V. Make sure you have a 3.3V display if you are going to run it on 3.3V supply. Note that the backlight may require different voltage, that may not be 5V compatible backlight.