LCD I2C does not work! checklist

  • Make sure that you wire LCD to Arduino correctly.
  • Make sure that you install the correct library.
  • Make sure that your code is correct.
  • Adjust the brightness of LCD by rotating potentiometer in the backside of LCD
  • Depending on manufacturers, the I2C address of LCD may be different. Usually, the default I2C address of LCD is 0x27 or 0x3F. Try these values one by one. If you still failed, run the below code to find the I2C address.
// I2C address scanner program
#include <Wire.h>

void setup()
{
  Wire.begin();
  Serial.begin(9600);
  Serial.println("I2C Scanner");
}

void loop()
{
  byte error, address;
  int nDevices;

  Serial.println("Scanning...");

  nDevices = 0;
  for(address = 1; address < 127; address++ )
  {
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address < 16)
        Serial.print("0");

      Serial.print(address,HEX);
      Serial.println("  !");

      nDevices++;
    }
    else if (error==4)
    {
      Serial.print("Unknown error at address 0x");
      if (address < 16)
        Serial.print("0");

      Serial.println(address,HEX);
    }
  }

  if (nDevices == 0)
    Serial.println("No I2C devices found");
  else
    Serial.println("done");

  delay(5000); // wait 5 seconds for next scan
}

Learn more about LCD I2C in Arduino - LCD I2C tutorial.

Good luck!

IoT_hobbyist:
Adjust the brightness of LCD by rotating potentiometer in the backside of LCD

Trick here: with only power, no data, it should display a row of black and white boxes. Adjust until these are the desired darkness/brightness.

Make sure that you wire LCD to Arduino correctly.

You may like to expand on this in your original post...
e.g. 4K7 resistors etc...
Beginners don’t know what ‘correctly’ is.

For I2C character based LCDs with the hd4478 LCD driver the best current library is the hd44780 library by Bill Perry. The library will, automatically, detect the I2C address and the I2C backpack to LCD pin mapping.

The library is available for install through the library manager.

I am trying to find the question in this thread ?

jackthomson42:
I am trying to find the question in this thread ?

Read the forum heading...

tutorial.PNG

tutorial.PNG