Lab Report
Lab Report
LAB REPORT
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.
LCD Display (16x2)– Shows the current time and alarm settings.
Literature Review
Digital alarm clocks have evolved from mechanical clocks to modern microcontroller-
based systems. Previous implementations include:
Smart alarm clocks with additional features like temperature display and lot integration.
____________________________________________________________________________________
Our Contribution
● Title
●Component Requirements
LCD(1602)
● Working Principle
- The Arduino reads time data from the RTC and displays it on the LCD.
- When the set alarm time matches the current time, the buzzer activates.
● Software Implementation
#include <LiquidCrystal.h>
// Buttons
// Buzzer
// Time variables
// Timekeeping
// Mode
bool settingAlarm = false;
// Debounce
void setup() {
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() {
previousMillis = currentMillis;
incrementMinute();
// Button handling
if (digitalRead(btnHour) == LOW) {
if (settingAlarm)
else
lastButtonPress = millis();
if (digitalRead(btnMinute) == LOW) {
if (settingAlarm)
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));
// Alarm logic
digitalWrite(buzzerPin, HIGH);
} else {
digitalWrite(buzzerPin, LOW);
void incrementMinute() {
minute++;
char buf[6];
return String(buf);
Proteus diagram:
● Hardware Implementation:
Results
- The digital clock successfully displays real-time on the LCD.
Challenges Faced:
____________________________________________________________________________________
References
1. Arduino Documentation. (https://www.arduino.cc/)
2. DS3231 Datasheet.