-->
Page 2 of 2

Re: lcd 20x4 i2c on NodeMcu

PostPosted: Wed Jun 19, 2019 11:47 am
by rudy
What is the supply voltage on the PCF8574T / LCD? Are you using a good level shifter?

I have used 5 volt I2C character displays a lot and I always use a I2C level converter chip.

From the spec sheet. VIH HIGH-level input voltage 0.7VDD - VDD

Based on this, with a supply voltage of 5 volts for the PCF8574T, the minimum voltage for a logic high is 3.5 volts. 5v * 0.7 = 3.5v

If the supply voltage to the LCD is lower than 5 volts then the minimum voltage for a logic high will be lower and might be enough for the ESP8266 port high output. If this is done then I would recommend using 1 kOhm pull up resistors to Vcc of the ESP8266. I do not recommend using pull up resistors to the 5 volt supply of the LCD.

I do not recommend level shifters that use mosfets, like the 2N27000. I have had problems with the waveform being distorted, not clean rise. Maybe using the 2N27002 might work better but it is very similar so it also might cause problems.

First make sure you can see it with an I2C scanner before worrying about a compatible I2C LCD library for the ESP8266.

This is what I use with the ESP8266. https://github.com/agnunez/ESP8266-I2C-LCD1602

Re: lcd 20x4 i2c on NodeMcu

PostPosted: Sat Jan 18, 2020 7:03 pm
by scooter7440
Hi, I modified the code to following and got it working:

Changed: lcd.begin();
to: lcd.begin(20, 4);


#include <LiquidCrystal_I2C.h>
#include <Wire.h>
LiquidCrystal_I2C lcd(0x27, 20, 4);
void setup() {
Serial.begin(115200);
//Use predefined PINS consts
Wire.begin();
lcd.begin(20, 4);
lcd.noBacklight();
lcd.home();
delay(200);
lcd.print("Hello, NodeMCU");
lcd.backlight();
}

void loop() { // do nothing here
}