• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » ESP32 Arduino With LCD : Connection & Code (I2C, LCD 1602A)

By Abhishek Ghosh April 30, 2019 8:47 am Updated on April 30, 2019

ESP32 Arduino With LCD : Connection & Code (I2C, LCD 1602A)

Advertisement

1602A LCD and I²C module are quite cheaper and easy to setup and code. Earlier, we have published guides on how to wire and setup 1602A LCD with Arduino UNO (which have not used the I²C module) which occupies 8 Pins on your Arduino. We have also explained about different protocols, interfaces like I²C, Serial Peripheral Interface and discussed interfacing 1602A LCD display using I²C Serial Interface.

The commonly sold 1602A LCD blue background, white text is cheap China clone of Hitachi’s model. China company named YwRobot manufactures somewhat better finishing I²C modules (YwRobot is popular for breadboard power supply module). Usually the I²C module is soldered on the back of 1602A LCD and sold. The I²C module has PCF8574 IC which provides general-purpose remote I/O expansion via the two-wire bidirectional I²C-bus serial clock (SCL) and serial data (SDA). PCF8574 is very useful IC and has wider usage in day to day commercial electronics such as LED signs boards.

The hardware making the connection just easy (2 data pins and 2 power pins) :

Advertisement

---

Module’s GND will connect to ESP32’s GND
Module’s 3v/VCC will connect to ESP32’s VCC

Module’s SDA will connect to ESP32’s pin 21
Module’s SCL will connect to ESP32’s pin 22

We actually need 5V supply for the I²C module to display properly. ESP32 gives 3.3 volts. So, use external 5V supply (that is why we linked to the breadboard power supply in above paragraph, also we can use computer SMPS for regulated voltage). We need to common the GND of external power supply, ESP32’s GND and module’s GND to complete the circuit. The external power supply thing is easy but takes time to setup. 3.3v someway works for testing.

The module has a built-in potentiometer, you can use it to adjust the contrast between the background and the characters on the LCD.

ESP32 Arduino With LCD Connection & Code I2C LCD 1602A

You can try this code for quick display testing :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F,16,2); // LCD address is 0x3F, 16 is chars, 2 is 2 line display
void setup()
{
lcd.init();
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("Hello world");
lcd.setCursor(1,0);
lcd.print("It Works!");
}
void loop()
{
}

As you are using ESP32, you should learn a bit more than the Arduino UNO users. The I²C controller has inbuilt address bit (which is used to control I²C bus). The default address is 0x27 or 0x3f. We used 0x3F in the above code.

The technically correct method is to check the address of the I²C controller using some code like the below (and Arduino IDE’s open serial monitor to check) :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <Wire.h>
 
void setup() {
Serial.begin (9600);
Serial.println ("Scanning I2C device...
 
Wire.begin();
for (byte i = 0; i <50; i++)
{
Wire.beginTransmission (i);
if (Wire.endTransmission () == 0)
{
Serial.print ("Address found->");
Serial.print (" (0x");
Serial.print (i, HEX);
Serial.println (")");
Count++;
}
Serial.print ("Found ");
Serial.print (count, DEC);
Serial.println (" device");
}
 
void loop() {}

You can see, how much ESP32 makes the coding part easier. We needed no pin numbers to mention. ESP32’s Pin 21
is SDA pin and Pin 22 is SCL.

Tagged With 1602a sda scl , 1602a lcd display with control board code for aruinno , 1602 display code , what is a lcd 1602a device? , esp32 lcd with i2c code , arduino I2C , connecting esp32 and lcd module , 1602a esp32 , arduino lcd module 1602a , wiring – connecting leds to esp32

This Article Has Been Shared 970 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to ESP32 Arduino With LCD : Connection & Code (I2C, LCD 1602A)

  • ESP32 Arduino : Create a Webpage to Control a Relay Module

    Here is How to Create a Webpage to Control a Relay Module Using ESP32 Arduino. This is a basic example which provides the base of advanced projects.

  • ESP32 Arduino and TM1637 Seven Segment LED Display

    TM1637 Seven Segment LED Display is Popular Thing in Arduino Prototyping World. Here is Some Words About Using TM1637 With ESP32 Arduino.

  • ESP32 Arduino Built-in Hall Sensor Code & Theory

    ESP32 has a Hall Effect Sensor near pin 22. Here is ESP32 Arduino Built-in Hall Sensor Code & Theory. Here is something about Hall Effect Sensor as well.

  • ESP32 MicroPython Setup with Adafruit Ampy

    Here is ESP32 MicroPython Setup with Adafruit Ampy for Windows, MacOS X and Linux. You need Python needs to be running and install few tools.

  • Sending Commands to IBM Watson IoT to Trigger Event on Device

    Our basic need can be controlling a LED connected with remote device. Here is How to Send Commands to IBM Watson IoT to Trigger Event on Device.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (21K Followers)
  • Twitter (5.3k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • How to Save Electricity Consumption During the Pandemic April 20, 2021
  • Best Powerpoint Templates for Communicating IoT Concepts April 17, 2021
  • How to Build a DIY Water Level Indicator? April 16, 2021
  • How Startups Can Convince the Investors April 14, 2021
  • What to Know About the Cloud Storage Services for Smartphones April 13, 2021

 

About This Article

Cite this article as: Abhishek Ghosh, "ESP32 Arduino With LCD : Connection & Code (I2C, LCD 1602A)," in The Customize Windows, April 30, 2019, April 20, 2021, https://thecustomizewindows.com/2019/04/esp32-arduino-with-lcd-connection-code-i2c-lcd-1602a/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2021 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy