Connect LCD I2C Nodemcu ESP8266 Easily in 5 Minutes

Here I will setup & Connect LCD I2C Nodemcu ESP8266. I will Use 20×4 LCD display with a I2C module.

To see the output from Arduino, we need to connect LCD display with it. There is mainly two version of LCD display is available in the market. One is 16X2 display which has 2 lines & another one is 20X4 display which has 4 lines.

We will use 20 X 4 display in this tutorial because it has 20 characters each line. If you wish to buy, then buy this version. The process of connection will be the same for all the version.

The LCD module can be connected to an Arduino board in 3 ways:

  1. Direct connection from the LCD module to the NodeMCU without POT.
  2. Direct connection from the LCD module to the NodeMCU with POT.
  3. LCD Module and ESP8266 NodeMCU connected through an I2C Module.

I will show the 3rd process in this post.

To connect without any I2C module, follow this post, LCD I2C Nodemcu.

Connect LCD Display with Arduino without I2C Module & POT

Components Used:(Click to Buy)

Connection Setup LCD I2C Nodemcu

Connection setup is very easy compared to direct connection. We have to connect only 4 pins using the following diagram.

LCD I2C Nodemcu

Add Library LCD I2C Nodemcu

First of all, we have to download and import the Arduino-LiquidCrystal-I2C-library.
You can also search this library inside Arduino IDE Manage Library.

Code Explain of LCD I2C Nodemcu

In line 8, we are setting the the I2C address, Display character no & line no.

LiquidCrystal_I2C lcd(0x27, 20, 4)

Here the default address is 0x27. We are using 20×4 LCD display here. In line no 41 we have done a trick to clear the only last line. We have displayed 20 blank character i.e 20 times space bar in the output display.

Arduino Sketch of LCD I2C Nodemcu

Output LCD I2C Nodemcu

LCD I2C Nodemcu
Share with Friends
0 0 votes
Inline Feedbacks
View all comments