I2C LCD display not working

Hello,
I am trying to check if my 2004A I2C LCD display works with my Arduino UNO. The code I am initially uploading to my Arduino Uno is:

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
char array1[] = " INOVATRIX GUYS";  // CHANGE THIS AS PER YOUR NEED 
char array2[] = " LIKE,SUBSCRIBE";  // CHANGE THIS AS PER YOUR NEED 
LiquidCrystal_I2C lcd(0x3F, 16, 2); // CHANGE THE 0X3F ADDRESS TO YOUR SCREEN ADDRESS IF NEEDED
void setup()
{
  lcd.init();
  lcd.backlight();
  lcd.print(array1);
  lcd.setCursor(0,2);
  lcd.print(array2);
}
void loop()
{}


This code is supposed to show me a port in my Serial Monitor. It does not show me anything. Need help solving this.

How did you figure out your display address was 3F ?

This is a copied code from one of the Youtube examples.

What exactly so you think you will see in the serial monitor?... it doesn't write to the monitor?

How is the LCD connected?

Your address might be different.
:wink:

Your address might be different.

Not only that, but not all driver chips on the i2c backpacks are connected to the display in the same way as expected by LiquidCrystal_I2C.h
The best available library for the i2c lcd displays is called hd44780.h. written by Bill Perry. It is available through the library manager.

I would suggest that you convert to it. It is plug and play for a variety of configurations of the i2c backpack modules. It will detect both the i2c address and the configuration of the driver.

As part of the library there is a comprehensive diagnostic sketch which will test some internal details of the display. It's called I2CexpDiag

In the in the ide you can navigate to the library example

File>Examples>hd44780>ioclass>hd44780_I2Cexp>I2CexpDiag

2 Likes

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project :wink: See About the Installation & Troubleshooting category.

+1 for the hd44780 library. It will save you a ton of trouble since it will automatically determine the I2C address and the LCD to I2C pin mapping. The library is actively maintained and the author monitors this page.

If you still have trouble, run the diagnostic pointed out by @cattledog and copy and paste the serial monitor output to a post. We and/or the author can then help you.

After you get your other problems figured out you will have to let the library know that you are using a 20x4 display. Right now I'm not sure what it will do with your array 2.

Don

When I upload the code to my Arduino and open serial monitor, isn't it supposed to give me the serial port address??? It is not showing anything.

LCD connection:

VCC >> Arduino 5V
GND >> Arduino GND
SDA >> Arduino A4
SCL >> Arduino A5

You mean the I2C address?

There is nothing in your code that writes to the Serial Monitor.

There is scanner code you can run that will tell you the I2C addresses of connected devices?
https://playground.arduino.cc/Main/I2cScanner/

I ran the scanner code before. It still shows nothing on the serial monitor. neither does anything show in the LCD display. The L led on the arduino is constantly blinking and the LCD monitor is blue and nothing shows up

The I2C Scanner must show something on the serial monitor.
Check the baud rate in the code vs. the settings for your Serial Monitor:

Serial.begin(9600);

I know it must. But it is not.

and this setting... ?

sketch uploaded, port selected, baud rate 9600. still i2c serial monitor shows no effing thing. getting really really frustrating

It’s time:

Always show us a good schematic of your proposed circuit.
Show us a good image of your ‘actual’ wiring.
Give links to components.

What does this produce?

void setup()
{
  Serial.begin(9600);
  Serial.println("Hello World");
}

void loop()
{}