Hi 
I learn arduino, and i have first problem. I have connect hd44780 for I2C to my arduino, my code on and off backlight, thats works fine. Next action in my code is show Hello World text, but this not working. Instead text on lcd i see squares. I set up potentiometer to different position but still not working.
I have connect I2C
- VCC to Arduino VCC
- GND to Arduino GND
- SDA/SCL to Arduino SDA/SCL
My code:
#include<Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup()
{
lcd.begin(16,2);
lcd.backlight(); // enable backlight
lcd.setCursor(0,0);
lcd.print("LCD & I2C");
}
void loop()
{
lcd.backlight(); // enable backlight
delay(5000);
lcd.noBacklight(); // disable backlight
delay(5000);
}
For an I2C LCD display to work, the I2C address and the I2C backpack to LCD pin mapping must be correct. If the library default settings for either or both are not correct the LCD will not work. You can try to figure out the right pin mapping and use an I2C scanner to find the address, but if you install and use the hd44780 library that is done automatically by the library.
Install the hd44780 library. The hd44780 library is the best available for I2C LCDs. The library is available in the Library Manager. Go to Library Manager (in the IDE, Sketch, Include Libraries, Manage Libraries) and in the Topics dropdown choose Display and in the Filter your search box enter hd44780. Select and install the hd44780 library by Bill Perry.
The class that you want to use is the hd44780_I2Cexp class. There are examples to show how to use the library. The nice thing about the hd44780 library is that it will autodetect the I2C address and the I2C backpack to LCD pin mapping.
In the examples, there is a diagnostic sketch that will help us to help you if you still have trouble with the display. Run the diagnostic sketch and post the results.
You also need to confirm that there are pullup resistors on the SDA and SCL lines. Some I2C backpacks have them and some do not. The diagnostic sketch will check for the pullups.
Hi,
Thanks for answer
My LCD address is 0x27. I don't have pullup resistors on the SDA and SCL lines, i have direct connect from LCD to Arduino SDA/SCL. I remember all worked fine without pull up resistors, but forgot which library i used.
I will check hd44780 library which you mentioned and return with response.
I checked the library you wrote about and many more, unfortunately the effect is the same all the time. Nothing but the squares appears, regardless of the contrast setting. I suspect that I lost my LCD.
In the examples, there is a diagnostic sketch that will help us to help you if you still have trouble with the display. Run the diagnostic sketch and post the results.
If you run the diagnostic and post the results copied from the serial monitor we may be able to see what is wrong.
Path to diagnostic program.
The next thing is to post photos of the LCD and backpack that show the solder joints. There have been instances of poor soldering of the I2C expander chip and the of the headers between the LCD and backpack. The photos need to be as close up as possible so that we can see the solder joints clearly.
Hi
I solder I2C, soldered a good deal and now works with the library you provided
Thank you very much for your help.
Glad to hear that you got it working and you are welcome.
Reverse32:
Hi
I solder I2C, soldered a good deal and now works with the library you provided
Thank you very much for your help.
Just for clarity can be be more specific as to what you actually re-soldered?
Was it the 16 pins on the backpack to the LCD or was it something else like the actual PCF8574 chip.
I like to keep track of all the issues that people have had and to potentially update the diagnostic tool to be more helpful.
Did you happen to take any before or after photos?
--- bill