Arduino Display 2x16 and potentiometer input for contrast

My issue is that the display is flickering and degrading from beginning to end (second line much worse). The potentiometer (10k) used for contrast regulation is only working at the very end of its top span.

I tried to put another resistor in series (4.7k). My intention was to extend the range or, more precisely, to move it up (4,7k to 14.7k). But it does not work.

Any advice?
F

The most common cause for this kind of behavior is insuffient power. The potentiometer (correct is: wiper to pin 3 of the display; parallel interface, one pin of the potentiometer to GND, other not connected) only governs contrast, not power to the display.

Main power to the display is via pin 2. The background illuminator LED receives power via pin 15 - there must be a 220 ohm resistor in series. Check the integrity of all these wires and pins. Finally, check GND

An alternative cause might be that your Arduino is performing power-hungry calculations or is powering lots of auxiliary stuff - servos, lots of leds, etc..

First test your display 'bare' with an Arduino and a simple "Hello World" sketch, and of the display works fine then connect all the other stuff.

flavios:
The potentiometer (10k) used for contrast regulation is only working at the very end of its top span.

Actually, its bottom span - the end connected to ground. This is because of a long-standing and stupid foul-up in the design which is a mistake made many years ago and mindlessly perpetuated from one published circuit to another. Not the only time such a thing has happened. :grinning:

As photoncatcher has attempted to explain, the potentiometer should only connect with the wiper to pin 3 ("Vo") and one end to ground, the other end should not be connected, or certainly not to 5 V. And the value if you want better control should be 1k, not 10k but if you are using a 10k, a clever trick to make the best of a bad situation is to connect both ends to ground.

flavios:
I tried to put another resistor in series (4.7k). My intention was to extend the range or, more precisely, to move it up (4,7k to 14.7k). But it does not work.

It most certainly will not, because the problem here is far too much resistance, not too little. :grinning:

photoncatcher:
The background illuminator LED receives power via pin 15 - there must be a 220 ohm resistor in series.

In most of the 1602 displays available, Resistor R8 on the board is "101" or 100 Ohms and a resistor in series is entirely unnecessary, unless you wish to dim the display.

photoncatcher:
An alternative cause might be that your Arduino is performing power-hungry calculations

Complete nonsense! :astonished:

photoncatcher:
or is powering lots of auxiliary stuff - servos, lots of LEDs, etc..

And that certainly may be a problem.

You should not be attempting to power a system via the "barrel jack" or "Vin" as the on-board regulator is only capable of supplying the on-board chips and essentially, nothing else beyond a coupe of LEDs. :roll_eyes:

I think your electricity is contaminated. Have you tried straining it?

Sorry - I couldn't resist.

You might consider posting your code. Who knows, we might find an lcd.clear() statement in your loop().

Don

Thanks to both.

Paul__B:
As photoncatcher has attempted to explain ...the value if you want better control should be 1k, not 10k but if you are using a 10k, a clever trick to make the best of a bad situation is to connect both ends to ground.

I am working out of an Arduino kit. Learning. As I do not have a 1K pot I tried the latter. Small improvement, mostly on flicker.

I also tried replacing the pot with a resistor of 560 Ohm and the 220k. Nothing significant.

Paul__B:
You should not be attempting to power a system via the "barrel jack" or "Vin" as the on-board regulator is only capable of supplying the on-board chips and essentially, nothing else beyond a coupe of LEDs. :roll_eyes:

I should have tried, sooner or later, to replace the weak power I get fm Surface USB. I put a 9V battery on Vin and GND on the board. No better. (9V battery is juice enough?)

Attach design and photo. Just in case the Arduino project has another error.

arduino LED1_lowRes.jpg

arduino LED2_lowRes.jpg
Nice picture. Much better than we are usually shown here!

flavios:
I am working out of an Arduino kit. Learning. As I do not have a 1K pot I tried the latter. Small improvement, mostly on flicker.

Unlikely to improve the flicker. This merely makes contrast setting easier. If the contrast is set, that is as much as it will do.

flavios:
I also tried replacing the pot with a resistor of 560 Ohm and the 220k. Nothing significant.

Whatever "Nothing significant" means I have no idea. A 220k would have no imaginable effect.

flavios:
I should have tried, sooner or later, to replace the weak power I get fm Surface USB. I put a 9V battery on Vin and GND on the board. No better. (9V battery is juice enough?)

That rather sounds as if you did not even read what I explained about "Vin". :astonished:

Hi Flavios, thanks for your pictures. These are of great help. I inspected them one by one with a magnifiying glass.

connections of your LCD display:
picture in the Arduino kit instruction booklet: LED1_lowRes.jpg

official connectivity:
pin 1: GND - OK
pin 2: 5V - Ok
pin 3: wiper of potentiometer - see comment by Paul_B
pin 4: pin 12 Arduino
pin 5: GND
pin 6: pin 11 of Arduino
pin 7: not connected
pin 8: not connected
pin 9: not connected
pin 10: not connected
pin 11: pin 5 of Arduino
pin 12: pin 4 of Arduino
pin 13: pin 3 of Arduino
pin 14: pin 2 of Arduino
pin 15: with 220 ohm resistor in series to 5V
pin 16: GND

Your own real life construction: (LED2_lowRes.jpg)

I recommend using color coded wires: (at least) 5V = red, GND = black
pin soldering of the LCD display looks fine
LCD display looks fine. These are robust gadgets that usually work as they should and never give up. I have one working 24/7/365 for three years now (!).
Power supply to the Arduino board is via its USB port which is more than sufficient to power a LCD display. Power has to be transferred unintermittently from the Arduino to the LCD display, though. That may be a different story and here is a point of focus.
There may be something wrong with the wiring of pin 3 of the display

Let's check pin connectivity first, one by one

Starting with the right (16, LED)
pin 16 (LED-): GND - OK
pin 15 (LED+): to 5V via resistor 220 Ohm - OK
pin 14: (DB7): to pin 2 of Arduino - OK
pin 13: (DB6): to pin 3 of Arduino - OK
pin 12: (DB5): to pin 4 of Arduino - OK
pin 11: (DB4): to pin 5 of Arduino - OK why do you use a red jumper wire here?
pin 10: (DB3): not connected - OK
pin 9: (DB2): not connected - OK
pin 8: (DB1): not connected - OK
pin 7: (DB0): not connected - OK
pin 6: (E): to pin 11 of Arduino - OK
pin 5: (R/W): to GND - OK
pin 4: (HS): to pin 12 of Arduino - OK
pin 3: (V0): goes to breadboard position 13 - is this wiper of potentiometer?
pin 2: 5V - OK
pin 1: GND - Ok

Flickering usually means lousy connections, broken wires (see Floresta's comment)

I suspect the potentiometer. In your picture there is no contrast at all, backlight seems not working. These plastic potentiometers are ultracheap and their behavior is very erratic if not outright lousy. Is the wiper pin tightly pressed into its hole in the breadboard. Does it make contact?

Remove all redundant wiring, that is: concentrate on your display wiring and strip your project from everything else.

Remove that potentiometer altogether. Connect pin 3 of LCD display via a 470 ohm resistor to GND. You have used 560 ohm - should be OK as well.

Remove the black device on the breadboard (trim potentiometer?) connected to D6 of Arduino and test most simple "Hello World" sketch

If that does not work: check connections between Arduino pins 2,3,4 and 5 with the pins on the LCD display. Faulty data transfer might produce flicker.
Replace all wiring.
If all else fails: borrow somebody else's LCD display and stick that onto your breadboard
Post your sketch

Let's see whether we have the culprit here at its tail.

Many thanks for the detailed advice.

photoncatcher:
I suspect the potentiometer. In your picture there is no contrast at all, backlight seems not working. These plastic potentiometers are ultracheap and their behavior is very erratic if not outright lousy. Is the wiper pin tightly pressed into its hole in the breadboard. Does it make contact?

Your suspect has ground - the middle contact of the pot (wiper?) is shorter because the distance of the pins exceed the space available. But as you acknowledged I now replaced with a fixed resistor.

photoncatcher:
Remove all redundant wiring, that is: concentrate on your display wiring and strip your project from everything else.

I surely will. Perhaps I should strip everything - go ahead with the "course" and then device a "no fancy" (the project is about a "fortune teller" and the black component is a tilt! :slight_smile: ) test with much less code to focus on the hw topic. Will then post barebone sketch asap.

Have to postpone also because I have ordered some wires because the assortment in the kit is lousy. Make orderly may be a key for better debugging.