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

Alarm Clock Project Report

This document is a project report for an alarm clock app created by Ms. Gangathade N.S. It includes an introduction that discusses the purpose and functionality of alarm clocks. It describes the prerequisites and file structure of the Python project, including importing necessary libraries like Tkinter, datetime, time, and winsound. It explains creating a GUI with Tkinter to allow the user to set the alarm time and playing a sound when the alarm time is reached.
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)
30 views15 pages

Alarm Clock Project Report

This document is a project report for an alarm clock app created by Ms. Gangathade N.S. It includes an introduction that discusses the purpose and functionality of alarm clocks. It describes the prerequisites and file structure of the Python project, including importing necessary libraries like Tkinter, datetime, time, and winsound. It explains creating a GUI with Tkinter to allow the user to set the alarm time and playing a sound when the alarm time is reached.
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

`

A
Project Report

On

“Alarm Clock ”
Submitted & Presented in the partial fulfillment of the requirement for the
award on
Diploma in Computer Engineering
By

Ms. Gangathade Nikita Satish (1915230024)


Under the Guidance of
[Link] V.S.

Department of Computer Engineering


NEW SATARA COLLEGE OF ENGINEERING &
MANAGEMENT (POLY.), KORTI-PANDHARPUR.
AY: 2021-2022
DEPARTMENT OF COMPUTER ENGINEERING NEW SATARA
COLLEGE OF ENGINEERING AND MANAGMENT,
KORTI PANDHARPUR

CERTIFICATE

This is to certify that the project report “Alarm Clock ” has been presented of Computer
Engineering by, Ms. Gangathade N.S., students of T.Y COMPUTER in the partial fulfillment for the
award of Diploma in Computer Engineering as per curriculum laid by the
Maharashtra State Board of Technical Education, MUMBAI during the academic year 2021-2022

Project guide H.O.D Principal


(Prof. (Kshirsagar V.S..) (Prof..Puri.S.B) (Prof. Londhe V.H.)
DECLARATION

We hereby declare that, Dissertation entitled “Alarm Clock” is completed and submitted for the award of
Diploma Engineering in Computer Engineering branch, of New Satara College of Engineering And
Management (Poly.),Korti, Pandharpur. It has not been previously presented and to the best of my
knowledge, for the award of diploma engineering title of this or any other university or examination body.

PLACE: - KORTI, PANDHARPUR

DATE:-

GROUP MEMBER NAME:-

Ms. Gangathade N.S.


ACKNOWLEDGEMENT

We feel happiness in forwarding this project design report as an image of sincere efforts the
successful design report reflects efforts of our guide in giving us good information.

Our sincere thanks to our guide Prof. Kshirsagar. V.S.., Who has been a constant source of
inspiration and guiding star in achieving our goal. We give our special thanks to Prof. Puri S.B. head of
computer department for providing encouragement and all facilities required for completion of work. We
express our deep gratitude to all staff members who lend us their valuable support and co-operation.

We are also equally indebted to our principal for his valuable help whenever needed. At last we thank
all those who directly or indirectly encouraged and helped us.

[Link] N.S

.
ABSTRACT
 
Alarm clocks are a common fixture in almost all houses and it plays a vital role in determining a person's
state of mind for the rest of the day. The Smart Alarm is a fully integrated alarm clock that will help the user
to wake up in the morning with lights that gradually increase in brightness and the user's favorite music or a
default beeping tone when the brightness has reached its maximum. There is an additional feature that
generates a tantalizing coffee aroma for waking up the person in a relatively pleasant environment. Weather
forecast and reminders will also be displayed in the clock. The sunrise simulation, aroma generation, weather
forecast and news display will be done using Arduino Uno [Link] less

An alarm clock (or sometimes just an alarm) is a clock that is designed to alert an individual or group of
individuals at a specified time. The primary function of these clocks is to awaken people from their night’s
sleep or short naps; they are sometimes used for other reminders as well. Most use sound; some use light or
vibration. Some have sensors to identify when a person is in a light stage of sleep, in order to avoid waking
someone who is deeply asleep, which causes tiredness, even if the person has had adequate sleep. To turn off
the sound or light, a button or handle on the clock is pressed; most clocks automatically turn off the alarm if
left unattended long enough. A classic analog alarm clock has an extra hand or inset dial that is used to
specify the time at which the alarm will ring. Alarm clocks are also used in mobile phones, watches, and
computers.
INTRODUCTION

Alarm Clock is no doubt that an alarm clock is always handy to alert us whenever we sleep, take a short
nap, or to remind us about the work, we always get oblivious about.

Our ancestors have been using an alarm clock, going back to its 2,000 years long history but over time, the
new advancements in technologies allow us to keep an alarm clock without it containing a dial, gear trains,
etc. How? Let’s find out further.

The objective of our project is to implement an alarm clock using Python. Python consists of some very
innovative libraries such as datetime and tkinter which help us to build the project using the current date and
time as well as to provide a user interface to set the alarm according to the requirement in 24-hour format.
 Prerequisites

This project requires good knowledge of Python and GUI (Graphic User Interface). Python when
combined with Tkinter provides a fast and easy way to create GUI applications. Tkinter provides a powerful
object-oriented interface to the Tk GUI toolkit. All the modules used need not be downloaded beforehand
like the other libraries like NumPy, thus this project will be user friendly and accessible in any virtual
environment used for python programming.

A Python Alarm Clock Script consists of very useful libraries such as datetime and tkinter which help us to
build project using the current date and time. Apart from this, they provide a user interface to set the alarm
according to the requirement in 24-hour format.

To develop this python project, you need basic knowledge of the Python language and Tkinter library. We
are going to need the following libraries:

 Tkinter:  For the creation of the

 GUIDatetime:  To get the current date and time from the

 systemTime:  To suspend the execution of the program for some

 timeWinsound:  To play a sound on the computer


 Project File Structure

1. First, we import all the necessary libraries and modules:


#Importing all the necessary libraries to form the alarm clock:
from tkinter import *
import datetime
import time
import winsound

 Explanation:

 Tkinter module belongs to a standard library of GUI in Python. It helps us to create a


dialog box with any information that we want to provide or get from the users.

 Datetime and time modules in python help us to work with the dates and time of the
current day when the user is operating python and to manipulate it too.

 Winsound module provides access to the basic sound playing machinery provided by


Windows platforms. This is useful to generate the sound immediately when a function
is called

[Link] a while loop:


def alarm(set_alarm_timer):
while True:
[Link](1)
current_time = [Link]()
now = current_time.strftime("%H:%M:%S")
date = current_time.strftime("%d/%m/%Y")
print("The Set Date is:",date)
print(now)
if now == set_alarm_timer:
print("Time to Wake up")
[Link]("[Link]",winsound.SND_ASYNC)
break
def actual_time():
set_alarm_timer = f"{[Link]()}:{[Link]()}:{[Link]()}"
alarm(set_alarm_timer)

 Explanation:

 Define a function named as alarm() which takes the argument of (set_alarm_timer).It


contains a while loop with a Boolean function True which makes the program automatic
to work

 [Link](1) halts the execution of the further commands given until we get the time
value from the user later in the code and returns the background thread of the clock time
going on at a regular interval.

 Get the current time using current_time which takes the argument


of [Link]().

 now is used to print the time and date is used to print the current date by string
conversion using strftime().

 Define another function here named actual_time() which takes in the user value for setting
the alarm in the string format. The same argument of (set_alarm_timer) as alarm before to
execute the while loop which we further use while making GUI

 If loop suggests that if the user input time set_alarm_timer matches with the while loop
ongoing time now, the message is printed as” Time to Wake up”.

 winsound.SND_ASYNC plays the system generated sound as soon the condition satisfies,


acting as a reminder for the alarm clock.
3. Creating GUI using tkinter:
clock = Tk()

[Link]("DataFlair Alarm Clock")


[Link]("400x200")
time_format=Label(clock, text= "Enter time in 24 hour format!", fog="red",bg="black",font="Arial").place(x=60,y=120)
addTime = Label(clock,text = "Hour Min Sec",font=60).place(x = 110)
setYourAlarm = Label(clock,text = "When to wake you up",fg="blue",relief = "solid",font=("Helevetica",7,"bold")).place(x=0,
y=29)

# The Variables we require to set the alarm(initialization):


hour = StringVar()
min = StringVar()
sec = StringVar()

#Time required to set the alarm clock:


hourTime= Entry(clock,textvariable = hour,bg = "pink",width = 15).place(x=110,y=30)
minTime= Entry(clock,textvariable = min,bg = "pink",width = 15).place(x=150,y=30)
secTime = Entry(clock,textvariable = sec,bg = "pink",width = 15).place(x=200,y=30)

#To take the time input by user:


submit = Button(clock,text = "Set Alarm",fg="red",width = 10,command = actual_time).place(x =110,y=70)

[Link]()
#Execution of the window.

 Explanation:

 To Initialize tkinter, we pass a command under the name clock as Tk().

 The dialog box has the title as DataFlair Alarm Clock with a geometry of (400*200). We
pass on the heading to mention the time format for 24 hours using time_format.

 The second heading is given above the user input boxes for the labeling to be “Hour Min
Sec” using addTime

 Justto make the dialog box look funkier, adding another label as “when to wake you up”
using setYourAlarm.
 Aswe have already converted the current time in the string before (actual time), the
variables we initialize for the user input dialog boxes are in StringVar().

 Finallymake the input boxes such as hourTime, minTime, and secTime which takes the


entry of the time the user wants to set the alarm on in 24-hour format.

 Submit takes the command of the defined function actual_time and executes the clock as
it acts as a set button to start the program.

 [Link]() is
the basic and the last command was given to compile all the previous
commands with their basic settings of color, font, width, axis, etc. and displays the
window as soon as the program is run.
 Code

#Importing all the necessary libraries to form the alarm clock:


from tkinter import *
import datetime
import time
import winsound
 
 
 
def alarm(set_alarm_timer):
    while True:
        [Link](1)
        current_time = [Link]()
        now = current_time.strftime("%H:%M:%S")
        date = current_time.strftime("%d/%m/%Y")
        print("The Set Date is:",date)
        print(now)
        if now == set_alarm_timer:
            print("Time to Wake up")
            [Link]("sound.mp3",winsound.SND_ASYNC)
            break
def actual_time():
    set_alarm_timer = f"{[Link]()}:{[Link]()}:{[Link]()}"
    alarm(set_alarm_timer)
 
clock = Tk()
[Link]("DataFlair Alarm Clock")
[Link]("400x200")
time_format=Label(clock, text= "Enter time in 24 hour format!",
fg="red",bg="black",font="Arial").place(x=60,y=120)
addTime = Label(clock,text = "Hour  Min   Sec",font=60).place(x = 110)
setYourAlarm = Label(clock,text = "When to wake you up",fg="blue",relief =
"solid",font=("Helevetica",7,"bold")).place(x=0, y=29)
 
# The Variables we require to set the alarm(initialization):
hour = StringVar()
min = StringVar()
sec = StringVar()
 
#Time required to set the alarm clock:
hourTime= Entry(clock,textvariable = hour,bg = "pink",width =
15).place(x=110,y=30)
minTime= Entry(clock,textvariable = min,bg = "pink",width =
15).place(x=150,y=30)
secTime = Entry(clock,textvariable = sec,bg = "pink",width =
15).place(x=200,y=30)
 
#To take the time input by user:
submit = Button(clock,text = "Set Alarm",fg="red",width = 10,command =
actual_time).place(x =110,y=70)
 
[Link]()
#Execution of the window.
 

 
 Output

Common questions

Powered by AI

The user interface for the Python alarm clock using tkinter involves creating a basic window titled "DataFlair Alarm Clock" with dimensions 400x200. Input fields are constructed using Entry widgets for hours, minutes, and seconds, each linked to StringVar variables to capture user inputs. Labels are added for directions, such as time format and placeholder text, enhancing the user experience. The submit button executes the command defined by the actual_time function, which processes the collected inputs to set the alarm. Tkinter’s methods allow for seamless integration of these components to produce a functional GUI for alarm time configuration .

The datetime and tkinter libraries play crucial roles in the development of the Python-based alarm clock. The datetime library is used to accurately track and manipulate current time and date, which is essential for triggering the alarm at the correct moment. Tkinter, as a GUI toolkit, provides the necessary tools to create a user-friendly interface where users can input the alarm time and interact with the system. Tkinter’s widgets facilitate the creation of input fields and buttons, allowing users to set the alarm easily and start the program interface .

The function actual_time() facilitates the alarm operation by consolidating and executing user inputs into a set time format that aligns with ongoing system time checks. Upon execution, this function retrieves the user-set alarm time from input fields, formats it in a 24-hour string format, and then calls the alarm() function. This integration allows for an event-driven triggering mechanism wherein the input time is continuously compared with the current time. When the two match, the alarm logic prompts the system to execute a sound alert, ensuring an accurate and timely wake-up process .

Key differences between traditional analog and modern digital alarm clocks include their functionality and user interface. Analog clocks typically use mechanical components, such as gears and dials, to set alarm times, while digital clocks incorporate electronic components like microcontrollers for more complex features, including sound, light, and vibrations. Modern digital clocks, like the Smart Alarm, offer customizable features such as music selection, gradual brightness increase, and sensory feedback like aroma generation, which are not possible with analog designs. Digital clocks often benefit from additional functionalities, like integration with other digital devices for displaying notifications .

The Smart Alarm enhances the user's wake-up experience by incorporating multi-sensory stimuli such as gradual light brightness and aroma generation, creating a more natural and pleasant wake-up environment. These features, combined with the option to wake up to preferred music, ensure a smoother transition from sleep to wakefulness, potentially improving mood and decreasing grogginess compared to the abrupt noises of standard alarms. The additional functionality, such as displaying weather forecasts and reminders, enhances convenience by allowing users to start planning their day immediately upon waking .

The Python project file structure supports development by organizing components into a logical sequence. It starts with importing necessary libraries like datetime, tkinter, and winsound, establishing the foundational tools for time manipulation, GUI creation, and sound functions. The structure includes defining functions like alarm() and actual_time(), which manage the alarm logic, including time comparison and triggering sound alerts. User interface components are structured to handle input and interaction through widgets and event handlers, integrating seamlessly with the backend logic in the loop and function definitions, facilitating efficient development and execution .

The Arduino Uno R3 enhances the functionality of the Smart Alarm by providing a flexible and programmable platform that can easily integrate various sensors and modules. This allows for the control of lights, generation of aroma, and display of information like weather forecasts. Its open-source nature and ease of programming make it suitable for implementing features that rely on varying inputs, such as the gradual light increase and ability to interface with other components efficiently to provide a synchronized alarm clock experience .

The winsound module is critical in the Python alarm clock for generating sound alerts on Windows platforms. It is integrated into the project to play a sound file when the alarm time matches the current time, thereby notifying the user to wake up. This module is invoked using the winsound.PlaySound() function, with parameters for the sound file and mode, like winsound.SND_ASYNC, ensuring the sound plays asynchronously, enabling uninterrupted program execution while the alert sound plays .

Prerequisites for developing the Python alarm clock include a strong understanding of Python programming and GUI development using Tkinter. Python knowledge allows the developer to write efficient code for time manipulation and sound execution, while understanding Tkinter is crucial for creating a user-friendly interface. Familiarity with libraries like datetime and winsound is necessary to implement time functions and audio alerts. These skills ensure the project is user-friendly, robust, and functional, leading to a successful implementation that meets user needs for an effective alarm clock .

The Smart Alarm incorporates several unique features such as gradual light increase, personalized music, aroma generation, and display of weather forecasts and reminders. The gradual increase in brightness helps ease users into wakefulness, reducing morning grogginess, while the user’s preferred music adds a personalized touch. The aroma feature creates a pleasant waking environment by generating a coffee scent, which can have an invigorating effect. Finally, the inclusion of weather forecasts and reminders on the display serves as a practical addition, offering users relevant information to start their day efficiently .

You might also like