Laboratory Exercise 9 - Displaying Characters and Texts in LCD

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Laboratory Exercise 9 - Displaying Characters and

Texts in LCD
Keen Cabalse
Bachelor of Science in Mechanical Engineering
Visayas State University
Baybay City, Philippines
[email protected]

Abstract—This laboratory exercise deals with basic of LCD electronic device will not be explored in this
electronics devices and Arduino hardware and software to laboratory exercise.
create a circuit. This in particular deals with the LCD 1602
electronics device. The LCD 1602 will be utilized to display text
written in the Arduino code. Also, the LCD will be used as a
monitoring screen to monitor the output data displayed of other III. METHODOLOGY
electronic device such as sensors. A. Materials
Keywords—LCD 1602, Arduino, display, monitor, basic The following are materials need for the laboratory
electronics exercise.
• 1 – Arduino UNO R3
I. INTRODUCTION
This laboratory exercise will deal with simple and basic • 1 – USB Cable (USB-A to USB-B)
electronics. Electronics by definition is a branch of physics • 1 – LCD Module 2x16 Character
and electrical engineering revolving on electrical applications
on / with electronic devices [1]. The specific electronics • 1 – Potentiometer 10k-ohm
device explored in this laboratory exercise is the LCD • 1 – 220-ohm or 330-ohm Resistor
Module.
• 1 – Breadboard
An LCD or Liquid-Crystal Display is an electronic panel
that uses blacklight to produce image [2]. It is an electronic • Connecting Wires
device that has myriad of applications that is noticeable in the • Computer with Arduino software
current society. From phones to billboards. This electronic
device is useful for displaying outputs or text such messages. .
The application of LCD and Arduino hardware and B. Circuit Diagram
software allows user to utilize the LCD as a monitoring screen This schematic diagram of the light sensor circuit is made
for outputs of other electronic device such as temperature using Fritzing.
sensors and others of the same sort.
II. OBJECTIVES
A. Objectives
This laboratory exercise aims to create a fully functioning
LCD monitoring circuit, and the application of Arduino
Programming to be able to display characters on the LCD
module screen.
This laboratory exercise specifically aims to a) show
output values or text in the LCD screen; b) integrate sensors
into the circuit and display output values; c) apply knowledge
of Arduino programming to create appropriate Arduino code.

B. Scope and Limitation


This laboratory exercise focuses mainly in building a fully
functioning LCD monitoring circuit using simple and basic
electronic devices such as LCD module and the usage of
Arduino UNO R3. Figure 1: Circuit Schematic Diagram
The use of another model of Arduino will not be discussed
in this laboratory exercise. The circuit created in this
laboratory is a prototype kind of circuit made of basic
electronic device and is not a large circuit system. Other types

MEng 125n – Basic Electronics


2nd Semester SY 2020-2021
Instructor: Engr. Philip Caesar L. Ebit
C. Code Potentiometer is a three terminal variable resistor that
This is the Arduino code to be used for the laboratory allows manipulation of resistance manually to control electric
exercise which was provided in the laboratory manual. flow [5].
LCD module is a basic electronic device or components
that allows user to display outputs or texts such as messages.
The circuit was successful. Text and messages were
displayed properly. Also, the timer set to record the time of
running from reset was displayed.
When a temperature sensor was added to the circuit it was
connected to the GND, 5 v and the A0 pin. Specific codes
were added accordingly to properly incorporate the device
into the circuit and for the data output to be displayed on the
LCD monitor.
It is the same for the addition of the LDR. Specific codes
were added to appropriately configure the circuit function.
Due to the minimal available units to be displayed on the
LCD monitor. Text are abbreviated to compensate for the
space. But overall, outputs and changes from the two sensors
are displayed properly on the LCD monitor.
The LCD module is a helpful alternative in viewing the
outputs of devices and/or messages in relation to the Serial
Monitor in the Arduino Program software.

V. CONCLUSIONS AND RECOMMENDATIONS


To summarize all points, an LCD module is a useful
electronics device. One of its application is to monitor text or
messages and/or output values from other electronics device
within a circuit. It is a useful alternative from the Serial
monitor that is in the Arduino Program Software.
As a recommendation, due to the minimal units available
for display in the LCD module. It is best to Abbreviate or
shorten some words to maximize the space. Also, when there
is a remaining space in the second line of the LCD previous
IV. RESULTS AND DISCUSSIONS text will be displayed so it is best to set the cursor to a new
This part will present the results of the laboratory exercise coordinate.
as well as the functions of each devices/components, along
with the post lab questions presented in the objective part of
the paper. ACKNOWLEDGMENT
In this laboratory components/devices used are Arduino The following are given acknowledgment because this
UNO R3, LCD Module USB Cable (USB-A to USB-B), laboratory exercise is made possible with their help.
Breadboard, and Connecting wires. DOST, as I am a beneficiary of DOST-SEI Undergraduate
Arduino UNO R3 is an electronic device or component Scholarship Program.
that is a microcontroller, allowing input or uploading of Lazada, for being an easy access shop during the pandemic
program that instigate specific actions and functions to to acquire the necessary materials for the laboratory.
components in a circuit like the LED to function [3].
Sir Philip Caesar Ebit, REE, for the knowledge and
USB Cable, is a wire that connects the Arduino to the guidance, and other requirements provided within the
computer, allowing the transfer of data from the program laboratory manual.
application.
My family, for providing financial support throughout the
Breadboard is a component or device that is designed to completion of the project.
contain electronics to test circuit design. It is built as to not
require any soldering to contain electronic components, and REFERENCES
has integrated metal strips within the device, that serves as [1] Scace, Robert I.. "Electronics". Encyclopedia Britannica, 2 Jun. 2020,
wiring. between components to form a connection [4]. https://www.britannica.com/technology/electronics. Accessed 13 April
2021
Connecting wires, are wires that has metal tips in both ends [2] Wikipedia contributors. "Liquid-crystal display." Wikipedia, The Free
used to connect the Arduino to other components attached on Encyclopedia. Wikipedia, The Free Encyclopedia, 18 Jun. 2021. Web.
the breadboard. 19 Jun. 2021.

MEng 125n – Basic Electronics


2nd Semester SY 2020-2021
Instructor: Engr. Philip Caesar L. Ebit
[3] "Pololu - Arduino Uno R3". Pololu.Com, 2021, [6] Thakur, Manoj. "Arduino Light Intensity Meaurement |
https://www.pololu.com/product/2191#:~:text=The%20Arduino%20 Circuits4you.Com". Circuits4you.Com, 2021,
Uno%20is%20a,header%2C%20and%20a%20reset%20button https://circuits4you.com/2016/05/13/arduino-light-sensor/. Accessed
[4] Barrag, H. (n.d.). Breadboard \ Wiring. Wiring cover. 21 June 2021.
http://wiring.org.co/learning/tutorials/breadboard/. [7] "Arduino Code And Video LCD1602 With I2C Display Module -
[5] https://www.electrical4u.com/potentiometer/#:~:text=A%20potentio Robojax". Robojax.Com, 2021,
meter%20(also%20known%20as,as%20an%20adjustable%20voltage https://robojax.com/learn/arduino/?vid=robojax-LCD1602-I2C.
%20divider. Accessed 9 May 2021. Accessed 21 June 2021.

MEng 125n – Basic Electronics


2nd Semester SY 2020-2021
Instructor: Engr. Philip Caesar L. Ebit
Laboratory Exercise 9: Modified int correctTemperature = tempReading * 0.488;
Arduino Code lcd.print("Temp is:");
Highlighted parts are modified areas from lcd.print(correctTemperature);
the original code
lcd.setCursor(0, 1);
/* Displaying Characters and Texts in LCD */
lcd.print("Light LUX:");
lcd.print(int(Light(analogRead(1))));
#include <LiquidCrystal.h>
lcd.setCursor(0,2);
#include <LiquidCrystal_I2C.h> // added library from
robojax for the I2C connected to the LCD

delay(50);
LiquidCrystal_I2C lcd(0x27, 16, 2);
}
int temperaturesensorPin = 0 // set pin for the
temperature sensor;

//Light Intencity Measurement


//www.circuits4you.com
double Light (int RawADC0)// function to compute
light intensity
{
double Vout=RawADC0*0.0048828125;
//int lux=500/(10*((5-Vout)/Vout));//use this equation
if the LDR is in the upper part of the divider
int lux=(2500/Vout-500)/10;
return lux;
}

void setup()
{

lcd.begin();

void loop()
{ // set the cursor to column 0, line 1(note: line 1 is
the second row, // since counting begins with 0):

int tempReading =
analogRead(temperaturesensorPin);

You might also like