0% found this document useful (0 votes)
39 views15 pages

Group E-Arduino 4-Digit 7-Segment Display Countdown Timer With Passive Buzzer

The project report details the design and implementation of a countdown timer using an Arduino Uno and a 4-digit 7-segment display, featuring user interaction through push buttons and a passive buzzer for alerts. The system effectively demonstrates multiplexing techniques and provides a user-friendly interface for setting and resetting the timer. Limitations include a fixed countdown range, lack of button debouncing, and no power backup for the timer state.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views15 pages

Group E-Arduino 4-Digit 7-Segment Display Countdown Timer With Passive Buzzer

The project report details the design and implementation of a countdown timer using an Arduino Uno and a 4-digit 7-segment display, featuring user interaction through push buttons and a passive buzzer for alerts. The system effectively demonstrates multiplexing techniques and provides a user-friendly interface for setting and resetting the timer. Limitations include a fixed countdown range, lack of button debouncing, and no power backup for the timer state.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Project Report

Course Code: EEE-318

Course Title: Microprocessor and Interfacing Laboratory


Project Name: Arduino 4-digit 7 segment display countdown timer passive buzzer.

Group Members: 1. Student Name: MD. ABU HANIF


Student ID: 201001055
2. Student Name: Mahade Hasan
Student ID: 201001159
3. Student Name: Md Al Amin Khan
Student ID: 201001104
4. Student Name: Md Hasibul Islam Hasib
Student ID: 213001026

Submitted To: MOHAMMAD KAMROZZAMAN KIRON


Lab Lecturer, Department of EEE
Green University Of Bangladesh
Email:[email protected]
reen.edu.bd

Evaluation Remark:

1
Arduino 4-digit 7 segment display countdown
timer passive buzzer

Introduction

This project demonstrates the implementation of a 4-digit 7-segment display countdown


timer using an Arduino Uno microcontroller. The countdown timer includes user interaction
via push buttons for setting, starting, and resetting the timer. Additionally, a passive buzzer
provides audible feedback for operations and alerts the user when the countdown reaches
zero. Such a system is versatile and can be used in applications like kitchen timers, event
countdowns, or educational tools for learning embedded systems.

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

Buzzer Button Switch

Jumpers – Male to Male . Breadboard

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 c1Pin 9 // Common pin for digit 1 #define


c2Pin 10 // Common pin for digit 2 #define c3Pin 11 //
Common pin for digit 3 #define c4Pin 12 // Common
pin for digit 4

#define bt_upp A0
#define bt_down A1
#define bt_reset A2

#define buzzer 1 //buzzer at pin 1

long Counter = 0; int


timer = 0;
bool countdown = false;

int Common = 1; //<Common=1; for Common anode> <Common=0; for Common cathode> int On,
Off, Off_C;
int DTime = 4; // Display timer

// Function declarations for 7-segment display void one();


void two(); void
three(); void
four(); void five();
void six(); void
seven(); void
eight(); void
nine(); void zero();

// 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);

if (Common == 1) { On = 0; Off = 1; Off_C = 0; } // Common anode else { On


= 1; Off = 0; Off_C = 1; } // Common cathode

// Indicate that the system is ready for (int i =


2; i >= 0; i--) {
showNumber(i); digitalWrite(c1Pin,
Common); digitalWrite(c2Pin,
Common); digitalWrite(c3Pin,
Common); digitalWrite(c4Pin,
Common); delay(1000);
}
}

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);
}

// Start or stop countdown when the down button is pressed if


(digitalRead(bt_down) == LOW) {
digitalWrite(buzzer, HIGH); countdown =
true; // Start countdown delay(200);
}

// Reset the counter when the reset button is pressed if


(digitalRead(bt_reset) == LOW) {
digitalWrite(buzzer, HIGH); Counter = 0;
countdown = false; // Stop countdown delay(200);
}

// Handle countdown logic if


(countdown) {
Counter--;
if (Counter < 0) {
Counter = 0000; // Roll over to 0000
digitalWrite(buzzer, HIGH); // Buzzer sounds when countdown reaches zero delay(1000); // Buzzer
delay
digitalWrite(buzzer, LOW);
countdown = false; // Stop countdown after zero
}
delay(1000); // Countdown speed

8
}

// Display the current value of the counter


showNumber((Counter / 1000) % 10);
digitalWrite(c1Pin, Common);
delay(DTime); digitalWrite(c1Pin,
Off_C);

showNumber((Counter / 100) % 10);


digitalWrite(c2Pin, Common);
delay(DTime);
digitalWrite(c2Pin, Off_C);

showNumber((Counter / 10) % 10);


digitalWrite(c3Pin, Common);
delay(DTime); digitalWrite(c3Pin,
Off_C);

showNumber(Counter % 10);
digitalWrite(c4Pin, Common);
delay(DTime); digitalWrite(c4Pin,
Off_C);

digitalWrite(buzzer, LOW);
}

// Function to show a number on the 7-segment display void


showNumber(int x) {
switch (x) {
case 1: one(); break; case
2: two(); break; case 3:
three(); break; case 4:
four(); break; case 5: five();
break; case 6: six(); break;
case 7: seven(); break; case
8: eight(); break; case 9:
nine(); break; default:
zero(); break;
}
}

// 7-segment display functions void


one() {
digitalWrite(aPin, Off); digitalWrite(bPin,
On); digitalWrite(cPin, On);
digitalWrite(dPin, Off); digitalWrite(ePin,
Off); digitalWrite(fPin, Off);
digitalWrite(gPin, Off);
}

void two() { digitalWrite(aPin, On);


digitalWrite(bPin, On);
digitalWrite(cPin, Off);

9
digitalWrite(dPin,On); digitalWrite(ePin,
On); digitalWrite(fPin, Off);
digitalWrite(gPin, On);
}

void three() { digitalWrite(aPin,


On); digitalWrite(bPin, On);
digitalWrite(cPin, On);
digitalWrite(dPin, On);
digitalWrite(ePin, Off);
digitalWrite(fPin, Off);
digitalWrite(gPin, On);
}

void four() { digitalWrite(aPin,


Off); digitalWrite(bPin, On);
digitalWrite(cPin, On);
digitalWrite(dPin, Off);
digitalWrite(ePin, Off);
digitalWrite(fPin, On);
digitalWrite(gPin, On);
}

void five() { digitalWrite(aPin, On);


digitalWrite(bPin, Off);
digitalWrite(cPin, On);
digitalWrite(dPin, On);
digitalWrite(ePin, Off);
digitalWrite(fPin, On);
digitalWrite(gPin, On);
}

void six() { digitalWrite(aPin, On);


digitalWrite(bPin, Off);
digitalWrite(cPin, On);
digitalWrite(dPin, On);
digitalWrite(ePin, On);
digitalWrite(fPin, On);
digitalWrite(gPin, On);
}

void seven() { digitalWrite(aPin,


On); digitalWrite(bPin, On);
digitalWrite(cPin, On);
digitalWrite(dPin, Off);
digitalWrite(ePin, Off);
digitalWrite(fPin, Off);
digitalWrite(gPin, Off);
}

void eight() {

10
digitalWrite(aPin, On);
digitalWrite(bPin, On);
digitalWrite(cPin, On);
digitalWrite(dPin, On);
digitalWrite(ePin, On);
digitalWrite(fPin, On);
digitalWrite(gPin, On);
}

void nine() { digitalWrite(aPin, On);


digitalWrite(bPin, On);
digitalWrite(cPin, On);
digitalWrite(dPin, On);
digitalWrite(ePin, Off);
digitalWrite(fPin, On);
digitalWrite(gPin, On);
}

void zero() { digitalWrite(aPin, On);


digitalWrite(bPin, On);
digitalWrite(cPin, On);
digitalWrite(dPin, On);
digitalWrite(ePin, On);
digitalWrite(fPin, On);
digitalWrite(gPin, Off);
}

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

You might also like