ADDIS ABABA UNIVERSITY
COLLEGE OF NATURAL AND COMPUTATIONAL
SCIENCES
DEPARTMENT OF COMPUTER SCIENCE
CoSc4412: Real -Time and Embedded Systems
Keypad and Seven Segment Display System
BY
NAME OF THE STUDENT ID NO
Yosefe Tilahun UGR/9673/15
Instructor: [Link] Tadesse
May 5, 2026
Introduction
This project focuses on designing and simulating an embedded system that integrates a
keypad as an input device and a seven-segment display as an output device. The goal is to
create a system capable of receiving user input from the keypad and displaying the values
on the display.
Such systems are widely used in everyday applications like calculators, password entry
systems, digital locks, and vending machines. The keypad allows users to input numeric
and character data, while the seven-segment display provides a simple way to visualize
the output.
The problem addressed in this project is how to process sequential keypad inputs and
display them as meaningful multi-digit/alphabetic values, while also supporting functions
such as clearing the display.
System Design
Components Used
● Arduino Uno R3
● Keypad 4x4
● 7-Segment Clock Display
● Connecting wires
● Breadboard Small
Circuit Design
The keypad is connected to the microcontroller using a matrix configuration of rows and
columns.
The 7-segment clock display is connected to the microcontroller’s SDA and SCL pins
alongside a power source (5V) and ground (GND).
Input/Output Behavior
● When a key is pressed, the microcontroller detects the input.
● The pressed key value is processed and appended to an array that keeps track of
the current values that should be displayed.
● The updated value is displayed on the 7-segment clock display.
Multi-Digit Input Handling
The system stores previously entered digits and shifts them to the left when a new digit is
entered. For example:
● Press 2 → Display shows “2”
● Press 3 → Display updates to “23”
This is implemented using an character array that does the left shift and adds the new
digit/alphabet.
Reset Functionality (# Key)
Pressing the # key clears the stored value and resets the display to blank. This allows the
user to start a new input sequence. This is implemented by reseting all values of the array
to ‘ ‘ or a space.
Displaying A, B, C, D
The system also supports displaying characters A, B, C, and D. This is possible by
treating all key clicks as characters and printing them out using the writeDigitAscii
function.
Implementation
The system is implemented using Arduino C/C++ with external libraries for keypad
handling and display control.
Program Logic Overview
1. Initialize keypad and display
2. Continuously read keypad input using getKey()
3. If a valid key (not * or #) is pressed:
❖ Shift stored characters left
❖ Insert new character at the end
❖ Update display
4. If # is pressed:
❖ Clear stored characters
❖ Clear display
Key Functions Used
● [Link]() → Detects key presses
● [Link](0x70) → Initializes display
● [Link](position, char) → Displays characters
● [Link]() → Clears display
● [Link]() → Updates display
Handling Multiple Inputs
Instead of storing a full number, the system stores characters in an array of size 4. This
ensures:
● Only the latest 4 inputs are visible
● Older inputs are automatically discarded
Results and Testing
Successful Functionality
● Keypad inputs are correctly detected
● Multi-digit input works
● Characters A–D are displayed correctly
● Reset using # works as expected
● Display updates in real time
Example Test Cases
● Press 2 → Display: 2
● Press 2, 3 → Display: 23
● Press 2, 3, 4, 5 → Display: 2345
● Press 6 → Display: 3456
● Press A → Display: 456A
● Press # → Display clears
Issues Faced
● The display skips index 2 due to the colon (:) in the hardware
● Limited to showing only 4 characters
Solutions
● Adjusted indexing (0,1,3,4) to avoid the colon segment
● Implemented shifting logic to simulate continuous input
Conclusion
The project successfully implemented a keypad-controlled display system using an
Arduino and a 7-segment clock display. It supports multi-digit input, character display,
and reset functionality.
Key learning outcomes include working with external libraries, handling user input
efficiently, and managing hardware constraints such as limited display size. The project
also demonstrated how to design a responsive and user-friendly embedded system.
References
1. [Link]
2. [Link]
3. [Link]