Learn To Use LCD 1602 (I2C & Parallel) With Arduino UNO
Maybe your like
Embed the widget on your own site
Add the following snippet to your HTML:
Learn to use Liquid Crystal Display with Arduino using a free Arduino Simulator 👍 No Hardware Necessary
Read up about this project on 
Learn To Use LCD 1602 (I2C & Parallel) With Arduino UNO 📺
Hack star8 53,761
Hack starPublished March 13, 2022 © MITLearn To Use LCD 1602 (I2C & Parallel) With Arduino UNO 📺Learn to use Liquid Crystal Display with Arduino using a free Arduino Simulator 👍 No Hardware Necessary
BeginnerProtip1 hour53,761Things used in this project
Hardware components | |||||
![]() |
| × | 1 |
| |
![]() |
| × | 1 | ||
![]() |
| × | 1 | ||
![]() |
| × | 1 | ||
![]() |
| × | 1 | ||
![]() |
| × | 1 | ||
Story
Introduction
This article gives you a step-by-step guide to becoming a pro in using Liquid Crystal Display. We will use a free Arduino Simulator to try all the examples without leaving your PC. No hardware is needed.
Important Links
Wokwi Arduino Simulator - https://wokwi.com
Documentation on LCD - https://docs.wokwi.com/parts/wokwi-lcd1602
Facebook group to seek support on the Arduino Simulator - https://docs.wokwi.com/parts/wokwi-lcd1602
What is an LCD?
LCD stands for Liquid Crystal Display. The very commonly used LCD type is 16x2 LCD, and it has two rows and 16 columns.
Image Source - docs.wokwi.comHere is the table with the LCD pin description. This will help you understand and debug the project later in an intelligent way.
LCD pin interface details - LCD with parallel interfaceYou will also find LCDs with an I2C interface. Fewer Pins will lead to easier connection—less messy wires.
LCD with I2C interface - less pins LCD Pin description - I2C VersionSo, based on the LCD, you will have to tell the Arduino UNO which type of LCD you are using. You will see this in the sections later.
The LCD1602 uses the Hitachi HD44780 LCD controller chip. The chip comes with a built-in font and the ability to define up to 8 custom characters.
There are two versions of the chip's ROM with two different fonts: HD44780UA00, Japanese katakana characters, and HD44780UA02, which includes Western European characters.
Wokwi simulates the HD44780UA00 variant. It has a total of 256 characters:
LCD characters in the HD44780UA00 controllerYou can see that the first eight characters are user-defined. It allows you to create custom shapes and store them. You will see how to create custom characters and load them in your following Arduino projects. Let us start with a basic example.
Example 1 - Basic example with LCD "Hello World" Example on I2C interface
We will print a simple text on the LCD using Arduino UNO in this example. In this case, you control what is displayed on the Arduino readily. You only need four cables. Power, Ground, I2C data, and I2C clock.
Here is the code
/* Hello Wokwi! */#include <LiquidCrystal_I2C.h>LiquidCrystal_I2C lcd(0x27, 20, 4);void setup() {lcd.init();lcd.backlight();lcd.setCursor(1, 0);lcd.print("Hello, Wokwi!");}void loop() {}Connection diagram:LCD and Arduino UNO
Hello world Example on LCD1602 using Wokwi Arduino SimulatorProject link: https://wokwi.com/projects/325996799788581459
Use the link above to run the code. You can tinker with the code to change the text displayed or the position. The best thing about the link is that it will save the project as your version. It will be automatically saved under my projects tab on the wokwi site if you are logged in.
Let us take a minute and see the code line by line. Let me try to explain the purpose of each code one by one.
The below line code adds the LCD library to your project. This consists of all the LCD-related functions. Since we are using the I2C version, we have included the standard LCD library made for the I2C version.
#include <LiquidCrystal_I2C.h>Below, we are creating an object called LCD. We pass the I2C address, the number of columns, and the number of rows.
Can you let me know the parameters in the comments if we want to use an LCD2004 instead of LCD1602?
LiquidCrystal_I2C lcd(0x27, 16, 2);The following line of the code resets and initializes all the LCD registers and prepares them for project usage. This function will be called only once in the setup() function.
lcd.init();To turn on the backlight, you can use the below code. You will be able to see the contents of the display without a backlight, too, if it is a green LCD. Backlight, nevertheless, makes the project more beautiful and reading crisper.
lcd.backlight();You can mention where the characters should be displayed. You can always use the below function to set/reset the cursor position. This function will be beneficial when you have to display time or a counter that demands the cursor to always be in the same position.
The first parameter tells the position column-wise (0 indicated first place, 1 indicates the second place, and so on). The second parameter tells the row number. We have only two rows (0 and 1).
lcd.setCursor(1, 0);The last thing to be seen is the below line, where we actually send a message. In this case a string Hello, Wokwi is sent!
lcd.print("Hello, Wokwi!");This completes a basic introduction to the LCD as well as an example project to start the LCD exploration. In the coming sections, we will see different projects as soon as possible 🚧
Example 2 - Basic example with LCD "Hello World" Example on Parallel interface
You will often see the LCD1602 interface connected with Arduino UNO. Here you will use a few control lines, and 4 data lines for communication.
Here is the example connection diagram
Arduino UNO and LCD connected over parallel lines- Arduino PIN.7 -> D7
- Arduino PIN.8 -> D6
- Arduino PIN.9 -> D5
- Arduino PIN.10 -> D4
- Arduino PIN.11 -> E
- Arduino PIN.GND -> RW
- Arduino PIN.5V -> RS
Code
// LCD1602 to Arduino Uno connection example#include <LiquidCrystal.h>LiquidCrystal lcd(12, 11, 10, 9, 8, 7);void setup() {lcd.begin(16, 2);// you can now interact with the LCD, e.g.:lcd.print("Hello World!");}void loop() {// ...}I am sure you have noticed the differences. The LCD library file you include is now different since we are no more using the I2C interface.
another difference is the constructor parameters you send. This time, you have to send 6 numbers, representing control and data lines as depicted in the pin list above.
Simulation link:https://wokwi.com/projects/294342288335700490
Example 3 - Creating user-defined characters in LCD1602, easy way
Creating custom characters on the LCD is easy. In this example, you will see how to create a character in the shape of a heart.
Project link: https://wokwi.com/projects/294395602645549578
Code:
// LCD1602 custom characters example#include <LiquidCrystal.h>LiquidCrystal lcd(12, 11, 10, 9, 8, 7);uint8_t heart[8] = {0b00000,0b01010,0b11111,0b11111,0b11111,0b01110,0b00100,0b00000,};void setup() {lcd.createChar(3, heart);lcd.begin(16, 2);lcd.print(" I \x03 Arduino");}void loop() { }To create a symbol, you have to define an array with 8 numbers. Basically, you will define which pixels will be lit and which pixels will not be in the array.
Let us see some examples.
Heart shape example
The first line is empty.. so it can be defined as 00000 in binary. The second line will be built using 01010. The third line will be all ones 11111 I hope you got the idea now. You can compare again the binary values above in the code.
Custom characters on the LCDBox shape
uint8_t heart[8] = {0b11111,0b10001,0b10001,0b10001,0b10001,0b10001,0b10001,0b11111,};an animation for any future projects (think some games!)
Multiple options with custom characters on the LCDIn the following sections, we will see more exciting LCD projects
Example 4 - Working with LCD2004 and Arduino UNO (with some simple animation)
In this project, you will see how to use an LCD2004 module. LCD2004 has 4 rows and 20 columns. The basic function names and constructor pattern remains the same.
LCD with 20 columns, 4 rows with parallel data interface.You might have even come across the blue color LCD2004 module. It might look something similar to this.
LCD with blue color background.Here is one link: https://wokwi.com/projects/294590769009787402
You can get access to the code and the connection diagram in the link above.
here is how the animation looks!
LCD with Arduino UNO - Parallel interfaceExample 5 - Working with LCD2004 and Big Fonts Arduino UNO
Simulation link: https://wokwi.com/projects/326034190442168916
Simulation output:
To be continued 😉
Read moreSchematics
chrome_8uc04lnynz_rDTO5av1la.png

Code
- Arduino UNO and LCD project
Arduino UNO and LCD project
Arduino/* Hello Wokwi! */ #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27, 16, 2); void setup() { lcd.init(); lcd.backlight(); lcd.setCursor(1, 0); lcd.print("Hello, Wokwi!"); } void loop() { }Credits

Hack star
75 projects • 149 followersan Arduino enthusiast and an electronic hobbyistFollowComments
Related channels and tags
- display
- lcd
Tag » Arduino I2c Lcd1602 Example
-
LCD I2C Tutorial - Arduino Project Hub
-
Interface I2C 16x2 LCD With Arduino Uno (Just 4 Wires)
-
LCD I2C | Arduino Tutorial
-
Character I2C LCD With Arduino Tutorial (8 Examples)
-
In-Depth: Interfacing An I2C LCD With Arduino
-
Tổng Quan LCD 16×2 Và Giao Tiếp I2C LCD Sử Dụng Arduino
-
I2c 16x2 LCD Example With Arduino
-
Arduino LCD I2C - Tutorial With Arduino Uno - YouTube
-
Arduino Tutorial For LCD1602 I2C Display - Acoptex.Com
-
How To Connect I2C Lcd Display To Arduino Uno - Instructables
-
Lesson 1 Display By I2C LCD1602 - Learn - Sunfounder
-
I2C LCD With ESP32 On Arduino IDE - ESP8266 Compatible
-
Arduino LCD I2C Tutorial For Beginners - NerdyTechy
_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)








