[Complete] How to Display Text on 16x2 and i2c LCD Using Arduino Uno

9:27 AM

What are 16x2 and i2C LCDs

LCD (Liquid Cristal Display) is one part of the display module that displays the desired character. The LCD screen uses two sheets of polarizing material and a liquid crystal between the two sheets. LCD uses a lot in designing a system using a microcontroller. LCD can work to display characters according to a predetermined command. while i2c is an additional module to convert the number of output pins from the LCD, so that fewer pin outs are used, which is only 4 pins.

On arduino already supports the i2c module. For the port used on Arduino to access the i2c module, namely on the sda, scl pins or A4 and A5 pins. The Arduino IDE software has also been assisted with the provided wire.h library, where the task of this library is to convert the parallel LCD line to serial i2c.

The i2c module uses the PCF8574 ic chip from NXP which is used as the microcontroller

The specifications of the 16x2 LCD are

  • Requires input voltage of 4.7V-5.3V
  • There are 2 rows of characters and 16 columns to generate characters

  • Utilizes 1mA current without backlight
  • Letters and numbers can use alphanumeric

  • Can work in 4-bit mode as well as 8-bit

  • There are 2 backlights, namely blue and green

The parts of the LCD are:

  • First layer of polarized film
  • Positively charged electrode layer

  • Liquid crystal coating

  • Negative electrode coating

  • Second layer of polarized film

  • Mirror or backlight

Working principle on LCD (Liquid Crystal Display)

On the LCD there is a white backlight that will give light to the liquid crystal, then the liquid crystal will filter the light emitted by the backlight and then reflect it according to the desired viewing angle and then the required color will be formed. The liquid crystal will change its angular position when it gets an electric current or voltage, and a change in the angle of the liquid crystal which is initially white will change to various desired colors.

If you want a white backlight, the liquid crystal must be opened wide so that it can produce white light, and when you want black light, the liquid crystal is closed tightly so that the backlight will not penetrate it, to change to another color it is necessary to change the angle of reflection of the liquid crystal. Because the main structure of the LCD is only 2 parts, the backlight and the liquid crystal.

Next, just discuss how to display text on a 16x2 LCD with the i2c module on the arduino. Please look at the picture below, the picture below is a series to display text on a 16x2 LCD.

[Complete] How to Display Text on 16x2 and i2c LCD Using Arduino Uno


The configuration of the lcd circuit using i2c with Arduino Uno pins is as follows:

  •  VCC : Connected to 5V voltage on Arduino Uno

  • GND : Connected to the GND pin on the Arduino Uno

  • SDA : Connected to the sda ​​pin on the Arduino Uno

  •  SCL : Connected to the SCL pin on the Arduino Uno

Arduino Uno pin configuration with LCD circuit using i2c as follows:

  • 5V : Connected to the VCC pin on the i2c . module

  • GND : Connected to GND on the i2c . module

  • SDA : Connected to the SDA pin on the i2c . module

  • SCL : Connected to the SCL pin on the i2c . module

Next, go to programming, first download the library from LCD i2c on google/arduino.cc official site

How to install the library as follows:

  •  Open the Arduino Application that has been installed on your computer or laptop

  • Click the Sketch Menu

  • Select Include Library > Add .ZIP Library

  • Then find the location of the downloaded file

  • Once found, click Open

Continue to the program and upload the program

  • open arduino IDE app

  • click file > Examples

  • search LiquidCrystali2c>helloword

  • upload the program then see the results, the LCD will display the characters according to the commands in the program

Next Article
« Prev Post
Previous Article
Next Post »
Disqus
Tambahkan komentar Anda

No comments