NodeMCU LCD Tutorial Using I2C Module

Introduction

Hey guys, hope you are doing fine. Are you searching for the working of a 16×2 LCD display with NodeMCU? If yes then this article is for you in which we are going to display some text on the 16×2 LCD using a NodeMCU esp8266 board.

We are using an I2C module here which helps us to reduce the number of GPIO pins. Check how you can set up your NodeMCU with the Arduino IDE application and start to program it.

NodeMCU is a microcontroller board used to develop IoT projects with a built-in wifi module. A 16×2 LCD can display 16 alphanumeric characters in a single line and it has a total of two lines only.

there is a huge list of articles on the nodemcu tutorial. you can see it on our website.

You can use it directly with the board but it is easy if you connect an I2C module with it. If you like this project, you can also check out more amazing projects on NodeMCU.

nodemcu lcd

How Does nodemcu lcd works?

This project can display the text given to it. 

You can use our article on the I2C scanner to check the address of the I2C module you are using.

  • We are able to display the text on the LCD by using the print function and passing the content which is going to be displayed as the parameter value of the function.
  • Lcd with nodemcu I2C communication is easy to implement. Set the location of the content by using the set cursor function.

Some pictures of the project that we made are given below for this basic nodemcu tutorial.

Connect the USB cable to provide power to the board and you will see the text on the LCD screen.

lcd with nodemcu

Components Required

Circuit Diagram nodemcu lcd

nodemcu lcd

Connection Table

Nodemcu esp8266 I2C Module
Vin, VVVCC
GND GND
D2 Pin  ( SDA )SDA Pin
D1 Pin  ( SCL )SCL Pin
16*2 LCD DisplayI2C Module
16 Pin connect16 Pin connect
  • Mount the NodeMCU board on a breadboard so it is easy to make connections.
  • You have to make the circuit according to the diagram given above.
  • Attach the Pins of the I2C module with the 16×2 LCD.
  • Connect the VIN or 3.3-volts pin of the NodeMCU with the VCC pin of the I2C module and the GND pin of the NodeMCU with the GND pin of the I2C module.
  • Join the SDA pin of the I2C module with the digital-2 pin of the NodeMCU for nodeMCU Tutorial.
  • Connect the SCL pin of the I2C module with the digital-1 pin of the NodeMCU.

NodeMCU LCD code

NOTE: Please upload the code given below to the NodeMCU. Before compiling the code you have to install <Wire.h> and <LiquidCrystal_I2C.h> libraries to the Arduino IDE. If you don’t know how to install a zip library to Arduino IDE then check it here.

 // TECHATRONIC.COM  
 //LIBRARY FOR I2C LDC  
 //https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library  
 #include <Wire.h>           
 #include <LiquidCrystal_I2C.h>    
 LiquidCrystal_I2C lcd(0x3F,16,2);   
 // if lcd is not print then use this 0x27..  
 void setup()  
  {  
   lcd.begin();      
   lcd.backlight();  
  }  
 void loop()   
  {  
   lcd.setCursor(0,0);  
   lcd.print("   Helo  ");  
   lcd.setCursor(0,1);  
   lcd.print("  Friend ");  
  }  

We hope that now you are familiar with the working of a 16×2 LCD with NodeMCU. Please try it now on your own.

If you are facing any problems while making then do inform us in the comments section below. Check out more tutorials on Arduino and Raspberry Pi uploaded by us.

I2C Scanner | What is I2C on Arduino?

LCD Interfacing with Arduino using I2C

Interface LCD with Arduino (16×2) | Arduino LCD Interfacing Tutorial

ECE Final Year Project | Major Project for ECE Students

ECE Final Year Project | Major Project for ECE Students

lcd with nodemcu

HAPPY LEARNING!

Video sample

1 thought on “NodeMCU LCD Tutorial Using I2C Module”

Leave a Comment