Lcd 20x4 witch i2c problem

Hello,
New here, English is not my best but ill try to use correct words.
My problem:
I have succesfully set up de 20x4 display with 10 Wires
Now i have an i2c to use the display with 4 wires.
Everything works. Thats the good part.
Now effective problem:
It only works if the whole setup is off the power supply for one day. So if i have waited one day, i put the setup in my usb connector from the laptop, de sketch seem to work, the things i want to display are on the lcd screen.
But whem i remove the power supply and put it back in, then there is noting more on the lcd screen. Same thing when i push the reset button. I can load up what i want: nothing comes on the screen.
Then i wait 15 to 20 ours, put the power supply on the arduino, it displays the last sketch i uploaded.

Anyone sees the problem here?

It could be an issue with the i2c pullups or it could be something else.
It is not possible to know much without knowing which hardware you have.

  • Arduino board
  • LCD
  • i2c adapter.

I am assuming that you are using a hd44780 LCD with an i2c backpack that uses an i2c expander chip.

You may want to try my hd44780 library.
It can be installed using the IDE library manager.
It includes a diagnostic sketch, I2cexpDiag that can test the i2c signals, the i2c adapter, and the LCD.
It will display information about the tests on the serial port.

Here is a link to the github page with more information: GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library
And the wiki: Home · duinoWitchery/hd44780 Wiki · GitHub

The i/o class for a LCD with an i2c backpack is called hd44780_I2Cexp.
See the examples under that i/o class, which includes the diagnostic sketch I2CexpDiag.

--- bill

I use the I2C from here:

The display from same shop:

arduino :

https://www.vanallesenmeer.nl/Arduino-uno-r3

The library installed is the one from here :

(i have tried the 1.3.4 and 1.3.5)

https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/

with all of the scetshes i have tried the same problem keeps uppearing :
When the setup is cut off the power for multiple ours, then the sketch appears nicely on the screen.
When i push the reset button , or reset by cutting off power and back on, then everything is gone.
It does not work to re-upload the sketch.
If i whate again a fiew owers, the last uploaded skecht does work.

This is one of the sketches that works , but with explaned problem above.

/* YourDuino.com Example Software Sketch
 20 character 4 line I2C Display
 Backpack Interface labelled "YwRobot Arduino LCM1602 IIC V1"
 Connect Vcc and Ground, SDA to A4, SCL to A5 on Arduino
 terry@yourduino.com */

/*-----( Import needed libraries )-----*/
#include <Wire.h>  // Comes with Arduino IDE
// Get the LCD I2C Library here: 
// https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
// Move any other LCD libraries to another folder or delete them
// See Library "Docs" folder for possible commands etc.
#include <LiquidCrystal_I2C.h>

/*-----( Declare Constants )-----*/
/*-----( Declare objects )-----*/
// set the LCD address to 0x27 for a 20 chars 4 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, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address


/*-----( Declare Variables )-----*/


void setup()   /*----( SETUP: RUNS ONCE )----*/
{
  Serial.begin(9600);  // Used to type in characters

  lcd.begin(20,4);         // initialize the lcd for 20 chars 4 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: Lines and Characters start at 0  
  lcd.setCursor(3,0); //Start at character 4 on line 0
  lcd.print("Hello, world!");
  delay(1000);
  lcd.setCursor(2,1);
  lcd.print("From YourDuino");
  delay(1000);  
  lcd.setCursor(0,2);
  lcd.print("20 by 4 Line Display");
  lcd.setCursor(0,3);
  delay(2000);   
  lcd.print("http://YourDuino.com");
  delay(8000);


}/*--(end setup )---*/


void loop()   /*----( LOOP: RUNS CONSTANTLY )----*/
{
 

}/* --(end main loop )-- */


/* ( THE END ) */

I hope with this information anybody can see what i am missing or doing wrong.

Thanks

I would recommend running the I2CexpDiag sketch in the hd44780 library to test the signals and the h/w.
Also try some of the hd44780_I2Cexp sketches and see if they have the same issue.

--- bill

Hello,

I have tried the sketch for diagnostics.
Accoring to the serial monitor information there is no display detected.
This is the information that came out of the serial monitor:

********************************************************************
Serial Initialized
--------------------------------------------------------------------
I2CexpDiag - i2c LCD i/o expander backpack diagnostic tool
--------------------------------------------------------------------
hd44780 lib version: 0.9.0
--------------------------------------------------------------------
Reported Arduino Revision: 1.8.2
CPU ARCH: AVR - F_CPU: 16000000
--------------------------------------------------------------------
 A4: digital pin: 18
 A5: digital pin: 19
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 0x27
Total I2C devices found: 1
--------------------------------------------------------------------
Scanning i2c bus for all lcd displays
No working LCD devices

I have tried the lcd with the normal 10wires to be sure, this is working correctly.
I olsow tried the example sketch "hello world" from this librairy, same problem.

That can happen if there are connection issues between the i2c backpack and the LCD.
Maybe there are soldering issues.
Can you post a few photos of your backpack and LCD so we can look at the connections and the soldering?

--- bill

:slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile:
It WORKS!!

Becouse indeed the sketch that you gave me said there was no display i tried to solder the i2c to the display instead of using the "klik board" (dont know the englisch word for that ting).
It workt but with a bit of flikkering of the backlight and some falty karakters.
Soldering it again made it work without fals karakters.
I think that it has to be solderd at the above of the display as the underside also.

Thanks fore the help!

I can now start with the next step : measuring and displaying temperature.

Haco2401:
:slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile:
It WORKS!!

Congratulations. That is good.
--- bill