Name: __________________________________ Date Performed: _________________
Course: _____________________ Date Submitted: __________________
Experiment 8
Keypad Security Code
I. Objectives:
1. Understand the principle of operation of a numeric keypad.
2. Interface numeric keypads, servo motor, buzzer and LED to an Arduino board.
II. Theoretical Background
4x4 Keypad
A keypad is a set of buttons arranged in a block or "pad" which usually bear
digits, symbols and usually a complete set of alphabetical letters. Similar to a telephone
keypad (or a touchtone keypad), it is arranged from 1 to 0, downwards, with the
number zero placed in between the asterisk and the pound sign. Each number has
designated letters in the alphabet.
Pins 1-4
Pins 5-8
are the rows
are the columns
Figure 8.1: 4×4 Keypad pinout
III. Materials:
1 x Arduino Uno board and USB cable
1 x Servo Motor
1 x 4x4 Keypad
2 LEDs (Red and Green)
2 380 ohms Resistors
Buzzer
Connecting wires
IV. Procedure:
1. Construct the circuit using the Arduino Uno, Breadboard, Servo motor, 4x4
keypad, buzzer, LEDs, and resistors.
2. Create a program that accepts a secret code from a keypad. If the input secret
code is correct a green LED will light and the servo motor rotates 0 degree. Otherwise,
buzzer will turn ON for 5 secs and red LED stays in lit. Initially the Servo motor position
is in 90 degrees and the red LED is ON states. Print the password entered, the Red and
Green LED status, the position of the Servo Motor and Buzzer status in the Serial
Monitor.
SECRET PASSWORD = 4321 followed by ‘#’. If ‘*’ symbol is press a prompt “Enter the
correct password and press #”
V. Circuit Diagram
VI. Actual Diagram
VII. Program
VIII. Discussion Questions:
1. What function is use in storing pressed key value in a char?
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
___________________
2. Why it is important to create an instance in programming using a keypad?
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
IX. Conclusion