Lcd1602 shows only white boxes

so yeah all i get is white boxes i tried the default arduino code and one from a tutorial, i know its NOT the code, checked my connections and all is fine, checked various forum post and they all say check your contrast, all i have it hooked to is a 10k potentiometer. i'm out of ideas, it was working the other day just fine. No idea whats wrong with it. Thanks

If it is not the code nor the connections, what does that leave?

Since we have no idea what LCD that you have, to what it is connected nor how it is connected it is right difficult to try to help.

Post a schematic. Post photos.

Yeah Here some images:

also i was getting a better result if i directly connected to ground of the arduino isntead of the - rail of my breadboard...

one more thing sometimes the whole screen goes blank or half the display has the white boxes, removing and plugging in the RS pin fixes it, it mostly happens when i touch a wire by accident not sure what causes it

Ok, you've got the DC wired right because it lights up. The contrast is reasonable because you can see the box power on self test pattern. The problem is comms. Either with the wiring or the commands.
When I got my first 1602 it was parallel like yours. I had the same issue and finally got a 1602 with the I2C backpack and never looked back. It simplifies the wiring and allows multiple LCD's to co-exist. I've gotten up to four working simultaneously on I2C (a 1602 and three 2004's).
The LCD has onboard logic that can be confused by power glitches which is why it's literally "touchy". Any momentary misconnect will have random effects. Check your wiring for secureness. While I accept that you've got it wired right, the connections themselves are sometimes ... suboptimal.

I totally agree with you, it would eliminate 90% of connection errors and it would already have the contrast potentiometer integrated in it. That I2C adapter is highly recommended.

Check you Wire and except of usin potiemeter juts use 1 k resistor on last second pin from right VCC Pin

That is of course, very suspicious - of bad connections in the breadboard or the jumper wires.

Now this is tricky.

If the contrast is set correctly, then the screen going blank may indicate the code is actually initialising it, as initialising the driver will of course blank the screen, depending on what else your secret code does.

OTOH, it may indicate a faulty power or contrast connection.

Speaking of contrast, remove the connection from the potentiometer to 5 V - this is a longstanding mistake mindlessly copied from one tutorial and design to the next over a couple of decades! You can actually connect both ends of a 10k potentiometer to ground for good effect.

Must you insist on making this spurious suggestion when it is clear that the OP has actually correctly adjusted the contrast? :roll_eyes:

While we do consider this a most practical approach, the problem then becomes the use of the obsolete LiquidCrystal_I2C libraries and we then have to explain the need to install Bill Perry's "HD44780" library in the IDE Library Manager (unless you actually know how to use the Fmalpartida library).

Unfortunately while it does work, the backpack incorporates the contrast potentiometer error. :roll_eyes:

I haven't reverse engineered to see how that potentiometer is wired into the backpack, but if it has that error and if it is an error, bless it, it works great.

Great, we save the potentiometer. If we connect both ends to GND at the cursor we always have GND and at the display pin we always have GND no matter how much we turn the potentiometer. Why put it there? Are you sure it's a mistake?

OK, here's the deal. :grin:

On the LCD board, there is a resistor "ladder" of five resistors, "R1" to "R5", 2k2 each.


These connect in series (totalling 11k) between the Vcc pin and the "Vo" pin three on the module. They provide six reference voltages (including "Vo" and 5 V) for the multiplexing of the display.

These actual voltages are fairly critical, for most displays that you will see, the correct spread of voltages is about 4.7 V. So the adjustment of the voltage on "Vo" sets this voltage to suit.

The correct voltage on Vo is therefore something between zero and 0.5 V - it depends of course on the actual supply voltage which may already be significantly less than 5 V if the system is powered by a USB port. Given that the ladder on the display board is 11k and connects to Vcc, then a series resistance of between zero and 1k will result in a voltage drop of between nothing and about 0.45 V.

And that is what the correct contrast control is. A 1k variable resistor to ground. Using a potentiometer connected to 5 V means the potentiometer is pulling UP to 5 V when the ladder needs to be pulled DOWN to ground. You have an additional 10k in parallel with the ladder, drawing a small but entirely wasteful current, which means the working range of the potentiometer is now less than 500 Ohms of its 10k range - the bottom twentieth.

If you disconnect the potentiometer from the 5 V, the useful working range now becomes one tenth of its range. But if you go further and connect both ends to ground, its effective resistance is halved; it becomes a 5k variable resistor and the working contrast range is now nearly a fifth of its span - at each end! :grin:

Remember - the correct adjustment was actually a 1k pot wired as a variable resistor (the wiper connected to one end).

Absolutely. :rofl:

OK, I didn't understand.

@ gonpezzi,

Go on. You have been a member for over a year.
You must have read Paul_B's obsession many times.

If you connect both ends of a 10k pot the two "halves" are in parallel. e.g.

0%     0k,  10k  =  0k0
25%    2k5, 7k5  =  1k9
50%    5k0, 5k0  =  2k5
75%    7k5, 2k5  =  1k9
100%   10k, 0k   =  0k0

In other words you get a 2k5 variable resistor. with max value at 50%. min value at each end.

Yes, it makes it easier to adjust the contrast. Most 16x2 will need about 400R.
i.e. 4% travel on the 3-wire potentiometer.
i.e. 4.5% (or 95.5%) travel on the 2-wire rheostat.

Whereas a 1k rheostat would be 40% travel.
And just using a 390R fixed resistor is probably the easiest of all !!

Quite honestly I adjust the pot on a backpack without any difficulty.
A 1k0 rheostat would be much more sensible.
But so far I have never lost any sleep.

David.

Once you realise that the correct range is right at one end and it is a little "fussy".

But some poor newbie tentatively moves it a fair bit but not to the end and - nothing happens! :face_with_raised_eyebrow:

Go on. A newbie turns it from 0% to 100%.

But I bet that most backpacks come with the pot adjusted to 0%. i.e. they work out of the box.

Looking at a bag of presets. They are set to fully-clockwise from the factory.
Looking at a couple of backpacks. They are actually set to fully-clockwise.

It is just a question of how they wire the pot on the backpack pcb. i.e. right hand terminal to GND means 0V when fully clockwise.
OTOH, pots mounted on most dev boards are wired conventionally. i.e. GND to left hand terminal. Turn clockwise to increase. Contrast is fully anti-clockwise i.e. 0%.

Obviously dev boards vary. Backpacks vary. Punters vary !!

David.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.