0% found this document useful (0 votes)
9 views10 pages

Lab Report

The document presents a lab report for a project titled 'Digital Alarm Clock' developed by a group of students at the University of Poonch Rawalakot. It details the design and implementation using an Arduino Uno, RTC module, LCD display, and buzzer, highlighting the integration of hardware and software for a functional alarm clock. The report also discusses challenges faced, results achieved, and future improvements such as adding temperature display and multiple alarms.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views10 pages

Lab Report

The document presents a lab report for a project titled 'Digital Alarm Clock' developed by a group of students at the University of Poonch Rawalakot. It details the design and implementation using an Arduino Uno, RTC module, LCD display, and buzzer, highlighting the integration of hardware and software for a functional alarm clock. The report also discusses challenges faced, results achieved, and future improvements such as adding temperature display and multiple alarms.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

UNIVERSITY OF POONCH RAWLAKOT

(Faculty of Engineering and technology & department of


Biomedical Engineering technology)

LAB REPORT

• Course title: Digital Logic design


• Course code: BIT-214
• Submitted to: Waqqas Qayyum
• Project title: Digital Alarm Clock
• Group# 05
• Submitted by: 2023-BMET-36
2023-BMET-33
2023-BMET-21
2023-BMET-31
2023-BMET-13
Project Report: Digital Alarm Clock

Title: Design and Implementation of a Digital Alarm Clock

Abstract:
This project presents the design and implementation of a digital alarm clock using a
microcontroller, an LCD display, a buzzer, and input buttons for time setting and alarm
configuration. The clock displays real-time in hours, minutes, and seconds, and allows
users to set an alarm that triggers a buzzer at the specified time. The system is built using
an Arduino Uno, a real-time clock (RTC) module for accurate timekeeping, and push
buttons for user interaction. The project demonstrates the integration of hardware and
software to create a functional and user-friendly alarm clock.

Introduction:
A digital alarm clock is an essential electronic device used in daily life to keep track of time
and provide alarm functionality. This project aims to develop a simple yet effective digital
alarm clock using readily available components. The system includes:

Microcontroller (Arduino Uno) :Processes time data and controls the display and alarm.

RTC (DS3231 Module) – Provides accurate timekeeping.

LCD Display (16x2)– Shows the current time and alarm settings.

Buzzer – Sounds when the alarm is triggered.

Push Buttons – Used to set time and alarm.


____________________________________________________________________________________

Literature Review
Digital alarm clocks have evolved from mechanical clocks to modern microcontroller-
based systems. Previous implementations include:

Basic LCD-based clocks using 8051 or AVR microcontrollers.

RTC-based clocks for improved accuracy over software-based timing.

Smart alarm clocks with additional features like temperature display and lot integration.

____________________________________________________________________________________

Our Contribution
● Title

Design and Implementation of a Digital Alarm Clock

●Component Requirements

| Aurduino board(aurduino uno)

LCD(1602)

Push button(for setting alarming time)

Buzzer( for alarming sound)

● Working Principle

- The RTC module keeps track of time independently of the Arduino.

- The Arduino reads time data from the RTC and displays it on the LCD.

- Buttons adjust hours, minutes, and alarm settings.

- When the set alarm time matches the current time, the buzzer activates.

● Software Implementation

The Arduino code:

- Initializes the LCD and RTC.

- Reads button inputs to adjust time and alarm.


- Compares current time with alarm time to trigger the buzzer.

#include <LiquidCrystal.h>

// LCD pins: (RS, E, D4, D5, D6, D7)

LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

// Buttons

const int btnHour = 8;

const int btnMinute = 9;

const int btnToggle = 10;

// Buzzer

const int buzzerPin = 11;

// LCD contrast PWM pin

const int contrastPin = 12; // PWM capable pin

// Time variables

int hour = 12, minute = 0;

int alarmHour = 7, alarmMinute = 0;

// Timekeeping

unsigned long previousMillis = 0;

const unsigned long interval = 60000;

// Mode
bool settingAlarm = false;

// Debounce

unsigned long lastButtonPress = 0;

const int debounceDelay = 200;

void setup() {

// Set contrast via PWM (range 0-255)

analogWrite(contrastPin, 80); // Adjust value for visibility

lcd.begin(16, 2);

pinMode(btnHour, INPUT_PULLUP);

pinMode(btnMinute, INPUT_PULLUP);

pinMode(btnToggle, INPUT_PULLUP);

pinMode(buzzerPin, OUTPUT);

lcd.setCursor(0, 0);

lcd.print("Digital Clock");

delay(1500);

lcd.clear();

void loop() {

unsigned long currentMillis = millis();


// Time update

if (currentMillis - previousMillis >= interval) {

previousMillis = currentMillis;

incrementMinute();

// Button handling

if (millis() - lastButtonPress > debounceDelay) {

if (digitalRead(btnHour) == LOW) {

if (settingAlarm)

alarmHour = (alarmHour + 1) % 24;

else

hour = (hour + 1) % 24;

lastButtonPress = millis();

if (digitalRead(btnMinute) == LOW) {

if (settingAlarm)

alarmMinute = (alarmMinute + 1) % 60;

else

incrementMinute();

lastButtonPress = millis();

if (digitalRead(btnToggle) == LOW) {

settingAlarm = !settingAlarm;
lastButtonPress = millis();

// Display

lcd.setCursor(0, 0);

lcd.print("Time: ");

lcd.print(formatTime(hour, minute));

lcd.print(" ");

lcd.setCursor(0, 1);

lcd.print("Alarm: ");

lcd.print(formatTime(alarmHour, alarmMinute));

lcd.print(settingAlarm ? "*" : " ");

// Alarm logic

if (hour == alarmHour && minute == alarmMinute) {

digitalWrite(buzzerPin, HIGH);

} else {

digitalWrite(buzzerPin, LOW);

void incrementMinute() {

minute++;

if (minute >= 60) {


minute = 0;

hour = (hour + 1) % 24;

String formatTime(int h, int m) {

char buf[6];

sprintf(buf, "%02d:%02d", h, m);

return String(buf);

Proteus diagram:
● Hardware Implementation:

RTC module connected via I²C (A4-SDA, A5-SCL).

LCD interfaced in 4-bit mode.


Buttons connected to digital pins with pull-down resistors.

Buzzer connected to a PWM pin for sound control.

Results
- The digital clock successfully displays real-time on the LCD.

- The alarm triggers the buzzer at the set time.

- Buttons allow easy adjustment of time and alarm settings.

Challenges Faced:

- Initial synchronization issues with RTC (fixed by proper initialization).

- Button debouncing (resolved using software delays).

____________________________________________________________________________________

Conclusion and Future Work


This project successfully demonstrates a functional digital alarm clock using Arduino and
RTC. Future improvements include:

- Adding temperature display using the RTC’s built-in sensor.

- Implementing multiple alarms

- Integrating Wi-Fi for automatic time synchronization

References
1. Arduino Documentation. (https://www.arduino.cc/)

2. DS3231 Datasheet.

3. LiquidCrystal Library Guide.

You might also like