Fix: 16×2 I2C LCD shows only blocks or nothing
A row of white boxes or a lit blank screen. Turn the contrast trimmer, check the I2C address (0x27 or 0x3F) and power the LCD from 5 V.
Community draft — report a mistake
What you see
(top row: ████████████████ bottom row: empty)
I2C scanner: I2C device found at address 0x3F(top row: ████████████████ bottom row: empty) I2C scanner: I2C device found at address 0x3F
A row of blocks means the LCD has power but was never told what to show. Blank with backlight usually means contrast. Both are fixed in a minute with the trimmer and the right I2C address.
Quick fix — try in order
- 1
Turn the contrast trimmer
The blue potentiometer on the I2C backpack sets contrast. Turn it slowly until text appears — this fixes most cases.
- 2
Match the I2C address
PCF8574 backpacks use 0x27; PCF8574A ones use 0x3F. Use the address the scanner found in LiquidCrystal_I2C lcd(0x3F, 16, 2).
- 3
Call init() and backlight()
Without lcd.init() the controller is not set up and shows a row of blocks.
- 4
Power from 5 V
The LCD glass needs 5 V for contrast. On ESP32 use a level shifter on SDA/SCL — see the LCD page.
Why it happens
Why blocks on the top row?
That is the HD44780 controller’s power-on state: powered, but never initialised. The code did not run, used the wrong address, or the I2C wires are swapped.
Backlight on, no blocks
Contrast is too low. Turn the trimmer.
Garbled characters
Loose wires or a wrong library variant. Our guides compile with LiquidCrystal I2C 1.1.2.
Board-specific notes
Arduino Uno: Use SDA/SCL (A4/A5). See 16×2 LCD with Uno.
Parts: 16×2 I2C LCD · 20×4 I2C LCD — pinout, voltage and library notes.
Did this fix it?
Thanks — that helps us keep this page right.