Introduction of 16x2 LCD

16x2 lcd screen

16x2 LCD screen

16x2 LCD specifications

LCD 16x2 is used to display status or parameters.

  • 16x2 LCD has 16 pins including 8 data pins (D0 - D7) and 3 control pins (RS, RW, EN).
  • The remaining 5 pins are used for powering and backlighting for LCD 16x2.
  • The control pins make it easy to configure the LCD in command mode or data mode.
  • They also help us configure read or write mode.

LCD 16x2 can be used in 4-bit or 8-bit mode depending on the application we are doing.

I2C Module Arduino

i2c lcd module 16x2

I2C LCD module 16x2

LCD has too many pins, making it difficult to connect and take up too many pins on the microcontroller. 

I2C LCD module was born and solved this problem for you.

Instead of having 6 microcontroller pins to connect to LCD 16x2 (RS, EN, D7, D6, D5 and D4), IC2 module you only need 2 pins (SCL, SDA) to connect.

The I2C module supports all types of LCDs using HD44780 drivers (LCD 16x2, LCD 20x4, ...) and is compatible with most current microcontrollers.

Advantages

  • Saving pins for microcontroller.
  • Easy to connect to LCD.

Technical data

  • Operating voltage: 2.5-6V DC.
  • Screen support: LCD1602,1604,2004 (HD44780 driver).
  • Communication: I2C
  • Default address: 0X27 (can be adjusted by short circuit pin A0 / A1 / A2).
  • Integrated Jump latch to provide lights for LCD or interrupts.
  • Integrated rheostat adjustable contrast for LCD.

To use the I2C communication LCD screen using Arduino, we need to install the Liquidcrystal_I2C library  Here

Common errors when using I2C LCD

  • Display a range of squares.
  • The screen prints only the first character.
  • Screen flicker.

These errors are mainly due to the wrong bus address, to fix the error, you change the default address of "0x27" to "0x3F.

In case you still cannot fix the error by loading the code to find the bus address of I2C.

After searching, replace the address you just found in position "0x27" and you're done.

  • You can download the code to find the bus address here. Download now.

I2C LCD communication Arduino

I2C LCD module 16x2 

Arduino UNO

GND

GND

VCC

5V

SDA

A4 / SDA

SCL

A5 / SCL

Connection diagram

communication i2c lcd 16x2

IC2 communication connection diagram with LCD 16x2.

The necessary components for the project:

  • Arduino UNO: See product here.
  • 16x2 LCD screen: See product here. 
  • I2C LCD Module 16x2: See product here. 
    #include  < Wire . h >  
    #include  < LiquidCrystal_I2C . h > 
    LiquidCrystal_I2C  lcd ( 0x3F , 16 , 2 ) ; 
    
    void  setup ( ) 
    { 
      lcd . init ( ) ;                     
      lcd . backlight ( ) ; 
      lcd . setCursor ( 2 , 0 ) ; 
      lcd . print ( "Arduinokit.vn" ) ; 
      lcd . setCursor ( 0 , 1 ) ; 
      lcd . print ( "Hello friends" ) ; 
    }
    
    void  loop ( ) 
    { 
    }