ESP32 : How to Use 16x2 LCD Display without I2C

Rahmat Al Fajri
2 min readMar 9, 2022
16x2 LCD Display

Hello there, in this article i am going to show you how to use 16x2 LCD Display without I2C.

LCD displays can be used with an I2C adapter or without it. With or without it the LCD still can display characters without any problem, but people often use I2C adapter to ease the connection between the LCD and microcontroller boards. With an I2C adapter connection between LCD and microcontroller require less cable than without I2C adapter. An I2C adapter usually comes with a potentiometer to adjust the brightness of LCD backlight, since i am not using it i will attach an external potentiometer.

With this contraption, we can display any text we want if the space on LCD is sufficient.

Hardware Required

  1. An ESP32 Board
  2. A breadboard
  3. A 10k ohm potentiometer
  4. 16x2 LCD Display
  5. 16 male to male jumper wires
  6. A micro USB cable

I assume you already prepare Arduino IDE and USB to UART driver, and also understanding how to upload a code. If you don’t check my first ESP32 article.

Without further ado, let’s jump into the steps.

Step 1, assemble the parts as shown below, and then connect the ESP32 board into computer using micro USB cable.

Step 2, copy this code into Arduino IDE:

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(14, 27, 26, 25, 33, 32);

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
}
void loop() {
// set the cursor to column 0, line 0 and print a message.
lcd.setCursor(0, 0);
lcd.print("Hello World!"); // you can change it into any text
// set the cursor to column 0, line 1 and print a message.
lcd.setCursor(0, 1);
lcd.print("I am Fajri"); // you can change it into any text
}

Step 3, upload the code and try to adjust the potentiometer. The result should like this.

And there you have it, Thank you and have fun to try!

--

--