0% found this document useful (0 votes)
137 views

Displaying Text On 16x2 LCD With Arduino

The LCD 16×2 is most popular viewers used as an interface between the microcontroller and its users. With LCD 16×2 viewer user can monitor the state of the sensor or the state of the program. LCD 16×2 viewer can be connected to any microcontroller, such us ATMega32, ATMega16 or ATMega8535 and ATMega 8.

Uploaded by

faqihfadillah
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
137 views

Displaying Text On 16x2 LCD With Arduino

The LCD 16×2 is most popular viewers used as an interface between the microcontroller and its users. With LCD 16×2 viewer user can monitor the state of the sensor or the state of the program. LCD 16×2 viewer can be connected to any microcontroller, such us ATMega32, ATMega16 or ATMega8535 and ATMega 8.

Uploaded by

faqihfadillah
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Displaying Text on 16×2 LCD with Arduino

Getting Started Tools

A. LCD 16×2
The LCD 16×2 is most popular viewers used as an interface between
the microcontroller and its users. With LCD 16×2 viewer user can
monitor the state of the sensor or the state of the program. LCD 16×2
viewer can be connected to any microcontroller, such us ATMega32,
ATMega16 or ATMega8535 and ATMega 8.

(Ref: https://www.codepolitan.com/menampilkan-text-di-lcd-dengan-
arduino)

On the picture can be seen that the LCD 16×2 has 16 pins. The wiring
is as follows:

The 1st and 16th connect with Ground (GND)


The 2nd and 15th connect with VCC (+ 5V)
The 3rd of the LCD 16 × 2 is adjust the LCD brightness contrast. So
we can pair a 103 trimpot to set the brightness, because the LCD will
change brightness if the voltage on 3rd pin is lowered or increased.
The 4th connect with microcontroller pin
The 5th (RW) connect with GND
The 6th (E) connect to the microcontroller pin
The 11th untill 14th are connected with microcontroller pins as data
lines.
B. I2C LCD
Inter Integrated Circuit (I2C) is a two-way serial
communication standard using two channels designed specifically for
sending or receiving data. The I2C system consists of SCL (Serial
Clock) and SDA (Serial Data) channels that carry data information
between I2C and controllers. The devices connected to the bus I2C
system can be operated as master and slave. The Master is a device
that initiates the transfer of data on the bus I2C by forming a start
signal, terminating the data transfer by forming a stop signal, and
generating a clock signal. Slave is a master addressed device. The start
signal is a signal to start all commands, defined as the change of SDA
voltage from "1" to "0" at SCL "1". The Stop signal is a signal to
terminate all commands, defined as the change of SDA voltage from
"0" to "1" at SCL "1". Start signal conditions and Stop signals as
shown in the following figure:

(Ref: https://www.codepolitan.com/menampilkan-text-di-lcd-dengan-
arduino)

Another basic signal in I2C Bus is acknowledge signal


symbolized by ACK after the transfer of data by the master
successfully received slave, slave will answer it by sending
acknowledge signal, that is by making SDA becomes "0" during clock
cycle to 9. This indicates that slave has receive 8 bits of data from
master. The acknowledge signal condition as shown in the following
figure:
(Ref: https://www.codepolitan.com/menampilkan-text-di-lcd-dengan-
arduino)

In performing data transfer on I2C Bus, we must follow the prescribed


procedure that is:
Data transfer can only be done when Bus is not busy. During the data
transfer process, the state of the data on the SDA must be stable
during SCL in a high state. The state of change "1" or "0" in SDA can
only be done during low SCL. If there is a change in the state of SDA
when SCL is in high state, then the change is considered as a Start
signal or Stop signal.

(Ref: https://www.codepolitan.com/menampilkan-text-di-lcd-dengan-
arduino)

C. Arduino UNO

Arduino Uno R3 is a development board (development board)


microcontroller based on ATmega328P chip. Called as a development
board because this board does serve as a prototyping arena of
microcontroller circuits. By using the development board, you will
more easily assemble the microcontroller electronics circuit than if
you start assembling ATMega328 from scratch on the breadboard.
Assembling Tools
first of all kind of tool as in the following picture:

(Ref: https://www.codepolitan.com/menampilkan-text-di-lcd-dengan-
arduino)

Connect the I2C module to Arduino UNO, Make sure all cables are
connected properly. If it is correct, the next step, processing of making
the program. Well before starting to make the program, we must
download the library first.

Next, creating a program in the Arduino IDE app and write the
program as below:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd (0x27,2,1,0,4,5,6,7,3, POSITIVE);

void setup ()
{
lcd.begin (16,2);
}

void loop ()
{
lcd.setBacklight (HIGH);
lcd.setCursor (0,0);
lcd.print ("EGI ANUGRAH");
lcd.setCursor (0,1);
lcd.print ("CODEPOLITAN");
delay (1000);
lcd.setBacklight (HIGH);
delay (1000);
}

Bibliography: Anugrah, Egi. 2016. Menampilkan Text di LCD 16×2


dengan Arduino (online). Codepolitan, diakses: 6 January 2018,
https://www.codepolitan.com/menampilkan-text-di-lcd-dengan-
arduino

You might also like