Group E-Arduino 4-Digit 7-Segment Display Countdown Timer With Passive Buzzer
Group E-Arduino 4-Digit 7-Segment Display Countdown Timer With Passive Buzzer
Evaluation Remark:
1
Arduino 4-digit 7 segment display countdown
timer passive buzzer
Introduction
The primary motivation behind this project is to explore the integration of hardware and
software to design a functional, user-friendly system. This project not only highlights the
capabilities of microcontrollers but also demonstrates techniques such as multiplexing for
efficient display control and handling user inputs via buttons. By working on this project,
one gains practical insights into embedded systems, a fundamental domain in electronics
and computer engineering.
2
Objectives
The primary objectives of the project are
1. To design and implement a countdown timer using an Arduino Uno and a 4-digit 7-segment
display.
2. To provide a user-friendly interface for setting, starting, and resetting the timer.
3. To utilize a passive buzzer for audible feedback and alerts.
4. To demonstrate the concept of multiplexing for efficient control of a multi-digit display.
5. To offer an educational platform for understanding embedded systems and microcontroller-
based projects.
List of Equipment
Arduino Uno 5641BH- 4 Digit, Seven Segment Display.
With 12 pins
3
Working Procedure
This Counter is operated by interfacing a 4-digit 7-segment display with the Arduino Uno to visually
represent numbers. The user interacts with the system by three push buttons:
1. SET Button: Increment the countdown value.
2. START Button: Initiate the countdown.
3. RESET Button: Stop the countdown and reset the value to zero.
The passive buzzer will provide audio feedback when we pressed the button and we will hear
sounds continuously when the countdown reaches zero.
Circuit Diagram
1. 7-Segment Display:
The segments of the display are controlled via digital pins 2 to 8 of the
Arduino. Each pin corresponds to a specific segment (A-G and the decimal
point).
The common pins (1-4) for each digit are connected to digital pins 9 to 12,
allowing multiplexing to display all digits in quick succession.
2. Push Buttons:
Each button is connected to an analog input pin (A0, A1, and A2) with
internal pull-up resistors enabled.
The Arduino detects button presses by checking for LOW signals on these
pins.
3. Buzzer:
o The passive buzzer is connected to digital pin 1. It is activated when a button is
pressed or when the countdown reaches zero.
4
Software Functionality
1. Initial State : For Display Test
The Arduino initializes all pins and sets the 7-segment display to indicate that the system is ready.
2. Setting the Countdown Timer:
Each presses of the SET button increments the timer value by one. The value rolls over to 0 if it
exceeds 9999.
3. Starting the Countdown:
The START button begins with the countdown. The counter value decreases by one every second.
When it reaches zero, the buzzer sounds for one second, and the countdown stops.
4. Resetting the Timer:
Pressing the RESET button sets the counter to zero and halts any ongoing countdown.
Multiplexing for the 7-Segment Display
The Arduino uses multiplexing to control the 4-digit 7-segment display efficiently. Each digit is
enabled individually by setting its common pin HIGH (for common anode) while displaying the
corresponding number. This happens rapidly, creating the illusion of all digits being displayed
simultaneously.
Buzzer Operation
The passive buzzer is toggled HIGH to produce a sound:
During the button presses.
When the countdown reaches zero. The buzzer turns off after a predefined duration.
5
Connection:
Here, the blue number represents the Arduino pin number to which the connections are made. For
example, "129 " indicates that pin 12 (or the digit 1 pin) is connected to pin 9 of the Arduino Uno.
6
Arduino Code
#define aPin 2 // #define bPin
3 // _
#define cPin 4 // | A | #define
dPin 5 // F| |B #define
ePin 6 // | G | #define
fPin 7 // E| |C #define
gPin 8 // D O dot
#define bt_upp A0
#define bt_down A1
#define bt_reset A2
int Common = 1; //<Common=1; for Common anode> <Common=0; for Common cathode> int On,
Off, Off_C;
int DTime = 4; // Display timer
// Setup function
void setup() { // Initialization setup pinMode(bt_upp,
INPUT_PULLUP); pinMode(bt_down, INPUT_PULLUP);
pinMode(bt_reset, INPUT_PULLUP);
pinMode(aPin, OUTPUT);
pinMode(bPin, OUTPUT);
pinMode(cPin, OUTPUT);
pinMode(dPin, OUTPUT);
pinMode(ePin, OUTPUT);
pinMode(fPin, OUTPUT);
pinMode(gPin, OUTPUT);
7
pinMode(c1Pin, OUTPUT);
pinMode(c2Pin, OUTPUT);
pinMode(c3Pin, OUTPUT);
pinMode(c4Pin, OUTPUT);
pinMode(buzzer, OUTPUT);
void loop() {
// Increment the counter when the up button is pressed if
(digitalRead(bt_upp) == LOW) {
digitalWrite(buzzer, HIGH); Counter++;
if (Counter > 10) Counter = 0;
delay(200);
}
8
}
showNumber(Counter % 10);
digitalWrite(c4Pin, Common);
delay(DTime); digitalWrite(c4Pin,
Off_C);
digitalWrite(buzzer, LOW);
}
9
digitalWrite(dPin,On); digitalWrite(ePin,
On); digitalWrite(fPin, Off);
digitalWrite(gPin, On);
}
void eight() {
10
digitalWrite(aPin, On);
digitalWrite(bPin, On);
digitalWrite(cPin, On);
digitalWrite(dPin, On);
digitalWrite(ePin, On);
digitalWrite(fPin, On);
digitalWrite(gPin, On);
}
11
Simulation Implementation
The simulation of the countdown timer system demonstrates the seamless integration of hardware
and software functionalities to achieve a user-friendly interface for timing operations. The
initialization process effectively sets the system's readiness, with the 7-segment display providing a
visual cue. The timer setting mechanism ensures flexibility, allowing the user to incrementally
configure the countdown duration, with an intuitive rollover feature for values beyond the display
limit. The countdown initiation showcases the system's accuracy in decrementing the timer at one-
Second intervals, concluding with an audible buzzer alert to signal completion. Furthermore, the
reset functionality adds a layer of convenience, enabling users to quickly restart the timer or halt an
ongoing operation. The simulation validates the design's practicality and highlights the reliability of
the system in real-world scenarios.
12
Hardware Implementation
13
Result Analysis
The countdown timer system demonstrates reliable performance across all its functionalities, as
observed in the simulation. Upon initialization, the system properly sets up all pins and provides a
clear readiness indication through the 7-segment display, enhancing user interaction. The timer-
setting process operates smoothly, with each press of the SET button accurately increasing the
value, and the rollover mechanism functioning as expected when exceeding the maximum limit.
The countdown operation is precise, with consistent one-second intervals between decrements and
a clear buzzer signal marking the end of the countdown. The reset feature effectively clears the
timer and halts any ongoing operation, providing convenience and flexibility. These results validate
the system's design and highlight its potential for practical applications, ensuring user satisfaction
and reliability.
Discussion
The Arduino-based countdown timer project highlights the integration of microcontroller
programming with hardware components. The use of a 7-segment display demonstrates effective
multiplexing techniques, enabling efficient control of multiple digits using limited I/O pins. By
incorporating user interaction through push buttons and providing audio feedback via a buzzer, the
project creates a user-friendly interface.
This project serves as an excellent introduction to embedded systems, offering insights into real-
time control, button debouncing, and display management. The modular design ensures that the
system can be easily modified or scaled for additional features, such as adjustable countdown
speeds, alternative display types, or wireless control.
Despite its simplicity, the project showcases practical engineering concepts and highlights the
versatility of Arduino as a development platform.
Limitations
Limited Countdown Range: The maximum countdown value is restricted to 9999 seconds
(approximately 2 hours and 46 minutes), which may not be sufficient for certain applications.
Button Debouncing: The code does not explicitly handle button debouncing, which could result in
unintended multiple inputs if buttons are pressed too quickly.
Fixed Countdown Speed: The countdown decrement interval is fixed at one second, reducing
flexibility for applications requiring faster or slower countdown speeds.
No Power Backup: The timer resets to zero when power is lost, as no non-volatile memory storage
is implemented to save the countdown state.
14
Limited Feedback: The buzzer provides basic audio feedback, but there is no visual indicator for
button presses or countdown completion beyond the display.
References :
https://projecthub.arduino.cc/SAnwandter1/programming-4-digit-7-segment-led-
display-5c4617
https://circuitdigest.com/microcontroller-projects/interfacing-seven-segment-display-
with
https://projecthub.arduino.cc/stannano/one-digit-7-segment-led-display-819bcd
https://lastminuteengineers.com/seven-segment-arduino-tutorial/
15