Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.
Display · 16×2 LCD

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.

Arduino UnoESP32Arduino NanoUpdated 31 Oct 2026

Community draft — report a mistake

What you see

OutputOutput
(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. 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. 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. 3

    Call init() and backlight()

    Without lcd.init() the controller is not set up and shows a row of blocks.

  4. 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.

↑↓ to move · Enter to open