Help, my LCD changes contrast randomly!

Hello! I just bought an 16x2 non-I2C blue backlit LCD-display. Since 2 days I have had this problem, where the LCD would just glitch its contrast. At its max point, it runs okay, but in intermediary points, it just freaks out. How can I solve this problem?
Solutions I have tried:

  • starting in 16x1 mode

Sounds more like a poor solder joint, poor jumper connection, poor breadboard, or whatever. You've given so little, that's all I can give back.

This is my solder joint work of the LCD.

If it were in front of me, I'd likely resolder pins 2 and 6, but it may just be the angle of viewing, or whatever.

The Dupont connectors would be my suspicion. They're okay when new, but quickly age out. If you have any that feel 'sloppy', change them out.

Beyond that, can't help much. I can't see where your contrast pot is, or how reliable it's connections may be.
I'm pointing at these things because there is no software element that controls contrast, so that's a rabbit hole we won't come back from.

I have found the solution. My LiquidCrystal library was at version 1.0.0. Once I updated it to 1.0.7 and reloaded the program, it worked totally fine. The potentiometer control was working smoothly as well and at things that require something quickly done, it responded without problems.


Solution: Always update your libraries.

I understand that you're happy but please don't shout :wink:

I think it's unintentional; if so, edit your post and add an empty line before the 3 dashes.

Loose connection comes to my mind first.

Ok, so I finally got the screen to work. It was not a software issue, rather an electronical issue.
Checking the voltages of the potentiometer between V0 and GND, I observed random changes of the voltage. This behaviour meant only one thing: a short over the air between VDD pin and V0 pin, which gave it more power than it was supposed to.

[liaifat85]
Loose connection comes to my mind first.

Observing the solder work, I immediately spotted that the VDD pin was loosely soldered and I got it quickly and properly soldered. Once I cleaned the pins with alcohol and powered it on, it was working like a charm!

Solutions for anyone with the same contrast glitching problem:

  • Keep your libs up to date.
  • Check the solder joints for any loose connections, especially on critical pins such as VSS and VDD, otherwise this bouncing short will occur.
  • Always, but always clean your solder work once it is done.

Yeah, so 2 days ago, you were told, in posts #2, and more specifically, post #4, that you had a connection problem. That you should resolder pin number 2 - VDD.

And you give yourself the solution ticky? Really? Hilarious. That's okay, I don't want it, it's 'broken' now, so you can keep it.
<poster muted, for hubris>