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)
Arduino Kit (Amazon links):
Arduino Kit (Ebay links):
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.
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.
‘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
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.