Hello everyone! In this article, we will connect a 16x2 LCD to Arduino over I2C. Using an I2C LCD with Arduino cuts the wiring from 12+ pins down to just 4 (VCC, GND, SDA, SCL), which keeps your projects much cleaner. Let’s get started!

Read This!

If you want to learn more about the 16x2 LCD Screen in more detail and how to use it without I2C, you can find out by clicking here. This blog will also be supported with guide blogs. ✨

What is an I2C Adapter?

The I2C chip has an 8-Bit I/O Extender chip-PCF8574. This chip converts the I2C data from an Arduino into parallel data required by the LCD screen.

i2c-cipi image could not be loaded. Please let us know in the comments!

The I2C also has a small trim pot to fine-tune the display’s contrast. You can adjust its brightness by turning it with a screwdriver.

i2c-trimpotu image could not be loaded. Please let us know in the comments!

In addition, the I2C has a pin cable that supplies power to the backlight. To control the intensity of the backlight, you can remove the cable and apply an external voltage to the head pin marked “LED”.

Without going into more detail, let’s move on to the way it is linked.

Arduino I2C LCD Connection

The I2C LCD module connects to Arduino with only four wires: VCC to 5V, GND to GND, SDA to A4 and SCL to A5 (on an Arduino Uno).

Arduino I2C LCD wiring diagram: 16x2 LCD connected to Arduino Uno over the I2C adapter (SDA to A4, SCL to A5)

Arduino IDE Library Setup

If you don’t know how to set up a library, you can check out this page.

Download the LiquidCrystal I2C library by Frank de Brabander by typing liquidcrystal instead of searching for a library. If you can’t find it, quickly download it from this link (it downloads as soon as you click it) and add it as a ZIP. (Downloading from Arduino site.) Here’s a quick rundown on how to add it as a ZIP.

Arduino I2C LCD Code Example

#include <LiquidCrystal_I2C.h> // added the library

LiquidCrystal_I2C lcd(0x3F,16,2);  // for a screen of 16 characters and 2 lines, the LCD address is set to 0x3F.

void setup() {
  lcd.init();
  lcd.clear();
  lcd.backlight();      // backlight on
  lcd.setCursor(2,0);   // 3 rows to the right, 1 column down
  lcd.print("projedefteri.com");
}

void loop() {
}

If you want to show your own custom characters (special symbols, accented letters, etc.) on the screen you wired up over I2C, our LCD Custom Character Generator builds the byte array you need in seconds.

Frequently Asked Questions

Which pins does an I2C LCD use on Arduino? On an Arduino Uno the I2C LCD uses A4 (SDA) and A5 (SCL), plus 5V and GND. On an Arduino Mega, SDA is pin 20 and SCL is pin 21.

My Arduino I2C LCD shows nothing. What should I check? First adjust the contrast trim pot on the back of the I2C module. Then verify the I2C address: most modules use 0x27 or 0x3F. If neither works, run an I2C scanner sketch to find the correct address.

What is the I2C address of a 16x2 LCD? It depends on the chip on the adapter: PCF8574 modules usually respond at 0x27, PCF8574A modules at 0x3F. The address goes into the constructor, for example LiquidCrystal_I2C lcd(0x27,16,2);.

Which library do I need for an Arduino I2C LCD? The LiquidCrystal_I2C library. Install it from the Arduino IDE Library Manager or add it as a ZIP as shown above.

If you have had any problems, do not forget to check your links, or you can send your questions, comments, and suggestions from the comments! Happy coding! 😁