NodeMCU to I2C LCD


#1

Hello everyone,

I am follow the stuff at :

I follow the code given to upload to my NodeMCU that connected to I2C LCD 20X4.
I have modify slight the code to cater for the LCD size changes and LCD address. Here the codes:

//********************************************************************************************************************
#include <LiquidCrystal_I2C.h>

// Construct an LCD object and pass it the
// I2C address, width (in characters) and
// height (in characters). Depending on the
// Actual device, the IC2 address may change.
LiquidCrystal_I2C lcd(0x27, 20, 4);

void setup() {

// The begin call takes the width and height. This
// Should match the number provided to the constructor.
lcd.begin(20,4);
lcd.init();

// Turn on the backlight.
lcd.backlight();

// Move the cursor characters to the right and
// zero characters down (line 1).
lcd.setCursor(5, 0);

// Print HELLO to the screen, starting at 5,0.
lcd.print(“HELLO”);

// Move the cursor to the next line and print
// WORLD.
lcd.setCursor(5, 1);
lcd.print(“WORLD”);
}

void loop() {
}
//Sketch end here***********************************************

But after compiled and upload successfully to NodeMCU, the I2C LCD does not show any text, only show the backlights.
I connect the same I2C LCD to Arduino UNO, it is working, can display text.

Any advice ?

Thank you in advance.
Kam


#2

Hi!

Have you tried a different I2C address?

This may help:

http://playground.arduino.cc/Main/I2cScanner

You can run this sketch to find the proper address. It may be different between the arduino and NodeMCU.

Then you can update this line:

‘’‘LiquidCrystal_I2C lcd(0x27, 20, 4);’’’


#3

Hi…check this if your setup is correct or not.When you order LCD from Ali/ebay you can solder 16 pin headers to LCD display in order to avoid ‘wiring mess’ when connecting to serial adapter
Place LCD display and Serial Adapter on bread board next to each other
Connect adapter’s SCL pin with NodeMCU D1 pin
Connect adapter’s SDA pin with NodeMCU D2 pin
Connect adapter’s GND, VCC pins with NodeMCU GND, Vin accordingly - here I need to explain one thing. Basically you should connect LCD display to 5v source but NodeMCU only has 3.3v outputs so the LCD is pretty dark. If you provide LCD with external 5v source you’ll need to use logic level converter because it will not work. Here I used some hack using USB provided power that is bypassed to Vin. It’s 5V but it works