LCD I2C only shows a line of white boxes

Hi. I'm new to Arduino and I'm trying to use the LCD 16x02 (1602A ver5.2) with an LCD I2C converter module (haven't soldered it yet). So I tried to run the code but it didn't work and the screen kept displaying line of white boxes at line 1. Is there any way to fix this problem? (I have checked the contrast, the wire connection, and even run it on Wokwi website)

This is an interesting issue with several potential causes. Here are some key points to check:

  1. Connections:
  • Connections are critical, and if they aren’t soldered properly, unstable behavior like this is not unexpected. Ensure all connections are secure and well-made.
  1. Pull-Up Resistors:
  • Pull-up resistors are mandatory on the I²C bus; it won’t work without them. These resistors might already be on the I²C converter module or possibly on the Arduino, but without additional details, I can’t confirm their presence or proper configuration.
  1. LCD Display Power:
  • The LCD display requires power, typically 5V, unless you are using a specialized version. I assume there are wires providing power to it, but this needs to be confirmed.
  1. Annotated Schematic:
  • Posting an annotated schematic showing your entire setup will help us better understand your configuration and pinpoint any issues.
  1. Code Issues:
  • While the code wasn’t provided, my "crystal ball" suggests there might be an issue around lines 1024 and 1025 (assuming these lines exist in your unposted code). Double-check to ensure they aren’t reversed or causing problems.
  • Posting your code would help validate the error point.

By addressing these potential issues and providing additional details, such as the schematic and code, we’ll be able to assist you more effectively in solving the problem.

1 Like

That's very likely your problem then.

4 Likes

Thanks for your response!
Except for the soldering (I'll do it tomorrow), I wire exactly like this image (on Wokwi, it combines the LCD and the I2C module converter)


Here is my code:

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
  Wire.begin();
  lcd.init();
  lcd.backlight();
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("LCD Working!");
}
void loop() {
  // lcd.setCursor(2, 0);
  // lcd.print("Chao Minh");
  lcd.setCursor(0, 1);
  lcd.print(millis() / 1000);
}
  • Solder the PCF8574 to the LCD. It will not work (reliable) until it is soldered.
  • Next step is to test the I2C address with the I2C Scanner (for the Arduino Uno you will find it in the Examples / Wire / i2c_scanner)
  • Test the LCD with the sketch from the library - use the address like reported from the I2C Scanner