Connect 1602 I2C LCD with ESP8266, NodeMCU, WeMos

Using low cost 1602 (16 chars and 2 line display) LCD in your IOT projects may cause a lot of trouble if you are trying it for the first time. The main issue is wrong I2C address which is documented in various examples over the internet. I2C address may vary depending upon driver used in a particular I2C module. Here is, How we can make this little low cost LCD display work for us.

Hardware:

Software:

Finding I2C Address:

I2C Display ESP8266 Logic Converter
GND GND AGND, BGND
+5V +5V AVCC
+3.3V BVCC
SDA ASDA
ESP8266 = GPIO 0

NodeMCU | Wemos etc. = D3

 BSDA
SCL ASCL
ESP8266 = GPIO 2

NodeMCU | Wemos etc. = D4

 BSCL
  • Open Serial monitor and Press reset button, Note down I2C address (0x3F is I2C address in example shown below), which will be used later

 

HelloWorld Example:

  • Under example, Open ESP8266-I2C-LCD1602 > HelloWorld sketch
  • Go to line 13, and change “0x3F” with your own I2C address
LiquidCrystal_I2C lcd(0x3F, 16, 2);
  • Upload sketch to ESP8266 and You are done!!

Note:

  • GPIO16 (D0) is not capable of I2C. Never use GPIO16 (D0) for connecting to any of I2c device (Visit Startup Guide for ESP8266 NodeMCU WeMos for more information).
  • 1602 LCD is 5V logic device while ESP8266 is 3.3V logic device. Never connect 1602 LCD directly to any of ESP8266 SMD or Development Board.

Downloads:

5 1 vote
Article Rating
Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Hello
Hello
6 years ago

Nice Job!

1
0
Would love your thoughts, please comment.x
()
x