I2C LCD not showing any text, though the screen can blink and such

Hey guys,

Im kind of new to arduino, and trying to figure out to use the LCD through an i2c module.

Im getting the screen to blink, but somehow there isnt any text showing. It seems like the code doesnt get the text to the lcd.

In the pictures you can see it connected temporarly and there is the code we tried last. (tried different ones) with this code the screen will blink 3 times, after that the text is not showing.

Can someone seem to figure out whats wrong?
If already checked the address for the lcd. Its correct at 0x27 and size is 16,2.

(attachments are the pictures of the connections to the arduino) and code below:


#include <Wire.h> // Comes with Arduino IDE
// Get the LCD I2C Library here:
// https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
#include <LiquidCrystal_I2C.h>

// set the LCD address to 0x27 for a 20 chars 2 line display
// Set the pins on the I2C chip used for LCD connections:
// addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x27, 6, 5, 4, 11, 12, 13, 14, 3, POSITIVE); // Set the LCD I2C address

void setup()
{
Serial.begin(9600); // Used to type in characters
lcd.begin(16,2); // initialize the lcd for 16 chars 2 lines, turn on backlight

// ------- Quick 3 blinks of backlight -------------
for(int i = 0; i< 3; i++) {
lcd.backlight();
delay(250);
lcd.noBacklight();
delay(250);
}
lcd.backlight(); // finish with backlight on

//-------- Write characters on the display ------------------
// NOTE: Cursor Position: (CHAR, LINE) start at 0
lcd.setCursor(0,0); //Start at character 4 on line 0
lcd.print("Hello, world!");
delay(1000);
lcd.setCursor(0,1);
lcd.print("HI!YourDuino.com");
delay(8000);

// Wait and then tell user they can start the Serial Monitor and type in characters to
// Display. (Set Serial Monitor option to "No Line Ending")
lcd.clear();
lcd.setCursor(0,0); //Start at character 0 on line 0
lcd.print("Use Serial Mon");
lcd.setCursor(0,1);
lcd.print("Type to display");

}

void loop()
{
{
// when characters arrive over the serial port...
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.clear();
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());
}
}
}

}


Thanks in advance,

Dave

EDIT: Could attach photos, here a link

https://intib.stackstorage.com/index.php/s/qRAaDLVtoCj8Ftu
https://intib.stackstorage.com/index.php/s/KlzuFRUM8jqOrxe
https://intib.stackstorage.com/index.php/s/vFV97pQQ71O3fvs
https://intib.stackstorage.com/index.php/s/La7WsFLKx6Dc2mf

(deleted)

spycatcher2k:
Would LiquidCrystal_I2C lcd(0x27); not do? I don't have one of these but the source looks to use this format.

Tried to use the code as following:

LiquidCrystal_I2C lcd((0x27), 6, 5, 4, 11, 12, 13, 14, 3, POSITIVE);

Though the problem still persists. The problem doesnt seem to be in the address form since it will blink, so the address should be okay.

Though the text is just nog showing up because of some reason i cant find.

Here is how it looks after running the problem, turned up te contrast to see :slight_smile: it aint a contrast problem though :slight_smile:
https://intib.stackstorage.com/index.php/s/tvE9Zk4Ir1MQsOx

You need to make sure the pins in the constructor (0x27, 6, 5, 4, 11, 12, 13, 14, 3, POSITIVE)) match the way the I2C expander is wired to the LCD.

http://forum.arduino.cc/index.php?topic=319282.0

In reply #5 there is attached a sketch that may help.

groundfungus:
You need to make sure the pins in the constructor (0x27, 6, 5, 4, 11, 12, 13, 14, 3, POSITIVE)) match the way the I2C expander is wired to the LCD.

forum.arduino.cc/index.php?topic=399126.msg2745325#new

In reply #5 there is attached a sketch that may help.

Link is of this page?
Then i cant look :slight_smile:

Tnx

Sorry, I don't know how I did that. Fixed the link.

groundfungus:
Sorry, I don't know how I did that. Fixed the link.

The first configuration of:
lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE)
Also makes the lcd blinks 3 times, though it wouldnt display any text during any of the tests?

If i use the configuration above the problem persists.. seems like thats not the right pin connections?

Did you change the constructor in your sketch to lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE) and run it?

groundfungus:
Did you change the constructor in your sketch to lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE) and run it?

Yes, i did, though the problem stays the same, backlight will blink 3 times, (pin 3) but it wont show any text.

My guess is i should be another connection, (0x27, ...)

Can we start from scratch? First, load and run the I2C scanner to confirm the I2C expander address. This will tell you the address.

// I2C scanner by Nick Gammon.  Thanks Nick.

#include <Wire.h>

void setup() {
  Serial.begin (115200);

  // Leonardo: wait for serial port to connect
  while (!Serial) 
    {
    }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
  
  Wire.begin();
  for (byte i = 1; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

groundfungus:
Can we start from scratch? First, load and run the I2C scanner to confirm the I2C expander address. This will tell you the address.

// I2C scanner by Nick Gammon.  Thanks Nick.

#include <Wire.h>

void setup() {
  Serial.begin (115200);

// Leonardo: wait for serial port to connect
  while (!Serial)
    {
    }

Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
 
  Wire.begin();
  for (byte i = 1; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

So i did :slight_smile:

Reply came out on:

I2C scanner. Scanning ...
Found address: 39 (0x27)
Done.
Found 1 device (s).

Further?

First off, check that the contrast control on the back of the I2C piggyback device is correctly adjusted. It's a tiny potentiometer on the I2C device (that is presumably soldered directly to your LCD unit).

Secondly, ditch that LCD library that you are using. Whilst it may have had its time in the spotlight there are better ones out there specifically LCD Library which requires just a couple of parameters not all those numbers. This is the one I use all the time and it is head and shoulders above others (at this time, no doubt things will move on).

Use the example Hello World sketch in that library above to prove your LCD is adjusted correctly. All this will take you about 10 minutes to do and you will have a fully functioning LCD unit thereafter (assuming it does actually work, of course!)

Just suggestin' :grin:

Yo! VeryStealth,

Have you ever found a solution to this issue?

I am having two of those "devices". I though at the beginning my first one was defective.

I did some analisys

Here is the connexion with a multimeter.

LCD Pin on the PCF8574 Chip
16 k
15 a
14 d7 12 p7
13 d6 11 p6
12 d5 10 p5
11 d4 9 p4
10 d3
9 d2
8 d1
7 d0
6 e 6 p2
5 rw 5 p1
4 rs 4 p0
3 v0 3 P3
2 vdd
1 vss

Same issue, the lignt blink, I also change the arduino blick setting to confim the pin #3(V0) is effectively working.

I did few changes as:
lcd(0x27, 6 , 5, 4,11,12,13,14,3, POSITIVE)
lcd(0x27, 6 , 5, 4,9,10,11,12,3, POSITIVE)
lcd(0x27, 6 , 5, 4,12,11,10,9,3, POSITIVE)
lcd(0x27, 6 , 5, 4,14,13,12,11,3, POSITIVE)
I also tried the suggested:
lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE)
lcd(0x27, 16,2)
and I can confirm the scanner shows 0x27

The things I can confirm:

  • Address is effectively 0x27
  • It is communicating, pin #3 (v0) back lid works
  • Contrast has been played every time I tried.
    In fact, I use the direct connexion from the Arduino to the LCD with the helo world sample. And it works with the proper contrast.

I am puzzeled with this I2C Board.

I tried to modify the LiquidCrystal_I2C.cpp file to force the pinout. No success either.

These results are on both board and LCD.

Any help here?

I don't know why you're having problems so I can only suggest following the steps in my LCD YouTube video #23 (link here) to see if you get any joy. You don't have to do all the big digit stuff, just enough to get something displayed on your LCD screen.

Worth a shot, I would say.

look for I2CGUESSER