LCD/LCM1602 stops taking input

Hello all,

I am running into problems with my LCD/LCM1602 IIC V1.
It is behaving as expected, shows text, but sometimes just stops taking input or even fails to initialize.
Usually the initial begin() and print() works, but any subsequent inputs are ignored (even clear() etc), but sometimes everything just keeps working. If input fails, only a complete powerdown will fix it.

I am using the library by F Malpartida.

Problems are probably hardware, but I am not sure at the moment. I already switched jumpercables, to no avail.

Thanks for the help!

Yes, first read the instructions for submitting queries, then post your code and a perfectly focused photograph of your set-up with all wires clearly visible as they terminate on the modules and show that as a link in the text, not an attachment.

The best way to do this is to take it outside in full daylight but not direct sun and use a digital camera at least a meter away from directly above (or very slightly offset to ensure all the connections are able to be distinguished) using the (actual) zoom to just include all parts of the assembly.

Sounds like a programming problem to me.

Does it work OK with a simple program that just writes information to the screen and then stops. For this kind of test the program should have no code between the brackets in loop().

Don

OK, so I was employing a tongue-in-cheek method of determining if he had actually connected the display - by soldering - in the first place. :roll_eyes:

Thank you for your replies!

Currently the connections between LCD and Arduino are as follows:
GND ->GND (via breadboard)
VCC -> +5V (via breadboard)
SDA -> A4 (directly)
SCL -> A5 (directly)

Connections are using standard jumperwires; I haven't soldered because this is not yet the final setup.

Next to that I have a Piezzo attached to D3.

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

int piezzoPin = 3;
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

void setup(){
  lcd.begin(16,2);
  lcd.clear();
  lcd.print("TEST");
}

void loop(){

  //Check for serial input
  if(Serial.available())
  {
    String incoming = Serial.readStringUntil('\n');
    char header = incoming[0];
    String message = incoming.substring(1);
    lcd.clear();
    lcd.print(message);
    tone(piezzoPin,5000,100);
  }

}

Basicly, usually the LCD initializes fine and displays 'TEST'. Then, when I start inputting string via serial, sometimes it works fine, and sometimes the LCD does not update at all (but the piezzobeep is heard, so the above code is running).

Next to that, a lot of time when I reupload the program, the LCD keeps displaying old information and does not update, where you would expect it to display 'TEST' again.

Also, sometimes when I power up the Arduino the LCD does not initialize (e.g. show a top row of boxes) until after a couple of resets and it will work fine again.

Anyway, the problems are intermittent, which leads me to believe the error is not in the code.

I will attach some photo's later today, didn't have a lot of time yet :wink:

Please reread reply #2 and use a more suitable test program.

Don

floresta:
Please reread reply #2 and use a more suitable test program.

Don

I have used the code above, with an empty loop. I get the same results; When I power up the Arduino, sometimes it works immediately. Sometimes, the LCD does not initialize. Pressing the reset button a couple of times helps.

When I reupload the code on a running Arduino but with a different text to display, sometimes the old text stays displayed and sometimes the new text.

I cannot find any structure in reproducing the error. It might be something random, like noise on the I2C wires, but unfortunately I have no access to equipment like oscillators for troubleshooting this :frowning:

Now reread reply #1 and take a photo that we can use to verify your setup.

Don

Thanks for your patience guys,

I have taken some pictures with artificial light, as dusk has already set in. If connections are unclear I wil try again in daylight tomorrow.

Overview: http://i.imgur.com/avzVqt0.jpg
Arduino: http://i.imgur.com/gFCEx3m.jpg
LCD/LCM1602: http://i.imgur.com/J2Zr8KT.jpg

We cannot see the "whole" adapter board. It does not look as if there are any pull-up resistors for the I2C bus. Connect two 4k7 external resistors.

Some adapters have pull-ups and some do not. You only need one pair of pull-ups for the bus, regardless of how many I2C devices are connected.

I2C devices do not normally come with onboard pull-ups but the LCD adapters are often the only device that is ever used by an Arduino owner. So onboard resistors are quite handy. It saves you spending $0.02 on extra resistors.

It looks as if you have good soldered joints (on the adapter). Your jumper wires should be fairly reliable. However they do become loose with a lot of insertions.

David.

I am using the library by F Malpartida.

Did you follow the instructions concerning the removal of any and all other related libraries including the LiquidCrystal library that comes with the IDE?

Don

Wessel:
I have taken some pictures with artificial light, as dusk has already set in. If connections are unclear I will try again in daylight tomorrow.

david_prentice:
It looks as if you have good soldered joints (on the adapter).

I2C "backpacks" generally come with the pins soldered on. What is critical is that those pins are soldered to the LCD board - or that a header socket is soldered to it if it is intended to disconnect it later.

Adding pullups to the I2C bus seems to have done the trick! Thanks for the insight!

Regarding the other posts; I did completely replace the standard library and indeed the I2C-interface came already soldered to the LCD-board.