16x02 LCD + I2C module problem

Thread Starter

Lucky-Luka

Joined Mar 28, 2019
101
Hi all

I was trying to make my 16x02 LCD+I2C module work. I failed.
This is my LCD: LCD+I2C
PCF8574T is written on the I2C module chip.

I've tried two different pin configurations of the I2C module in the sketch however nothing still appears on the monitor (yes, I've tried to adjust the contrast but it's not the cause).
I have to say that the monitor worked just fine using the traditional connection with 4 data wires, so the LCD works just fine.
Can it be that the I2C module doesn't work properly?

Any suggestions?

I've taken a couple of pictures to inform you better.

Photo_1
Photo_2

After I've identified the I2C address of the LCD (0x27), I've tried a simple sketch:
C++:
// Include Wire Library for I2C
#include <Wire.h>
// Include NewLiquidCrystal Library for I2C
#include <LiquidCrystal_I2C.h>

// Define LCD pinout
const int  en = 2, rw = 1, rs = 0, d4 = 4, d5 = 5, d6 = 6, d7 = 7, bl = 3;
//const int  en = 4, rw = 5, rs = 5, d4 = 0, d5 = 1, d6 = 2, d7 = 3, bl = 7;
// Define I2C Address - change if reqiuired
const int i2c_addr = 0x27;

LiquidCrystal_I2C lcd(i2c_addr, en, rw, rs, d4, d5, d6, d7, bl, POSITIVE);

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


void loop()
{
}
 

sagor

Joined Mar 10, 2019
467
Are you sure about the I2C address? Some modules are different addresses. 0x27 is a standard for most, but there are some that may have a different based address. Even the ones that say 0x27 have a range of 0x20 to 0x27, depending on jumpers.
 
After checking the pictures...

LiquidCrystal_I2C lcd(i2c_addr, en, rw, rs, d4, d5, d6, d7, bl, POSITIVE);

needs to be LiquidCrystal_I2C lcd(i2c_addr, 16, 2);
 

Thread Starter

Lucky-Luka

Joined Mar 28, 2019
101
There was a problem with the I2C module. Maybe I've damaged it while I've soldered it as a backpack of the LCD. Now I've changed it and the aforementioned sketch works just fine. I will not solder the I2C module as before since I don't have space problems and I don't want to waste too much time if I have to change the module in the future. The I2C module will be soldered in front of the LCD, as its position on the breadboard suggest.
 

Attachments

Top