ESP8266 NodeMCU 16×2 LCD Interface

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Home P R OJ E C T S H O P Internet of Things Arduino Electronics Microcontroller About Us

ESP8266 NodeMCU 16×2 LCD Our e-Books


Interface NodeMCU Communication Methods and
Protocols: Upgrade Your Knowledge
January 2, 2018 ESP8266 16x2, display, ESP8266, LCD, NodeMCU

In this tutorial we interface 16×2 LCD display with ESP8266 NodeMCU without using I2C
and with minimum pins i.e. using only 3 pins. To interface LCD with ESP8266 we need at
least 6 IO lines but ESP already have very few IO lines, to expand IO lines we use serial to
parallel shi register IC 74HC595.

A 16×2 LCD means it can display 16 characters per line and there are 2 such lines. In this
LCD each character is displayed in 5×7 pixel matrix. This LCD has two registers, namely,
Command and Data.

The command register stores the command instructions given to the LCD. A command is an
instruction given to LCD to do a predefined task like initializing it, clearing its screen, Zero to Hero: ESP8266: Become Super hero
setting the cursor position, controlling display etc. The data register stores the data to be of Internet of Things
displayed on the LCD. The data is the ASCII value of the character to be displayed on the
LCD.

Step 1: Circuit Diagram of ESP8266 LCD


Interface
How to connect LCD with Node MCU?

Measurement Made Simple with Arduino:


Ultimate e-Book for all your measurement
needs at one place.

Arduino Beginners Guide: Get started with


Step 2: ESP8266 NodeMCU Program for LCD arduino in simple steps

Interface
How to program ESP8266 NodeMCU for LCD DIsplay?

We are not using any library for interfacing.

1 /*
2 Three Wire LCD Interface using 74HC595 with ESP8266 NodeMCU
3 www.circuits4you.com
4 */
5 #include <ESP8266WiFi.h>
6
7 //Define 74HC595 Connections with arduio
8 const int Clock=13;
9 const int Data=12;
10 const int Latch=14;
11
12 void LCDinit(void);
13 void LCDSendByte(char d,char RS);
14 void LCDPrint(char Line,char string[16]); Subscribe to Blog via Email
15 //=========================================================
16 // Setup Enter your email address to subscribe to this
17 //========================================================= blog and receive notifications of new posts
18 void setup() {
19 // initialize the digital pin as an output. by email.
20 pinMode(Data, OUTPUT);
21 pinMode(Clock, OUTPUT);
22 pinMode(Latch, OUTPUT); Join 191 other subscribers
23 LCDinit(); //initalize LCD in 4-bit mode
24 }
25 //======================================================== Email Address
26 // Loop
27 //=========================================================
28 void loop() {
29 LCDPrint(0,"Circuits4You"); Subscribe
30 LCDPrint(1,"Hello There");
31 delay(500);
32 }
33 //=============================================================
34 // Send Data or Command to LCD
35 //=============================================================
36 void LCDSendByte(char d,char RS)
37 {
38 char dH,dL,temp; //Keep Data on upper nybble
Join Circuits4You community
39 dH = d & 0xF0; //Get MSB
40 dL = d & 0x0F;
41 dL = d << 4; //Get LSB
42
43 //Send MSB with E=clock
44 temp=0;
45 temp=dH | RS | 0x02; //MSB With RS+E bit
46 ShiftData(temp); //Send MSB with E=0
47 temp=0;

Step 3: Testing
Upload Program and see display will show Circuits4you.com. Give +5V to 74HC595 and
Operate NodeMCU at 3.3V levels.

Related Recent Posts


Arduino NodeMCU (ESP8266) Spi s File
System Uploading and Reading

“error: cannot access /dev/ttyUSB0” Arduino


(NodeMCU) esp8266

16x2 LCD Display interface with Three Wire LCD Interface with LCD interface using I2C Module Add NodeMCU ESP8266 to Arduino IDE
Arduino Arduino with Arduino
ESP8266 jQuery and AJAX Web Server
May 15, 2016 December 14, 2016 September 17, 2016
In "Arduino Tutorials" In "Arduino Projects" In "Arduino Tutorials" ESP8266 HTTP GET Request Example

Advertisement
← ESP8266 Timer and Ticker Example
ESP8266 NodeMCU WiFi Network Scanner →

Leave a Reply
You must be logged in to post a comment.

Login with:

Search … Recent Posts About Us


Arduino NodeMCU (ESP8266) Terms & Conditions
Spi s File System Uploading Privacy Policy
and Reading Contact Us

“error: cannot access


/dev/ttyUSB0” Arduino
(NodeMCU) esp8266

Add NodeMCU ESP8266 to


Arduino IDE

ESP8266 jQuery and AJAX Web


Server

ESP8266 HTTP GET Request


Example

You might also like