Vlue Lcd 1206 only showing squares

So i was trying to connect lcd 1206 from elegoo pack to my mega 2560 r3 board and display basic hello world but see white squares 5x5 and dark blue rectangles 5x8. I tried using solution from in the last post this forum LCD only show squares - SOLVED but it didn’t work for me


![image|375x500]
(upload://4E3cG9gDWqcClJxS6VkNslSXnDg.jpeg)
This is my setup and the code is

#include <LiquidCrystal.h>


LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void setup() {

  lcd.begin(16, 4);
  lcd.print("Hello, World!");
}

void loop(){}

If you’ll need any additional information feel free to ask

  • Need better in focus images, multiple views.

You have a "1602" LCD, not a 1206 or a 1604... change your code to this...

lcd.begin(16, 2);

Concerning the "squares"... Verify the potentiometer changes the LCD contrast as you turn it.

Yes I meant 1602, contrast does change when I turn it.

Excellent.

Can you verify your wiring for Uno pins 7, 8, 9, 10, 11, 12? With breadboards, it sometimes looks like the pin is being inserted in the correct socket, but is actually one-pin off.

A single row of rectangles usually indicates that the LCD has not been set up. A common cause of that is incorrect wiring, or code.

Your code, as shown, is not correct for that LCD. You have defined an incorrect number of rows for the display you have.

Your wiring may not be correct as well. Clear, well lit, in-focus pictures are required to determine that.

Okay, thanks for pointing that out, i will check the code and wiring later.

Hey mihahaha,

It is very common to see those solid blocks (often called "ghost blocks") when first setting up an LCD. It usually means the screen has power but hasn't been properly initialized by the code or the contrast is off.

Based on your photo and code, there are three likely reasons why this isn't working:

1. Contrast Adjustment (Most Likely)

The small black knob on your breadboard is a potentiometer used to adjust the contrast. If it is turned too far in one direction, the screen will only show solid rectangles; too far the other way, and the text will be invisible.

  • Fix: While the board is powered on, slowly turn the knob of the potentiometer from one extreme to the other. You should eventually see the "Hello, World!" text appear through the blocks.

2. Code vs. Hardware Mismatch

In your code, you have defined the LCD pins as:

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

The standard order for this function is: (RS, Enable, D4, D5, D6, D7).

Looking at your image, it is difficult to trace every wire, but if you followed the standard Elegoo tutorial, you might have swapped the RS and Enable pins or the data pins.

  • Fix: Double-check that Pin 7 on your Mega is going to the RS pin on the LCD, and Pin 8 is going to the Enable pin. If they are swapped, the screen will never initialize.

3. The lcd.begin Dimensions

You are using a 16x2 LCD (two rows of 16 characters), but your code says:

lcd.begin(16, 4);

  • Fix: Change that line to lcd.begin(16, 2);. While this usually doesn't cause the "blocks" issue, it can cause text to wrap incorrectly or fail to display on the second line.

Troubleshooting Checklist

If the contrast knob doesn't fix it, try these steps:

  1. Check for "Floaters": Ensure the jumper wires are pushed firmly into the breadboard. If one of the data pins (D4–D7) is loose, the screen will stay on "blocks."

  2. Verify Ground: Ensure the LCD's R/W pin (usually pin 5) is connected to GND. If it’s floating, the LCD won't receive commands.

  3. Check Power: Ensure you are using the 5V pin on the Mega, not 3.3V, as these screens typically require 5V to drive the logic correctly.

I hope this will help you :grinning_face_with_smiling_eyes:

there is an update:

lcd.begin(16, 4);

I was just testing what happens if i put 4 rows, but 2 rows does not work as well.
johnbravo22

  1. Contrast does work but i do not see the text appearing after turning it couple of times.
  2. I double checked connections everything is connected looks right to me.
  3. as I just said I tested it, after testing same issues with (16, 2)
    providing more pictures as was asked(for some reason second image did not uploaded)


i also tried connecting rw to mother board as in LC lib but did not helped either.
Update, tried as well connecting it from zero to a different breadboard, same issue.

update, tried reconnecting with f-m wires so that connection is more "secure".
still same problem

Show the sketch you are using.
Make the boxes go away or be faint.
You need to verify the LCD data lines, D4...D7

[edit]

Also... test the second line of the LCD...

#include <LiquidCrystal.h>

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void setup() {
  lcd.begin(16, 2);

  lcd.setCursor(0, 0);
  lcd.print("Hello, World!");
  lcd.setCursor(0, 1);
  lcd.print("World, Hello!");
}

void loop() {}

#include <LiquidCrystal.h>

LiquidCrystal lcd(7, 8, 9, 10, 11, 12, 13);

void setup() {

  lcd.begin(16,2);

  
  lcd.setCursor(0, 0);
  lcd.print("Hello, World!");
  lcd.setCursor(0, 1);
  lcd.print("World, Hello!");
}
void loop() {}

the code i used to test just now, same issue.
i also tried this guide with no libraries https://www.youtube.com/watch?v=_C0TewvJ5z0&list=PL_zvrXFdKgZqFar78mjQCHffEN2GVrSAt&index=16
but its still the same issue :sad_but_relieved_face:.

Would you show a photo of the reverse/under side of the LCD?

of course, here it is

Do not do this... see post #18. This connects an output HIGH to an output LOW.
I was trying to make a shorting pin check with fewest connections. Do not do this.

First, please, disconnect power from the breadboard, and remove all connections.

Next... would you wire your LCD to your MEGA2560 like this... (using the pins for LCD, jumper them to the ground-rail of the breadboard.

And run this code...

const int pin[] = {12, 11, 10, 9, 8, 7};

void setup() {
  for (int i = 0; i < 6; i++) {
    pinMode(pin[i], OUTPUT);
  }
  pinMode(LED_BUILTIN, INPUT);
  delay(1000);
}

void loop() {
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < pin[i]; j++) {
      digitalWrite(pin[i], HIGH);
      delay(100);
      digitalWrite(pin[i], LOW);
      delay(300);
    }
    delay(3000);
  }
  delay(5000);
}

If the output ports (7, through 12) work correctly, you will see the "L" LED blink 12 times, then pause for three seconds, then blink 11 times, and pause, then 10, 9, 8, 7, then pause for five seconds. This is to test the ability of the pins being used are capable of "OUTPUT."

  • Those jumper wires are notorious for bad connections.
  • Use Dupont type jumpers.
  • Use a common type LED and series 220R resistor to make sure each Dupont jumper is good.

+5V—A[LED]K—[220R]—DupontJumper—GND

  • All the pins in the array are shorted together (7-12).
  • The above makes the pins in the array LOW.

  • Below you are making one output pin HIGH when other pins are LOW. :woozy_face:


      digitalWrite(pin[i], HIGH);
      delay(100);

  • Where is the GND wire ?

yes, i tried different things while waiting for responses in forum, because didnt wanted to just sit around and wait, i will now try what xfpd recommended.