LCD with I2C not displaying characters

I have a problem
LCD blinks if I program it so but it doesn't show the words
I tried adjusting the potetiometer but nothing changes. The light is always the same.
And I tried 0x3F and 0x20 and 0x27 ...basically everything

Here is the report from the HD44780

********************************************************************
Serial Initialized
--------------------------------------------------------------------
I2CexpDiag - i2c LCD i/o expander backpack diagnostic tool
--------------------------------------------------------------------
hd44780 lib version: 0.7.1
--------------------------------------------------------------------
Reported Arduino Revision: 1.8.4
F_CPU: 16000000
--------------------------------------------------------------------
SDA: digital pin: 18
SCL: digital pin: 19
--------------------------------------------------------------------
Checking for required external I2C pull-up on SDA - YES
Checking for required external I2C pull-up on SCL - YES
--------------------------------------------------------------------
Scanning i2c bus for devices..
 i2c device found at address 0x3F
Total I2C devices found: 1
--------------------------------------------------------------------
Scanning i2c bus for all lcd displays
 LCD at address: 0x3F | config: P01245673H | R/W control: Yes
Total LCD devices found: 1
--------------------------------------------------------------------
LCD Display Memory Test
Display: 0
 Walking 1s data test:  Compare error: addr: 0 read FF != wrote 1
 Compare error: addr: 0 read FF != wrote 2
 Compare error: addr: 0 read FF != wrote 4
 Compare error: addr: 0 read FF != wrote 8
 Compare error: addr: 0 read FF != wrote 10
 Compare error: addr: 0 read FF != wrote 20
 Compare error: addr: 0 read FF != wrote 40
 Compare error: addr: 0 read FF != wrote 80
 Compare error: addr: 40 read FF != wrote 1
 Compare error: addr: 40 read FF != wrote 2
 Compare error: addr: 40 read FF != wrote 4
 Compare error: addr: 40 read 22 != wrote 8
 Compare error: addr: 40 read 22 != wrote 10
 Compare error: addr: 40 read 22 != wrote 20
 Compare error: addr: 40 read 22 != wrote 40
 Compare error: addr: 40 read 22 != wrote 80
 Compare error: addr: 10 read 22 != wrote 1
 Compare error: addr: 10 read 22 != wrote 2
 Compare error: addr: 10 read 22 != wrote 4
 Compare error: addr: 10 read 22 != wrote 8
 Compare error: addr: 10 read 22 != wrote 10
 Compare error: addr: 10 read 22 != wrote 20
 Compare error: addr: 10 read 22 != wrote 40
 Compare error: addr: 10 read 22 != wrote 80
 Compare error: addr: 50 read 22 != wrote 1
 Compare error: addr: 50 read 22 != wrote 2
 Compare error: addr: 50 read 22 != wrote 4
 Compare error: addr: 50 read 22 != wrote 8
 Compare error: addr: 50 read 22 != wrote 10
 Compare error: addr: 50 read 22 != wrote 20
 Compare error: addr: 50 read 22 != wrote 40
 Compare error: addr: 50 read 22 != wrote 80
FAILED
    Address line test:  Compare error: addr: 0 read FF != wrote 0
 Compare error: addr: 1 read FF != wrote 1
 Compare error: addr: 2 read FF != wrote 2
 Compare error: addr: 3 read FF != wrote 3
 Compare error: addr: 4 read FF != wrote 4
 Compare error: addr: 5 read FF != wrote 5
 Compare error: addr: 6 read FF != wrote 6
 Compare error: addr: 7 read FF != wrote 7
 Compare error: addr: 8 read FF != wrote 8
 Compare error: addr: 9 read FF != wrote 9
 Compare error: addr: B read FF != wrote B
 Compare error: addr: C read FF != wrote C
 Compare error: addr: E read FF != wrote E
 Compare error: addr: F read FF != wrote F
 Compare error: addr: 10 read FF != wrote 10
 Compare error: addr: 11 read FF != wrote 11
 Compare error: addr: 12 read FF != wrote 12
 Compare error: addr: 13 read FF != wrote 13
 Compare error: addr: 14 read FF != wrote 14
 Compare error: addr: 15 read FF != wrote 15
 Compare error: addr: 16 read FF != wrote 16
 Compare error: addr: 17 read FF != wrote 17
 Compare error: addr: 18 read FF != wrote 18
 Compare error: addr: 19 read FF != wrote 19
 Compare error: addr: 1A read FF != wrote 1A
 Compare error: addr: 1B read FF != wrote 1B
 Compare error: addr: 1C read FF != wrote 1C
 Compare error: addr: 1D read FF != wrote 1D
 Compare error: addr: 1E read FF != wrote 1E
 Compare error: addr: 1F read FF != wrote 1F
 Compare error: addr: 20 read FF != wrote 20
 Compare error: addr: 21 read FF != wrote 21
 Compare error: addr: 22 read FF != wrote 22
 Compare error: addr: 23 read FF != wrote 23
 Compare error: addr: 24 read FF != wrote 24
 Compare error: addr: 25 read FF != wrote 25
 Compare error: addr: 26 read FF != wrote 26
 Compare error: addr: 27 read FF != wrote 27
 Compare error: addr: 40 read 22 != wrote 40
 Compare error: addr: 41 read 22 != wrote 41
 Compare error: addr: 42 read 22 != wrote 42
 Compare error: addr: 43 read 22 != wrote 43
 Compare error: addr: 44 read 22 != wrote 44
 Compare error: addr: 45 read 22 != wrote 45
 Compare error: addr: 46 read 22 != wrote 46
 Compare error: addr: 47 read 22 != wrote 47
 Compare error: addr: 48 read 22 != wrote 48
 Compare error: addr: 49 read 22 != wrote 49
 Compare error: addr: 4A read 22 != wrote 4A
 Compare error: addr: 4B read 22 != wrote 4B
 Compare error: addr: 4C read 22 != wrote 4C
 Compare error: addr: 4D read 22 != wrote 4D
 Compare error: addr: 4E read 22 != wrote 4E
 Compare error: addr: 4F read 22 != wrote 4F
 Compare error: addr: 50 read 22 != wrote 50
 Compare error: addr: 51 read 22 != wrote 51
 Compare error: addr: 52 read 22 != wrote 52
 Compare error: addr: 53 read 22 != wrote 53
 Compare error: addr: 54 read 22 != wrote 54
 Compare error: addr: 55 read 22 != wrote 55
 Compare error: addr: 56 read 22 != wrote 56
 Compare error: addr: 57 read 22 != wrote 57
 Compare error: addr: 58 read 22 != wrote 58
 Compare error: addr: 59 read 22 != wrote 59
 Compare error: addr: 5A read 22 != wrote 5A
 Compare error: addr: 5B read 22 != wrote 5B
 Compare error: addr: 5C read 22 != wrote 5C
 Compare error: addr: 5D read 22 != wrote 5D
 Compare error: addr: 5E read 22 != wrote 5E
 Compare error: addr: 5F read 22 != wrote 5F
 Compare error: addr: 60 read 22 != wrote 60
 Compare error: addr: 61 read 22 != wrote 61
 Compare error: addr: 62 read 22 != wrote 62
 Compare error: addr: 63 read 22 != wrote 63
 Compare error: addr: 64 read 22 != wrote 64
 Compare error: addr: 65 read 22 != wrote 65
 Compare error: addr: 66 read 22 != wrote 66
 Compare error: addr: 67 read 22 != wrote 67
FAILED
--------------------------------------------------------------------
Each display should be displaying its #, address, and config information
If display is blank, but backlight is on, try adjusting contrast pot
If backlight is off, wait for next test
--------------------------------------------------------------------
Blinking backlight test: to verify BL level autodetection
If backlight is mostly off but
you briefly see "BL Off" on display with backlight on,
then the library autodetected incorrect BL level
and the library cannot autoconfigure the device
--------------------------------------------------------------------
Displaying 'uptime' on all displays
--------------------------------------------------------------------

If you are not sure about the device address of your I2CLCD, please run the following (attached) address scanner program. You can edit this program to specify the range addresses to check. The preset setting is: 0x20 - 0x3F.

And then, you may try using #include <LiquidCrystal_I2C.h> Library. Mine I2CLCD works with bot this library and HD44780 library.

Address_Search.ino (520 Bytes)

GolamMostafa:
If you are not sure about the device address of your I2CLCD, please run the following (attached) address scanner program. You can edit this program to specify the range addresses to check. The preset setting is: 0x20 - 0x3F.

And then, you may try using #include <LiquidCrystal_I2C.h> Library. Mine I2CLCD works with bot this library and HD44780 library.

I got this output .-.
I dont know what wrong

Address search

Search at [20]: not found
Search at [21]: not found
Search at [22]: not found
Search at [23]: not found
Search at [24]: not found
Search at [25]: not found
Search at [26]: not found
Search at [27]: not found
Search at [28]: not found
Search at [29]: not found
Search at [2A]: not found
Search at [2B]: not found
Search at [2C]: not found
Search at [2D]: not found
Search at [2E]: not found
Search at [2F]: not found
Search at [30]: not found
Search at [31]: not found
Search at [32]: not found
Search at [33]: not found
Search at [34]: not found
Search at [35]: not found
Search at [36]: not found
Search at [37]: not found
Search at [38]: not found
Search at [39]: not found
Search at [3A]: not found
Search at [3B]: not found
Search at [3C]: not found
Search at [3D]: not found
Search at [3E]: not found

The Address_Search.ino program should search for 32 locations (0x020 - 0x3F); why is it searching only 31 locations; it is missing 0x3F which is probably the address of your LCD. Please, run this program (attached). In this program, I have set the address range : x20 - 0x4F. Please, report back what address value you have got.

Address_Search.ino (520 Bytes)

Okay yea it is 3F FOUND
but now when I start the hello world it just blinks ...

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



#define BACKLIGHT_PIN     7

//LiquidCrystal_I2C lcd(0x3F);  // Set the LCD I2C address

LiquidCrystal_I2C lcd(0x3F, BACKLIGHT_PIN, POSITIVE);  // Set the LCD I2C address


// Creat a set of new characters
const uint8_t charBitmap[][8] = {
   { 0xc, 0x12, 0x12, 0xc, 0, 0, 0, 0 },
   { 0x6, 0x9, 0x9, 0x6, 0, 0, 0, 0 },
   { 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0, 0x0 },
   { 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0, 0x0 },
   { 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0x0 },
   { 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0x0 },
   { 0x0, 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0x0 },
   { 0x0, 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0x0 }
   
};

void setup()
{
   int charBitmapSize = (sizeof(charBitmap ) / sizeof (charBitmap[0]));

  // Switch on the backlight
  pinMode ( BACKLIGHT_PIN, OUTPUT );
  digitalWrite ( BACKLIGHT_PIN, HIGH );
  
  lcd.begin(16,2);               // initialize the lcd 

   for ( int i = 0; i < charBitmapSize; i++ )
   {
      lcd.createChar ( i, (uint8_t *)charBitmap[i] );
   }

  lcd.home ();                   // go home
  lcd.print("Hello, ARDUINO ");  
  lcd.setCursor ( 0, 1 );        // go to the next line
  lcd.print (" FORUM - fm   ");
  delay ( 1000 );
}

void loop()
{
   lcd.home ();
   // Do a little animation by writing to the same location
   for ( int i = 0; i < 2; i++ )
   {
      for ( int j = 0; j < 16; j++ )
      {
         lcd.print (char(random(7)));
      }
      lcd.setCursor ( 0, 1 );
   }
   delay (200);
}

OK! Execute the following tested codes. the Hello! should appear on the Top Line of your LCD.

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F, 16, 2); 

void setup() 
{
 lcd.init();
 lcd.backlight();
 lcd.setCursor(0, 0); //DP0 of Top Line
 lcd.print("Hello!");
}


void loop() 
{

}

nothing it just blinks 1 time and then goes black

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F, 16, 2); 

void setup() 
{
 lcd.begin(16,2);
 lcd.backlight();
 lcd.setCursor(0, 0); //DP0 of Top Line
 lcd.print("Hello!");
}


void loop() 
{

}

nothing it just blinks 1 time and then goes black

Yes! It is like that and then the message comes on the LCD.

Check the connection of the I2C Bus. SDA line of LCD should go at A4, and SCL line of LCD should go to A5 of the Arduino (UNO). After running the program, slowly rotate the contrast pot (min to max) located on the small IO board back on the LCD. Also check that backlight jumper is ON.

If you have another I2CLCD, connect that one and check the functionality.

BTW; Have you added the line lcd.begin(16, 2); in the program that I have provided you. It should not be there. Please, remove this line and execute the program. The constructor (lLiquidCrystal_I2C lcd(0x3F, 16, 2);) has taken care of it.

Also, the lcd.init(); is not there! Who has removed this line from the program? Please, add this line in the program. The program is like this:

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F, 16, 2); 

void setup() 
{
 lcd.init();
 lcd.backlight();
 lcd.setCursor(0, 0); //DP0 of Top Line
 lcd.print("Hello!");
}


void loop() 
{

}

Copy the above program in your IDE and upload unchanged.

My library doesnt include lcd.init......
It says it doesnt recognize it..

And yea I tried the contrast

Try including this library in your IDE.

nothing but now the backlight comes on ...I tried lowering and increasig the contrast
@GolamMostafa

Darkboss99,
I suggest you ignore GolamMostafa.
He has offered similar unhelpful advice to others in a few other threads.
The advice he has offered you is not helpful and is just wasting your time.

There is no need to run any other sort of i2c scanner as that capability is built into the I2CexpDIag tool.
I2CexpDiag did a full address scan and reported a single i2c slave at 0x3f and that the i2c address is of the backpack is 0x3f
There is also no need to run any other i2c LCD library as hd44780 and the I2CexpDiag tool is all you need to help diagnose these types of issues.

The hd44780 library version you are using is very old. I'm curious where you got it.
Did you install it back in 2016?

First thing, I would like you to do is update to the latest hd44780 library
Use the IDE library manager and select hd44780 library version 0.9.3 from the list and update it.
(Just click on the update button to update library)
You want the newer version of hd44780 as there have been many fixes and updates since 0.7.1

You will likely see the same issues from I2CexpDiag, but there are several important fixes that you need so make sure to update the library to the latest version.

In terms of your issue, while it could be a bad LCD or a bad PCF8574 chip , those issues are very rare.
It appears that there is connectivity issues between PCF8574 chip and the LCD.
That is what causes the compare issues during the memory tests.

These types of errors are almost always caused by two things.

  • The PCF8574 chips is not properly soldered to the backpack PCB (this is not very common)
  • The backpack is not properly soldered to the LCD module PCB.

Given you are seeing issues with nearly all bits of the data,
I would suspect that the LCD backpack is not soldered to the LCD module.

Have you soldered the LCD backpack to the LCD module?

If not, that is your issue.
If you have, please post some photos of your LCD backpack and include some photos of the solder connections to the LCD module so we can inspect the solder joints for any issues.

--- bill

it works now

Darkboss99:
it works now

So what did you change/fix?

well I changed the library and resoldered the wires and it worked..
it displayed everyhing

but now it just shows white boxes ???
what could cause that

Darkboss99:
well I changed the library and resoldered the wires and it worked..
it displayed everyhing

but now it just shows white boxes ???
what could cause that

re-soldering could fix connection issues that can cause memory issues.

You need to provide more details.
In post number 12 you said:

it works now

But now you say it isn't working.

What is working and what isn't?
And what s/w are you using to test & verify that things are working?
hd44780 and I2CexpDiag is the best tool for testing and verifying the device.

If all characters are boxes, then the contrast pot is not adjusted correctly.

--- bill

I am using hd44780 for testing and it works...

Well I compiled hello world and everything and it worked

but now I came back and wired it again (properly) and it just shows the white boxes

Darkboss99:
I am using hd44780 for testing and it works...

Well I compiled hello world and everything and it worked

but now I came back and wired it again (properly) and it just shows the white boxes

You say it is working and then that it isn't.
I don't understand.

Wired it again?? What does that mean? and why? if everything was working why re-wire it?
"the white boxes"... it very much matters if the boxes are on all lines of the LCD or just some of them.

  • Did you update the library to the latest version (currently 0.9.3) ?
  • Is I2CexpDiag working? (all tests pass and you see the expected output on the LCD)

--- bill