ESP32: How to Interface LCD With ESP32 Microcontroller Development Board
by TechMartian in Circuits > Microcontrollers
51219 Views, 34 Favorites, 0 Comments
ESP32: How to Interface LCD With ESP32 Microcontroller Development Board
![IMG_20170827_210843.jpg](/proxy/?url=https://content.instructables.com/FDB/X382/J6QQWL5U/FDBX382J6QQWL5U.jpg&filename=IMG_20170827_210843.jpg)
![IMG_20170827_210014.jpg](/proxy/?url=https://content.instructables.com/FJ1/GM2G/J6QQWL13/FJ1GM2GJ6QQWL13.jpg&filename=IMG_20170827_210014.jpg)
Hello World!
In this Instructables we will be learning how to interface a 16x2 LCD with the ESP32 Microcontroller Board. There are currently no tutorials online on how to interface it, so I decided to share with you my experience and knowledge on how to connect this together!
The LCD display is one of the most versatile electronic component in the maker market so it is wise to learn how to interface it so as to apply his knowledge to many other applications that you will discover as a maker.
Let's get started!
BoM
![IMG_20170827_205404.jpg](/proxy/?url=https://content.instructables.com/FR3/Z4GZ/J6QQWKX7/FR3Z4GZJ6QQWKX7.jpg&filename=IMG_20170827_205404.jpg)
* ESP32 Microcontroller Development Board
* 16x2 LCD
* A Lot of Jumper Wires
* Potentiometer
Connections
![IMG_20170827_205743.jpg](/proxy/?url=https://content.instructables.com/FH1/697E/J6QQWKZT/FH1697EJ6QQWKZT.jpg&filename=IMG_20170827_205743.jpg)
![IMG_20170827_210025.jpg](/proxy/?url=https://content.instructables.com/F3J/TEO7/J6QQWL1P/F3JTEO7J6QQWL1P.jpg&filename=IMG_20170827_210025.jpg)
![IMG_20170827_210131.jpg](/proxy/?url=https://content.instructables.com/FPP/GG5U/J6QQWL2T/FPPGG5UJ6QQWL2T.jpg&filename=IMG_20170827_210131.jpg)
![IMG_20170827_210035.jpg](/proxy/?url=https://content.instructables.com/FDI/BJMM/J6QQWL29/FDIBJMMJ6QQWL29.jpg&filename=IMG_20170827_210035.jpg)
![IMG_20170827_205735.jpg](/proxy/?url=https://content.instructables.com/FXY/Q7K9/J6QQWKYK/FXYQ7K9J6QQWKYK.jpg&filename=IMG_20170827_205735.jpg)
![IMG_20170827_205726.jpg](/proxy/?url=https://content.instructables.com/FLL/NEK5/J6QQWKYI/FLLNEK5J6QQWKYI.jpg&filename=IMG_20170827_205726.jpg)
![IMG_20170827_210146.jpg](/proxy/?url=https://content.instructables.com/FM0/DIZK/J6QQWL2V/FM0DIZKJ6QQWL2V.jpg&filename=IMG_20170827_210146.jpg)
Follow the table below for a concise and comprehensive guide on how to connect all the pins of the LCD screen to both the potentiometer and the ESP32 micro controller development board
LCD Pin | Potentiometer Pin | ESP32 Pin |
---|---|---|
1 and 16 | 1 | GND |
2 and 15 | 3 | 3.3V |
3 | 2 - Signal pin | |
4 | 22 | |
5 | GND | |
6 | 23 | |
7 | unused | |
8 | unused | |
9 | unused | |
10 | unused | |
11 | 5 | |
12 | 18 | |
13 | 19 | |
14 | 21 |
Code
![Screen Shot 2017-08-28 at 12.16.48 AM.png](/proxy/?url=https://content.instructables.com/F1Q/RNW1/J6QQWKQB/F1QRNW1J6QQWKQB.png&filename=Screen Shot 2017-08-28 at 12.16.48 AM.png)
#include <LiquidCrystal.h>
LiquidCrystal lcd(22,23,5,18,19,21);
void setup() { lcd.begin(16, 2); lcd.clear(); lcd.print("How to Interface"); // go to row 1 column 0, note that this is indexed at 0 lcd.setCursor(0,1); lcd.print ("LCD with ESP32"); }
void loop(){}
Contrast Control
![IMG_20170827_210839.jpg](/proxy/?url=https://content.instructables.com/FOL/QIYL/J6QQWL44/FOLQIYLJ6QQWL44.jpg&filename=IMG_20170827_210839.jpg)
Turn the knob of the potentiometer to change the contrast of the LCD. When you first upload the program onto the ESP32 board you may find that you're not seeing anything on the display, this is likely because the contrast is not set properly.
Turn the knob until you can see the display clearly.