The dispaly doesn't show the text

Hey I’m trying to make a LCD 16x2 I2C display print hello world. Arduino isn’t complaining about the code, but the text isn’t showing up.

Thank you for your help :slight_smile:

Here is the code

// Simple i2c LCD Hello World by www.youtube.com/techydiy

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  // put your setup code here, to run once:
  lcd.begin();
  lcd.clear();
  lcd.print("hello world!");
}

void loop() {
  // put your main code here, to run repeatedly:

}

Were there any examples with the LCD library ?

How is the LCD connected to the Arduino ?

Are you sure of the address of the LCD ? Download an I2C scanner and confirm it

Can it be true that the address of the LCD is 0x60?

Koba_Prime:
Can it be true that the address of the LCD is 0x60?

It might be

Run a scanner and find out

// --------------------------------------
// i2c_scanner
//
// Version 1
//    This program (or code that looks like it)
//    can be found in many places.
//    For example on the Arduino.cc forum.
//    The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
//     Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26  2013
//    V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
//    by Arduino.cc user Krodal.
//    Changes by louarnold removed.
//    Scanning addresses changed from 0...127 to 1...119,
//    according to the i2c scanner by Nick Gammon
//    http://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
//    As version 4, but address scans now to 127.
//    A sensor seems to use address 120.
//
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//

#include <Wire.h>


void setup()
{
  Wire.begin();
  Serial.begin(115200);
  Serial.println("\nI2C Scanner");
}


void loop()
{
  byte error, address;
  int nDevices;
  Serial.println("Scanning...");
  nDevices = 0;
  for (address = 1; address < 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the 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\n");
  else
    Serial.println("done\n");
  delay(5000);           // wait 5 seconds for next scan
}

The scanner says 0x60.

I have the SDA connected to the A4 port on the Arduino. The SCL to the A5 port. GND to GND on the Arduino and VCC to the 5V port.

Gave you changed your program to use address 0x60 ?
Does it work ?

It is still not working

/*
  LiquidCrystal Library - Hello World

 Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
 library works with all LCD displays that are compatible with the
 Hitachi HD44780 driver. There are many of them out there, and you
 can usually tell them by the 16-pin interface.

 This sketch prints "Hello World!" to the LCD
 and shows the time.

  The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * LCD VSS pin to ground
 * LCD VCC pin to 5V
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)

 Library originally added 18 Apr 2008
 by David A. Mellis
 library modified 5 Jul 2009
 by Limor Fried (http://www.ladyada.net)
 example added 9 Jul 2009
 by Tom Igoe
 modified 22 Nov 2010
 by Tom Igoe

 This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/LiquidCrystal
 */

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(0x60, 12, 11, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis() / 1000);
}

That sketch is different from the original one and won't work with an I2C LCD. Change the address in the original one and try that

I tried with the original sketch and still nothing happened.

// Simple i2c LCD Hello World by www.youtube.com/techydiy

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x60, 16, 2);

void setup() {
  // put your setup code here, to run once:
  lcd.begin(16,2);
  lcd.clear();
  lcd.print("hello world!");
}

void loop() {
  // put your main code here, to run repeatedly:

}

Please post the output of the scanner

I2C Scanner Scanning... I2C device found at address 0x60 ! done

Here you go.

Is the program in reply #8 one of the library examples ?

With I2C LCDs one must know the I2C expander to LCD pin mapping as well as the I2C address. I recommend the hd44780 LCD library. That library will auto detect the address and the I2Cexpander to LCD pin mapping. The hd44780 library is available for install in the library manager. In library manager in the Topic dropdown select Displays and in the Filter box enter hd44780. Select and install the hd44780 by Bill Perry library. Use the hd44780_I2Cexp class. There is example code that comes with the library as well as a diagnostic sketch that will help troubleshoot if you still have trouble.

EDIT: What Arduino are you using?

Hmmm…

Most I2C to parallel converter boards have a trimmer pot to adjust contrast. Have you tried adjusting it to see if it makes any difference?

I’ve been caught out by this before when the pot arrived from the factory set to zero contrast and there was no display on the LCD.

Ian