Issue with IIC 1602 LCD to Arduino

Hi,

I was trying to use the LCD screen that came with my Arduino kit, it is this one:

IIC 1602 LCD

I followed the instructions on this website https://arduino-info.wikispaces.com/LCD-Blue-I2C and I ended up with this:

And I found the I2C address of my LCD screen was 0x3F so this is my code:

/* YourDuino.com Example Software Sketch
 16 character 2 line I2C Display
 Backpack Interface labelled "A0 A1 A2" at lower right.
 ..and
 Backpack Interface labelled "YwRobot Arduino LCM1602 IIC V1"
 MOST use address 0x27, a FEW use 0x3F
 terry@yourduino.com 
 modified by rpt007 */

/*-----( 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 16 chars 2 line display
// A FEW use address 0x3F  -> this is my LCD's address
// Set the pins on the I2C chip used for LCD connections:
//                    addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address

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

void setup()   /*----( SETUP: RUNS ONCE )----*/
{
  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; 
                   // rpt007: this command has to be repeated after each lcd.print-command !!

//-------- 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!");
  lcd.backlight();                // first additional insert of the backlight() command
  delay(1000);
  lcd.setCursor(0,1);
  lcd.print("HI!YourDuino.com");
  lcd.backlight();                // second additional insert of the backlight() command
  delay(4000);  

// 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.backlight();                  // third additional insert of the backlight() command
                                    // might not be necessary as you won't see the tiny delay
                                    // between this text and the follwing text which is only
                                    // visible after the fourth backlight() command line
                                    // but with the following delay-command activated you will notice
                                    // a significant (2sec) delay without any displayed text!!

  //delay(2000);                      // if you activate this line, you will see that only the 
                                    // previous lcd.backlight() command will show the "delayed" text
  
  lcd.setCursor(0,1);
  lcd.print("Type to display"); 
  lcd.backlight();                // fourth additional insert of the backlight() command


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


void loop()   /*----( LOOP: RUNS CONSTANTLY )----*/
{
  {
    // 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());
        lcd.backlight();            // fifth additional insert of backlight() command
                                          // without the command there is no text on the LCD visible
      }
    }
  }

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


/* ( THE END ) */

Everything seems that was going fine until, but the screen never showed the characters I wanted it to show:

I don't know if I did something wrong or if my lcd module is defective? Do you guys recommend buying a new one? What approach do you guys recommend?

I also recorded a video:

Thanks for your help

Try reworking your soldering and see if that helps. You can get some tips here.

Don

That's not his soldering afaik, it comes with the I2C backpack on it.

Use the example code that comes with the LiquidCrystal I2C library. Make sure the display works before doing all that other junk.

INTP:
That's not his soldering afaik, it comes with the I2C backpack on it.

Use the example code that comes with the LiquidCrystal I2C library. Make sure the display works before doing all that other junk.

Hi thanks for your response, what do you mean with make sure the display works? You mean as if it will turn on?

Also, I was attempting to try the HelloWorld provided in the LiquidCrystal library but they require this connections:

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)

Since I have the I2C backpack, how would it be connected? My I2C backpack only has GND,VCC,SDA,and SCL

Solder the backpack carefully.
Connect the four wires with good jumper leads.

Run the sketch.
The sketch is fine. I ran it on an 0x27 I2C LCD. It worked ok.

David.

Make sure you're taking examples from the LiquidCrystal I2C library. Because that's what you have. I hope. Because the code you posted gives clear instructions on how to have the I2C library.

It doesn't matter if the I2C adapter comes attached to the display or if you do the job, the soldering still has to be done correctly.

Please show us a clearly focused picture of the solder connections between your I2C backpack and your display.

Don

This guy is talking about the plain LiquidCrystal library, not the I2C version, but you're telling him to go stare at solder connections he didn't do? :confused:

It doesn't recognize the LiquidCrystal.h library.

How to use LCD screen in the UNO Arduino environment.

It doesn't really matter who did the solder connections. They appear to be questionable in his original photos and they should be checked.

Typically when the LCD library is not recognized the display does not get initialized properly and the screen displays a single row of 'boxes'.

On the other hand when characters are in fact displayed but they are the wrong characters then the problem typically stems from a 'bad' connection or improper wiring.

A bad connection is typically due to a defective jumper wire or poor soldering. Improper wiring would, in the case of an I2C adapter, result from the wrong numbers in the descriptor which may be happening here.

Don

Well, call me cynical, but I'd put my money on the guy who soldered them for a job knowing his way around a soldering iron more than a guy who can't even figure out which code to steal :slight_smile:

floresta:
It doesn't really matter who did the solder connections. They appear to be questionable in his original photos and they should be checked.

Typically when the LCD library is not recognized the display does not get initialized properly and the screen displays a single row of 'boxes'.

On the other hand when characters are in fact displayed but they are the wrong characters then the problem typically stems from a 'bad' connection or improper wiring.

A bad connection is typically due to a defective jumper wire or poor soldering. Improper wiring would, in the case of an I2C adapter, result from the wrong numbers in the descriptor which may be happening here.

Don

Hi thanks for your response. I do not think it was the jumper wires, since they are brand new. However, I will try to use others ones to see if it changes the result, here are some pictures of the solder connections:



I rest my case.

Don

Oh Sweet Jesus :o

floresta:
I rest my case.

Don

Would you recommend resoldering everything again?

Yes you should rework the solder joints. Make sure to look at the link in reply #1 first.

You have used far too much solder on each joint so the excess will have to be removed first. There are specialized tools that make this easy but it can be done with braided wire called 'solder wick' or even by just heating the joint and shaking the solder off. The last method typically results in hot solder flying around and landing on your workbench, your carpet, and your legs, so be careful.

Don

Ok, despite the horrendous solder job, the easiest thing to check before you go and break your lcd is to make sure you're using the right library.

You seem real eager to blame the hardware that you're ignoring all of my suggestions. There are two separate libraries. LiquidCrystal and a LiquidCrystal I2C.
You have cited example code from the first and wrong library. This tells me you are possibly clueless and don't have the I2C version even installed.

Even if this does fix your problem, that atrocity if a solder job should still be fixed. You said you got that lcd with your kit. Did it really come that way or did you attach the back piece to it yourself?

If it came that way, with mounds of solder and burn marks, where the heck did you get this starter kit from? People need to be warned not to get them from there.

Just a point of my poor vision , but from my point of view , you seem to have a connection to the Aref pin ! This should be to Grnd ! Next pin ?

It's properly in the GND pin. The first pin in that header is pin 8, count up to 13, then GND.

5th pic makes it clear, the 4th pic is prob what threw you off with the angle. Those jumper wires have fairly long terminals, pic 4 hides just how long it is with the angle.