How to connect I2C LCD display to an Arduino Uno

How to connect an i2c 16×2 LCD display to an Arduino UNO tutorial.

16×2 i2c lcd display (Amazon Links) (USA) (India)
Amazon UK
Amazon Canada
Amazon Australia
Amazon Deutschland
Amazon France
Amazon Italia
Amazon España

16×2 i2c lcd display (Ebay Links)

Arduino Kit (Amazon links):

Arduino Kit (Ebay links):

NewliquidCrystal library

i2c Scanner sketch

Arduino IDE software

Default I2C address of the lcd display

The i2c address of the lcd display is  determined by the controller chip used on the i2c backpack. If a PCF8574 is used on the backpack then it will usually have a default address of 0x27 and if the PCF8574A is used then the default address will be 0x3F.

Changing the i2c address of the lcd display

The I2C address of the lcd display can be changed by soldering three jumpers on the I2C backpack, which gives eight I2C address options. The PCF8574 and PCF8574A have different address ranges, so it is possible to select from 16 different i2c addresses by selecting the type of i2c backpack and the jumpers on the i2c backpack.

PCF8574 datasheet

The  lcd display is not showing anything?

Try changing the contrast potentiometer on the back of the display.

The lcd display doesn’t show anything or just random characters?

Your backpack might be wired differently. Try this line instead:

LiquidCrystal_I2C lcd(0x27, 4, 5, 6, 0, 1, 2, 3, 7, POSITIVE);

// Change the 0x27 i2c address to the i2c address found with the i2c scanner sketch

Com port not found errors

  • Run the windows “device manager”
  • Expand “Ports (COM & LPT)”
  • Check that the serial (com) port exists
  • Check the board is plugged in to a usb port
  • Check the device driver is loaded
  • Some Arduino clones use the CH340 driver, you will need to download and install it.

The scanner sketch can’t find the i2c address?

  • Check the wiring.
  • Some Arduino models use different pins for the I2C connections.
  • If you are not using an UNO then check which pins you need to use.

The lcd backlight doesn’t turn on?

Check the jumper on the side of the backpack normally labelled led.

i2c lcd backlight jumper

‘POSITIVE’ was not declared in this scope

Check that the newliquidcrystal library from F Malpartida has been installed.

The LiquidCrystal  library installed with the arduino ide doesn’t support POSITIVE

From the Arduino IDE

  • Select File – Preferences
  • Select Show verbose output during compilation
  • Ok

Compile your sketch again

You should see a message below that says something like:

Using library NewliquidCrystal in folder: c:/Users/arduino/Documents/Arduino/libraries/NewliquidCrystal

Check that the library path is correct.

If it is not finding the correct library NewliquidCrystal then that is the reason for the error. This might be due to a clash with the default LiquidCrystal  library.  In this case a possible solution is to delete the default LiquidCrystal  library.