[SOLVED] 20x4 Winstar LCD empty

Hi.
I'm trying to connect WINSTAR LCD 20x4 (via I2C backpack, no name) to my Arduino UNO (see photo).
Backpack was soldered to LCD by me - which might be relevant ;).

So far:

  1. Checked wiring several times (SCL - A5, SDA - A4, GND - GND, VCC - +5V) - looks OK.
  2. Downloaded library from: https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads.
  3. Checked I2C address using a sketch which says:

I2C device found at address 0x27 (39) it could be a LCD Backpack (PCF8574x)

  1. Used the sketch (first from top, just modified part to lcd.begin(20,4) ) to check LCD - it compiles with no problem
    http://arduino-info.wikispaces.com/LCD-Blue-I2C#v3

  2. Adjusted contrast on I2C backpack to see if this is an issue - it's not.

  3. Used the I2C LCD guesser (found on this very forum) which indicates that my LCD works fine with settings: lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE). Works fine = no blinking, backlight on. Still no text.

At the very beginning - when the wiring was very loose - I was able to see a text just for a moment during wires inspection (which tells me that LCD was not damaged and wiring "quite OK"). After that I re-heated all solders (backpack-LCD) and changed wiring (it's more rigid now, see photo).

Now I can see an empty LCD screen with a backlight on (it blinks 4 times after I run the sketch).

Any ideas what else can be checked ?

Thanks.

PS. No code included as it says it's to big for one post.

photo(2).JPG

try to define it as a 16x2 or 20x2 (as a test) to see if it shows something?

exTL:
Used the I2C LCD guesser (found on this very forum) which indicates that my LCD works fine with settings: lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE). Works fine = no blinking, backlight on. Still no text.
...
Now I can see an empty LCD screen with a backlight on (it blinks 4 times after I run the sketch).

There seems to be some confusion here.

The LCDguesser indicates that it has found the LCD by displaying the correct descriptor on the LCD itself. So it cannot have found the LCD yet not show text on the LCD.

You run the LCDguesser and repeatedly enter a space and "Enter" to the serial monitor until the LCD shows the descriptor. What the serial monitor shows in the meantime is nothing more than the current guess.

So - what did you find?

Hi,

robtillaart
I've tried 16x02 with no result.

Paul__B
As for LCDguesser sketch - apart from the address, there was no flickering (if this means anything).
But you are right - there was no text on the LCD itself, so..

So what is the way to find correct values , i.e. LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); ?
Could I possibly solder a backpack "upside down" ? Is there anything that must be changed in the library files ?

Unfortunatelly, there are more than one Liquidcrystal_i2c library. The F. Malpartida's NewLiquidCrystal library works for me, but you may try different one.
Arduino UNO r3/MEGA 2560 and LCD by I2c 16x2 and 20x4 on PCF8574T

exTL,
It sounds to me like you are using the guesser sketch but not following the instructions.
--- bill

exTL:
But you are right - there was no text on the LCD itself, so..

So what is the way to find correct values?

Did you actually perform the steps I explained in my previous reply?

exTL:
Could I possibly solder a backpack "upside down" ? Is there anything that must be changed in the library files ?

If you somehow manage to solder the backpack upside down, the backlight will be permanently on and will not flash when you press the reset button. Given that it does flash, you should see at least one line of "blocks" if - but only if - the contrast pot is set correctly. If you do not see the blocks, we must assume you do not have the contrast pot set correctly.

It is a very long shot to imagine that altering the library files could in any way accommodate for installing the backpack backwards. XD

Paul__B:
Given that it does flash, you should see at least one line of "blocks" if - but only if - the contrast pot is set correctly. If you do not see the blocks, we must assume you do not have the contrast pot set correctly.

About the blocks,
if the constructor has specified the wrong pins, then the display can be and is often a few random characters
after the guess rather than the blocks.

If the backlight is on by default when power is applied (with SCL, and SDA) disconnected,
then you can adjust the pot until you start to see the blocks.

If the backlight is off by default, then you can't do that test above and
will have to adjust it when the backlight is on.

When the contrast is adjust properly you should see some pixels
on the display.

exTL,

Works fine = no blinking, backlight on. Still no text.

While the sketch is working fine the lcd is not so you have not obtained the correct results.
Re-read the comments in the guesser sketch.
It describes the expected behavior, how to use it, and when to know
with the correct guess is achieved.

When the contrast is adjust properly you should see some pixels
on the display.

That was the problem. I set the contrast adjustment pot in the middle of scale which I thought is a good practice.
When I turn it to the minimum ... ta da !!! Works like charm.

Sounds pretty silly though ...

Thanks again :smiley:

Your first post had some conflicting information.
The part about no blinking but but working fine but with no text.
(The guesser can only give you the constructor parameters when the display is
able to show pixels/text).

I assume you re-ran the guesser to get the constructor parameters?

So what was the final constructor?

--- bill

Yes, I re-ran the guesser sketch and only those two settings are good. The rest gave me some blinking or strange characters here and there.

<Press or click [Send] to Continue>
Scanning i2c bus for devices..
i2c device found at address 0x27
Device found: PCF8574
<Press or click [Send] to start guessing>
Trying: lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE)
<Press or click [Send] to Continue>
Trying: lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, NEGATIVE)

exTL:
Yes, I re-ran the guesser sketch and only those two settings are good. The rest gave me some blinking or strange characters here and there.

There is only one set of parameters that is correct for s/w backilght control.
Are you saying that both of those showed the constructor information with the backlight on?

If so, you should try changing your jumper setting.
The instructions talk about this.
You should see the backlight blink off 3 times then remain on and
show the constructor.
If you don't see that sequence then the jumper setting should be changed.

More than likely you have a board that forces the backlight on when
the jumper is in. I'm guessng that if you remove the jumper then
re-run the guesser you will see which polarity allows s/w backlight control.

If so, then after removing the jumper and using appropriate polarity,
you should be able to use lcd.backlight() and lcd.noBacklight() in your sketches
to turn the backlight on/off.

--- bill

The working one with the backligh on is lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE).
NEGATIVE value = backlight off.

As to jumpers and control the backlight by the sketch - I'll check that.

BTW: I wonder if the contrast pot is OK as the adjustment in quite limited i.e. very narrow, in the beginning of scale.

exTL:
The working one with the backligh on is lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE).
NEGATIVE value = backlight off.

As to jumpers and control the backlight by the sketch - I'll check that.

I'm not understanding what you mean.
There isn't a polarity that turns the backlight on or off.
That isn't how it works.

The polarity determins the logic level of the pin used to control the backlight.
If you get it backwards then the backlight is off when the s/w tells it to be on
and on when the s/w tells it to be off.

The guesser sketch is controlling the backlight.
If the board is jumpered for s/w backlight control either polarity will
cause the backlight to blink.
Different boards use the jumper differently.
The difference between the two polarities will be that one of them will display the information with the backlight on
(the correct one), and the other polarity will display the information with the backlight off
which is very hard to see if you have a display with light pixels on a dark background.

So what is really happening when you run the guesser sketch?

This is what I see:

Photo 1 : lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE)
Photo 2: lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, NEGATIVE)

POSITIVE gives me possibility to control backlight with sketch /lcd.backlight(), lcd.noBacklight()/.

exTL:
POSITIVE gives me possibility to control backlight with sketch /lcd.backlight(), lcd.noBacklight()/.

Either one gives you the ability to control the backlight as the polarity only affects
the correctness of the backlight control not the control itself.
When the polarity is reversed from what it should be,
backlight() will turn off the backlight and noBacklight() will turn on the backlight.
Perhaps you mean:
POSITIVE gives you the ability to correctly control the backlight as intended.

When using the i2cLCDguesser sketch, you want to use the first guess of
parameters that pass the test. And by "pass" it means the first one
that shows up on the display with the backlight on.

Was there any kind of label, vendor, or manufacturer name on that backpack?
I'd like to add to my list of known backpacks.

--- bill

OK, now I got it :slight_smile:
Bill, thanks a million for your patience and commitment.

Re backpack - there was nothing more than on the photo (my 1st post). But on my vendor's website (link attached, in polish but pictures are universal ;)) there are more pictures which might lead you to YwRobot. But this is just a speculation ).

http://electropark.pl/modul-wyswietlaczy/3248-konwerter-lcd-hd44780-i2c-5901003248008.html

Cheers.

exTL,
All the tiny details really matter with stuff like this.
While pictures are universal, the picture you posted in your first post is not the same board as either of
two boards, in the link you posted above.
Which board do you have?

--- bill

This is the board from the 1st post (picture attached) - no name.

exTL:
I wonder if the contrast pot is OK as the adjustment in quite limited i.e. very narrow, in the beginning of scale.

Absolutely. The contrast itself is the actual voltage between "Vo" - pin 3, and the +5V rail. The 2k2 resistor chain R1 to R5 divides this up into a set of steps which are used to multiplex the LCD display which is very sensitive to the voltage - that is actually how the multiplexing works, only segments which are strobed with a combination equal to the full 4.5 volts will actually show.

So I say 4.5 volts - this corresponds to about 0.5V on the Vo terminal, so the potentiometer is always set near to ground - setting it midway selects 2.5V which produces no contrast at all. In fact, a fair approximation to the correct voltage is a 10k resistor to Vcc and a 470 ohm to 1k resistor to ground. Just a 1k to 2k resistor to ground will probably work (since the internal divider already totals 11k). If fine control of the contrast was needed, the potentiometer would be a 1k in series with a 8k2 to Vcc, but in practice, this is nowhere near that critical and once set, it generally does not matter if the potentiometer is obscured by mounting the display (as happens with some versions of the "backpack").

Now a matter of interest - there is a 3.3V version of the display. You will note a mounting pad "U3" on the board and three jumpers of which "J1" is soldered as well as capacitors C1 and C2 (it is by the way, always a good idea to mount a 0.1µF capacitor across pins 1 and 2). On the 3.3V module, these components comprise a "charge pump" which actually generates a 5V supply from the 3.3V, a different jumper (or two) is soldered and the internal Vcc is now 5V.

Some variants of these displays ("extended temperature") require even more voltage to drive the LCD, and so require an actual negative supply for Vo which may or may not be supplied by the module.

And by the same token, you will note that if your 5V supply "sags" excessively, the LCD will begin to fade as a result.