nodemcu lcd

NodeMCU LCD Tutorial Using I2C Module

ESP8266 / NodeMCU IoT

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.

Basically,

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 at 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 more amazing projects on NodeMCU.

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

nodemcu lcd
lcd with nodemcu

Components Required

  • NodeMCU esp8266 board
  • 16×2 LCD
  • I2C module
  • Breadboard
  • Jumper wires
  • USB cable for uploading the code

Components Table/buy link

You can buy the whole components from the given link we have to share the amazon link. from where you can get a good discount on the components.

S.NoComponent NameQuantityBuy Link
1.Nodemcu esp82661https://amzn.to/3EUGhuu
2.Nodemcu cable1https://amzn.to/3F1ywmu
3.16*2 LCD Display1https://amzn.to/3D8Jyoi
4.I2C Module1https://amzn.to/3uyK9MF
5.Jumper Wire40https://amzn.to/39q43jr
6.Breadboard1https://amzn.to/39vsRX2

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.

HAPPY LEARNING!

Video sample

Spread the love, Share this post with friends

Leave a Reply

Your email address will not be published. Required fields are marked *