MECA 442 Lab Report 1
MECA 442 Lab Report 1
ABSTRACT
In this Arduino electronics tutorial, you will learn how to interface Arduino with keypad and LCD,
how to use Arduino Keypad library and how to code Arduino Keypad with LCD. Here we will be using 4x4
Keypad and 16x2 LCD.
1. INTRODUCTION
Interfacing a 4×4 matrix keypad and a 16×2 LCD display with an Arduino UNO
microcontroller is a simple and effective way to create a user-friendly interface for various
applications. The keypad provides a convenient way for the user to input data, while the LCD
display is used to display the results of the inputs. The combination of these two components,
along with the Arduino UNO, makes it easy to create a system that can be used for a variety of
purposes such as password protection, menu-driven systems, data input, and more.
b. 2x16 LCD
16x2, shown in figure 3, is named so because it has 16
columns and 2 rows. This LCD used to display the
results.
FIGURE 3: 2x16
LCD
c. Bread board
Bread board, shown in figure 4, it is useful to the person who wants to build a
circuit to demonstrate its action, then to reuse the components in another
circuit.
2
d. 4x4 keypad
4x4 keypad, shown in figure 5, Keypad is used as an input device to
read the key pressed by the user and to process it. 4x4 keypad
consists of 4 rows and 4 columns. Switches are placed between
the rows and columns.
e. Resistors
Resistor, shown in figure 6, limits or regulates the flow of
electrical current in an electronic circuit.
Figure 6: resistor
f. wires
Wires, shown in figure 7, a connecting wire allows travels the electric
current from one point to another point without resistivity.
Figure 7: wires
In this experiment no real equipment were used, all the steps were done on a
simulation software called proteus. Every step was implemented using proteus that
offers a wide access to all electronic components needed for this experiment,
providing a visual presentation for the user to observe.
3
Figure 7: simulation of experiment (key D pressed)
Proteus software was used to carry out the simulation mentioned above. These
graphs demonstrate several experiment states by tapping various keypad locations.
The keypad contains eight connections, four for rows and the remaining four for
columns. These eight pins are linked to the digital pins of the Arduino, but only four
of them are designated as input pins and the remaining four are output pins (either
the column pins or the row pins).
NOTE: In order to prevent floating pins from affecting the Arduino's readings, the
keypad's input pins that are linked to the Arduino must be programmed as pull-up
resistor pins (5v).
LCD RS pin to digital pin 13
LCD Enable pin to digital pin 12
LCD D4 pin to digital pin 11
LCD D5 pin to digital pin 10
LCD D6 pin to digital pin 9
LCD D7 pin to digital pin 8
LCD R/W pin to ground
LCD VSS pin to ground
LCD VCC pin to 5V
10K resistor:
ends to +5V and ground
wiper to LCD VO pin (pin 3)
The LCD and keypad were connected to the Arduino UNO following standard pin
configurations, and the necessary libraries were imported.
NOTE: to program the Arduino in the proteus first write the code using Arduino
IDE and export it to binary then upload the exported file to the Arduino board on the
software.
4. Application
APPENDIX
Code: