How to connect an i2c 16×2 LCD display to an Arduino UNO tutorial.
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.