Want to learn how to use a 1602 LCD with Arduino so you can use it in future projects? In this post we’ll go over how to use the 1602 LCD both the conventional way and with I2C. The 1602 LCD can be used to display a simple message, display a sensor value (i.e. temperature), or even display data pulled from the internet (i.e. weather info).
1602 LCD Module Pins
GND – Connects to Arduino’s GND.
VDD – Connects to Arduino’s 5V pin.
V0 – LCD contrast control.
RS – Register select (command/data).
RW – Read / Write selection.
E – Used to enable/disable LCD.
Data Pins (D0 – D7) – Pins used to send data to LCD.
Back Light Control (A/K) – Pins to control the backlight of the LCD.
1602 LCD Connection to Arduino UNO
As you can see, this method uses many of the available IO pins on the Arduino UNO, but does not use the I2C pins (SCL/SDA).
This method is cleaner and frees up your IO pins, but does require use of the I2C pins (SCL/SDA).
LCD Contrast Control
In order to get a desirable contrast on the LCD, you will need to adjust the voltage going to the LCD’s V0 pin. To do this you will need to adjust the potentiometer setting (conventional method) or use a small screwdriver to change the setting on the built-in trimpot (I2C method).


Required Libraries
Conventional Method
The conventional method makes use of the LiquidCrystal library, which is included by default in Arduino IDE (so no need to download or install anything).
I2C Method
The I2C method requires installing the LiquidCrystal_I2C library, which can be found in this Link.
Download & Install the LiquidCrystal_I2C Library
Download the LiquidCrystal_I2C library located on the link above. Once the zip file for the library has been downloaded, you need to import it within the Arduino IDE. For this, go to the top menu, then click Sketch, Include Library, Add .Zip Library… Then, find the zip file in the folder in which it was downloaded, select the zip file and click open to import into Arduino IDE.

Arduino Code – Conventional Method
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
//Arduino Code - 1602LCD Conventional #include <LiquidCrystal.h>// include the library code LiquidCrystal lcd(9,10,4,5,6,7);// Creates an LC object. Parameters: (rs, enable, d4, d5, d6, d7) void setup() { lcd.begin(16, 2); // set up the LCD's number of columns and rows: } void loop() { lcd.setCursor(0,0); // set the cursor to column 0, line 0 lcd.print("DIYEngineers.com"); lcd.setCursor(0,1); // set the cursor to column 0, line 1 lcd.print("1602 LCD"); delay(100); lcd.clear(); // Clears the display } |
Comments on Arduino Code:
Line 3 – Include the LiquidCrystal library
Line 4 – Specify the IO pins connected to RS, E, and Data Pins (D4-D7)
Line 7 – Begin the LCD under the void setup section
Line 11 – Place the cursor at the beginning of the first line in the LCD (i.e. Line 0)
Line 12 – Print the designated characters starting the at cursor location
Line 13 – Place the cursor at the beginning of the second line in the LCD (i.e. Line 1)
Line 14 – Print designated text
Arduino Code – I2C Method
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
//Arduino Code - 1602LCD I2C #include <LiquidCrystal_I2C.h>// include the library code LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address and the number of columns and rows void setup() { lcd.begin(); } void loop() { lcd.setCursor(0,0); // set the cursor to column 0, line 0 lcd.print("DIYEngineers.com"); lcd.setCursor(0,1); // set the cursor to column 0, line 1 lcd.print("1602 LCD"); delay(100); lcd.clear(); // Clears the display } |
Possible Issue:
Line 4 of the Arduino code shown above assumes the I2C address is 0x27. If running the code with this address leads to no text showing on your LCD, chances are that your LCD I2C module is setup to have a different address. One way to get around this is to run a separate code to determine the address. The code below can be used to determine the address (source: https://playground.arduino.cc/Main/I2cScanner).
Click below to expand the I2C Address Finder code (if you need it).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
//Arduino Code - I2C Address Finder // -------------------------------------- // i2c_scanner // // Version 1 // This program (or code that looks like it) // can be found in many places. // For example on the Arduino.cc forum. // The original author is not know. // Version 2, Juni 2012, Using Arduino 1.0.1 // Adapted to be as simple as possible by Arduino.cc user Krodal // Version 3, Feb 26 2013 // V3 by louarnold // Version 4, March 3, 2013, Using Arduino 1.0.3 // by Arduino.cc user Krodal. // Changes by louarnold removed. // Scanning addresses changed from 0...127 to 1...119, // according to the i2c scanner by Nick Gammon // https://www.gammon.com.au/forum/?id=10896 // Version 5, March 28, 2013 // As version 4, but address scans now to 127. // A sensor seems to use address 120. // Version 6, November 27, 2015. // Added waiting for the Leonardo serial communication. // // // This sketch tests the standard 7-bit addresses // Devices with higher bit address might not be seen properly. // #include <Wire.h> void setup() { Wire.begin(); Serial.begin(9600); while (!Serial); // Leonardo: wait for serial monitor Serial.println("\nI2C Scanner"); } void loop() { byte error, address; int nDevices; Serial.println("Scanning..."); nDevices = 0; for(address = 1; address < 127; address++ ) { // The i2c_scanner uses the return value of // the Write.endTransmisstion to see if // a device did acknowledge to the address. Wire.beginTransmission(address); error = Wire.endTransmission(); if (error == 0) { Serial.print("I2C device found at address 0x"); if (address<16) Serial.print("0"); Serial.print(address,HEX); Serial.println(" !"); nDevices++; } else if (error==4) { Serial.print("Unknown error at address 0x"); if (address<16) Serial.print("0"); Serial.println(address,HEX); } } if (nDevices == 0) Serial.println("No I2C devices found\n"); else Serial.println("done\n"); delay(5000); // wait 5 seconds for next scan } |
Comments on Arduino Code:
Line 3 – Include the LiquidCrystal_I2C library
Line 4 – Specify the address and number of columns and rows
The rest of the code is the same as the one on the conventional method
Example Results


Example uses of 1602 LCD
Components used in this example
*As an Amazon & Ebay Associate I earn from qualifying purchases.
Component | Link |
Arduino UNO | https://amzn.to/3uYVAMC https://ebay.us/veZdKX |
1602 LCD (with I2C module) | https://amzn.to/2P146LY https://ebay.us/sofDTP |
Electronic Component Kit (includes potentiometer) | https://amzn.to/3gj4r7O https://ebay.us/AdnfMw |
Breadboard (Elenco 9440) | https://amzn.to/3x23dnq https://ebay.us/FcwSdb |