Trying out I2C LCD with ESP32 using Arduino IDE

Hello, again!

Welcome to another tutorial on programming ESP32 using Arduino IDE. Last time, I wrote about trying out the DHT11 weather sensor feature and today I will be showing you how to use the I2C LCD (Liquid Crystal Display), again on the ESP32.


Step 1: Hardware Requirement

These are hardware 
  • 1 Laptop/PC
  • 1 MicroUSB cable
  • 1 ESP32 Development Board
  • 4 Female-Female Jumper Wires
  • 1 MicroUSB cable
Step 2: Software Requirement

Basically, every software requirement needed is just the same as in the "Blinking program" I wrote before. If you haven't checked it out, you can click here and look for Step 2: Software Requirement then come back and continue down below:

Step 3: Circuit


Credits to : www.randomnerdtutorials.com


Step 4: Code

Okay, moving on to the code. It will be divided into two steps consisting of finding the LCD address and then actually sending out outputs to the LCD using the address found before. 


Here is a I2C Scanner sketch code to retrieve the LCD address:



If you have got your LCD address (which would have appeared on Serial Monitor using the code above) you will be using it in the following code: 

*In my case it was 0x27*



Step 5: Compile, Upload & Observe

This is what you should be seeing after done uploading the code. You can adjust the contrast between the background of the LCD and the characters appearing on it using a screwdriver on the backpack of your LCD.




You can try playing around by changing the delay and cursor for variations.


Now congratulations! You have created "Hello World!"(s) on LCD!



Check out my article about combining the LCD with weather sensors using the ESP32 on this link: 
Printing Weather Sensor Measurements in I2C LCD on ESP32 using Arduino IDE

Comments

Popular posts from this blog

Plotting Real Time Sensor Readings on Web Servers using ESP32 and Arduino IDE

Inserting Data from an ESP32 to a MySQL database using PHP and Arduino IDE

Receiving Data on ESP32 from a HTML form of its Web Server using Arduino IDE