Notifications
Clear all

16x02 LCD + I2C module problem

4 Posts
2 Users
0 Likes
1,359 Views
Lucky-Luka
(@lucky-luka)
New Member
Joined: 4 years ago
Posts: 2
Topic starter  

Hi all

I was trying to make my 16x02 LCD+I2C module work. I failed.

This is my LCD: AZDelivery-HD44780-I2C

PCF8574T is written on the I2C module chip.

I have followed the guide: https://dronebotworkshop.com/lcd-displays-arduino/

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 constrast but it's not the cause).
I have to say that the monitor worked just fine using the connection presented at the beginning of the guide, 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:

// 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()
{
}

Β 


   
Quote
 BLM
(@the-code-cobbler)
Active Member
Joined: 4 years ago
Posts: 15
 

Hi,

I have a little advice for you that comes from my own personal experience and a lot of trial and error. When using libraries with peripherals in the Arduino IDE, use the libraries that are well developed and modern. The liquidcrystal_I2C library works, but it is old and gives warnings when compiling. The methodology I use is I start with AdafruitΒ  libraries first, followed by SparkFun, this will help you avoid a lot of pitfalls. These are mature libraries and work flawlessly when using the proper syntax. So for your I2C LCD example, install the Adafruit liquid crystal library and run the "Hello World" I2C example. I think you'll like the results πŸ˜‰

Hope this helps,

Regards

--->The BLM<---


   
ReplyQuote
 BLM
(@the-code-cobbler)
Active Member
Joined: 4 years ago
Posts: 15
 

The Adafruit library works with the MC23008, if you're using the PCF8574, use this library:

https://github.com/mathertel/LiquidCrystal_PCF8574

Β 

--->The BLM<---


   
ReplyQuote
Lucky-Luka
(@lucky-luka)
New Member
Joined: 4 years ago
Posts: 2
Topic starter  

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 suggests.

PIC

Β 

That library was suggested in the droneworkshop YT video I was watching and it's not that old...Β  I will check the suggested libraries


   
ReplyQuote