2004 LCD display displaying blank row then block row

I'm a relative newbie to displays, so I'm not sure about some things like contrasts. I got this new 2004 display with a I2C backpack and First, there was something wrong about it. The I2C scanner wouldn't display the address. So I just used the address "0" in my code. But the display showed a bunch of boxes instead the words. Here is the log of the Serial Monitor when scanning:


I2C Scanner
Scanning...
No I2C devices found

Scanning...
No I2C devices found

Scanning...
No I2C devices found


And attached are the display code (Stock from the downloaded I2C library)
The display result was a row of blank, blocks, blank, blocks
any ideas?

HelloWorld.pde (606 Bytes)

Try 0x3F or 0x27 as addresses. Make sure you have it wired correctly. Adjust the contrast pot if the backpack has one.

Compare the IO Extender of your I2LCD with the following:

1. If the chip is of type 8574, then address is: 0x20 - 0x27 (0b0100A2A1A0) depending on the jumper values of A0 - A2.

2. If the chip is of type 8574A, then the address is: 0x38 - 0x3F depending on the jumper values of A0 - A2.

If there are no solder bridges across the A0-A2 pads, the logic levels of the pads are High which can be checked by DVM.

If you search the forum, there are many threads about i2c LCD backpacks.

Your comment and the code do not agree.
You said you used "0" (which will not work) but the code you supplied is using address 0x27.
Details really matter when diagnosing issues.

These backpack devices are fairly simple devices and fairly robust.
In nearly all cases, the issue of it not working comes down to just a few things.

  • incorrect wiring (things like mixing up SDA and SCL signals)
  • poor connections (broken/bad wires on cables, not soldering backpack to LCD)
  • incorrect i2c address
  • incorrect contrast setting (rotate pot to see the pixels)
  • incorrect library configuration
    There are several different versions of backpacks and they use different wiring between the PCF8574 chip and the LCD.
    The library must know how it is wired or it won't work.
    The some libraries allow this to be configured (newLiquidCrystal) and some are hard coded for a particular pin wiring like the LiquidCrystal_I2C library available in the IDE library manager.
    When using a hard coded library it is simpler to use as there is no pin configuration to deal with but if the backpack does't match the hard coded pin wiring, it won't work.

Not seeing any i2c device from a scan is not good as it means the Arduino does not see an i2c address and ANY possible i2c address.
This often means a wiring issue like SDA and SCL are not properly hooked up or the wires themselves have issues.
It can also mean a problem with pullup resistors or voltages.
You never said what "Arduino" you are using.

I would suggest that you use my hd4480 library.
It will auto locate the i2c address and will auto detect the pin wiring between the PCF8574 and the LCD.
It also includes a diagnostic sketch that can help identify issues as it prints out diagnostic information to the serial port.
The hd44780 library is available in the IDE library manager so you can install it quickly and easily.
The i/o class for device using the PCF8574 i2c i/o expander, is hd44780_I2Cexp
Run the included I2CexpDiag sketch to verify things.
You can read more about on the github page: GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library
And also in the wiki.

--- bill