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)
Amazon.com (USA) https://amzn.to/2Nyzxab
Amazon.in (India) https://clnk.in/gylZ
Amazon UK https://amzn.to/2Slvzsl
Amazon Canada https://amzn.to/2t9ewKO
Amazon Australia https://amzn.to/2HYmS2b
Amazon Deutschland https://amzn.to/2UPe00t
Amazon France https://amzn.to/2HXQfl7
Amazon Italia https://amzn.to/2ULL8WH
Amazon España https://amzn.to/2Seg8Sq

16×2 i2c lcd display (Ebay Links)
Ebay.com https://ebay.to/2O3w2JL
Ebay.de https://ebay.to/2A2CfTs
Ebay.co.uk https://ebay.to/2zWCTBG
Ebay.ca https://ebay.to/2L9KxOv
Ebay.nl https://ebay.to/2Lqj1eB
Ebay.fr https://ebay.to/2uAn2DK
Ebay.com.au https://ebay.to/2mx6vfz

Arduino Kit (Amazon links):
USA  https://amzn.to/2O3JjSw
UK  https://amzn.to/2DHoJod
India  https://clnk.in/gyl0
Deutschland  https://amzn.to/2DJ0few
España  https://amzn.to/2DK9Em6
France https://amzn.to/2zmAP31
Italia https://amzn.to/2S890T6
Canada https://amzn.to/2TGhgvd
Australia https://amzn.to/2PVx3s5

Arduino Kit (Ebay links):
Ebay.com https://ebay.to/2O4BEn1
Ebay.de https://ebay.to/2mwkLVB
Ebay.co.uk https://ebay.to/2uD8P9c
Ebay.ca https://ebay.to/2JGp1Lv
Ebay.nl https://ebay.to/2LzIzCZ
Ebay.fr https://ebay.to/2LpPzWo
Ebay.com.au https://ebay.to/2LrHyQB

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.