Arduino Tutorials

How to Connect I2C LCD Display to Arduino

IIC LCD DISPLAY for arduino

Introduction

In this tutorial, you will see how to connect i2c LCD display (Liquid Crystal Display) to Arduino using the i2c module. Before starting this article we will see what is i2c. I2C (I-square-C i.e IIC) means inter-integrated communication protocol. This is usually used to communicate between one master and multiple slaves. One of the best things about using I2C is we can reduce the connections (wiring). If you use normal LCD display, you need a total number of connections are 12. If you use I2C LCD display, you need only just 4 connection. By seeing the above example you may know the advantage of I2C protocol. I2C protocol is also known as 2 line protocol.

Components Required

Arduino Uno

I2C LCD Display/IIC LCD Display

Jumper Wires

Pin Configuration of I2C LCD Display

iic lcd display

If you properly have seen the picture above, you will see a black adapter. That black adapter uses the PCF8574T IC chip which converts I2C serial data to parallel data for the LCD display. The blue color component you have seen in the above picture is a potentiometer which is used to adjust the brightness of the display.

Connections

I2C LCD Display

Arduino Uno    <->   LCD Display

5V     <—————>    Vcc

GND   <—————>    GND

A4     <—————>    SDA

A5     <—————>    SCL

Source Code

 

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
//I2C pins declaration
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); 
void setup() 
{
lcd.begin(16,2);//Defining 16 columns and 2 rows of lcd display
lcd.backlight();//To Power ON the back light
//lcd.backlight();// To Power OFF the back light
}
void loop() 
{
//Write your code
lcd.setCursor(0,0); //Defining positon to write from first row,first column .
lcd.print(" Tech Maker "); //You can write 16 Characters per line .
delay(1000);//Delay used to give a dynamic effect
lcd.setCursor(0,1);  //Defining positon to write from second row,first column .
lcd.print("Like | Share");
delay(8000); 
lcd.clear();//Clean the screen
lcd.setCursor(0,0); 
lcd.print(" SUBSCRIBE ");
lcd.setCursor(0,1);
lcd.print(" TECH MAKER ");
delay(8000); 
}

 

Download Libraries

Procedure

  1. Download and Install the Library attached.
  2. Download the code.
  3. Connect the components as the circuit attached.
  4. Edit the code as need to change the text on LCD.
  5. Upload the downloaded code.
  6. Now you can see the text on LCD.

Watch Video

Working of LCD Display

The LCD display has an inbuilt register, to store the data and commands given to the LCD display. It has two modes, one is READ mode and another is WRITE mode. In write mode commands to control the display is written to the register like display clear, shift right, the cursor on, etc., In WRITE mode the register is also written with data which is needed to be displayed on the display. Here a question arises how to differentiate between commands and data written to the register. There a pin called Register select (RS), if that pin is made to zero, then it is command register. If it is one, then it is a data register.

The selection of READ / WRITE is done by a pin R/W. If R/W is equal to zero, then it is write mode. If R/W is equal to one it is read mode.

lcd pinout

click on the link for more projects and tutorial on Arduino.

If you have any queries, feel free to comment below. I will reply as soon as possible.

 

About the author

Electronics Projects Hub

2 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.