You are on page 1of 24

Digital Logic & Designing

Lab Project Report

On

Alarm Clock

In partial fulfillment
For the award of degree of

Bachelor of Technology

(Computer Science with AIML)

Submitted To: Submitted By:


Sagar Kumar
Dr. Sandhya Sharma Pushkar Lal
SID : 2347469
(Professor) 23182016

(II Year, III Semester)

Department of Computer Science and Engineering & Information


Technology
1
INDEX

Declaration .................................................... 3

Certificate ...................................................... 4

Acknowledgement ......................................... 5

Abstract ........................................................ 6

Table of Contents ..........................................8

Introduction .................................................. 9

Theory........................................................ 11

Conclusion .................................................. 23

Reference ..................................................... 24

2
DECLARATION

I declare that my 3rd semester report entitled ‘Alarm Clock’ is


my own work conducted under supervision of Dr. Sandhya
Sharma.

I further declare that to the best of our knowledge the report for
B. Tech 3rd Semester does not contain part of the work which
has submitted for the award of B. Tech degree either in this or
any other university without proper citation.

Student’s sign Submitted to:

Dr. Sandhya Sharma (Professor)

3
CERTIFICATE

This is to certify that the project report entitled “Alarm Clock


".

Is a Bonafide report of the work carried by Sagar Kumar &


Pushkar Lal under guidance and supervision for the partial
fulfilment of degree of the B. Tech CSE at Suresh Gyan Vihar
University, Jaipur.

To the best of our knowledge and belief, this work embodies


the work of candidates themselves, has duly been completed,
fulfils the requirement of the ordinance relating to the bachelor
degree of the university and is up to the standard in respect of
content, presentation and language for being referred to the
examiner.

Dr. Sandhya Sharma. Mr. Sohit Agarwal

Professor HOD, CEIT

4
ACKNOWLEDGEMENT

Working in a good environment and motivation enhance the quality of


the work and I get it from my college through our Digital logic design
project . I have been permitted to take this golden opportunity under
the expert guidance of Dr. Sandhya Sharma from SGVU , Jaipur. I am
heartily thankful to her to make complete my project successfully. She
has given us her full experience and extra knowledge in practical field.
I am also thankful to my head of department Mr. Sohit Agarwal and all
CEIT staff to guide us. Finally, we think all the people who had directly
or indirectly help as to complete our project.

Student Name: Sagar Kumar (2347469)


Pushkar Lal (23182016)

5
ABSTRACT

LabVIEW is a graphical programming environment engineers


use to develop automated research, validation, and production
test systems. We have used labview to implement our alarm
clock project using state machine model. A state machine is
basically one of the fundamental architectures LabVIEW
developers frequently use to build applications quickly. State
Machine architecture can be used to implement complex
decision-making algorithms represented by state diagrams or
flow charts. Because of its advantages we have used it in our
project. A state machine reads a set of inputs and changes to a
different state based on those inputs. A state is a description of
the status of a system waiting to execute a transition. A
transition is a set of actions to execute when a condition is
fulfilled or an event received. State machines revolve around
three concepts: the state, the event, and the action . It help us
identify meaningful states, events, and actions in your
programming. Major mistakes programmers make when
working with state machines is not defining appropriate states.
There are a number of instances where a state machine can be
used in LabVIEW programming. The ability to make a program
6
respond intelligently to a stimulus is the most powerful aspect
of using state machines. The program no longer needs to be
linear. The program can begin execution in a specified order,
then choose the next section of code to execute based on the
inputs or results of the current execution. This can allow the
program to perform error handling, user-selected testing,
conditional-based execution, and many other variations. If the
programmer does not always want the code to be executed in
the same order for the same number of iterations, a state
machine should be considered.

An example of when a state machine is useful to a programmer


is in describing the response to a communications line.

7
TABLE OF CONTENTS

❖ Introduction

❖ Objective

❖ Theory

❖ Applications

❖ Future Work

❖ Conclusion

8
INTRODUCTION

An Alarm Clock may be defined as a system which is used to


alert an individual at a particular time. This a simple alarm
clock that lets displays the time and date. It also lets you set an
alarm and lights an LED when it rings.

Our aim here is to understand the state machine and implement


it using alarm clock. We have used event structure, while loop
, case structure etc. State machines consists of a case structure
contained in a while loop. The first state executed is determined
by the input to the case selector. User input or in-state
calculations determines which state to transition to next. The
transition to the next state to execute is controlled through the

The state machine has the advantage of allowing several steps


to be linked in series so that each individual step can be
executed (or debugged) easily. The trap for the inexperienced
programmer is the use of the state machine to step in a
haphazard fashion through the cases in the loop.

9
Objectives

The following objectives are likely to be focused and achieved


at the end of the project.

1) To make the model of alarm clock using less resources.

2) To study the state machine model and implement it on


labview.

3) To understand the structure and inside details of how loops


work through various stages and ensure smooth switching
between different cases.

10
Theory
 Go to the "Front Panel" and press "Right Click" from your
personal computer or laptop.

 Each state in a State Machine does something


unique and calls other states. State communication
depends on some condition or sequence. To
translate the state diagram into a LabVIEW
programming architecture, you need the following
infrastructure:
 While Loop – continually executes the various states
 Case Structure – each case contains code to
beexecuted for each state

11
 Shift Register – contains state transition information
 Transition code – determines the next state in the
sequence
 Now, go to the Functions-> Structures-> while loop.
 Add the stop Boolean in while stop point.
 By doing this, you can set the true false for while loop.

 Now, go to the Functions-> Structures-> case structure.


 Case structure is used to seamlessly divide and connect
between different states.
 “set alarm” , “ display time , Default”, “ Turn alarm on”,
“compare” are the events in case structure.
 Now we have used format date/time string.
 And connected it with string in hour minute and sec
to get the real date and time and connect it with case
structure.

12
“Event structure”

 You can configure a single event case to handle


multiple events, but only one of these events within
the event case can occur at a time. You must place
the Event structure in a While loop to handle multiple
events.

Inside it include hour and minute strings and connect


it to the shift register.

Outside the event structure create hour and minute


buttons and set it to be visible so that they are shown on
front panel.

13
 “compare” case connections-
 Get the timing functions get date/time in sec
 Compare the hour and minute entered through real
time and give the two as inputs to and gate. if true go
to turn alarm on and if false go to compare case.
 For compare icon go to functionscomparisonequal.
 For and gate go to functionsbooleanAND

14
 “display time/default” case connections
 Create the stop button, hour and minute button to be
visible on front panel.
 Now hide the controls by connecting it with false constant.
 Also reinitialize the hour and minute to default.
 Give the set alarm as condition to select
(functions comparison select)
 Connect the true side with set alarm case and the false
side with display time case.

15
“turn alarm on “connections -
 Select the select (functions comparison Select) and connect
the true side with display time case and false side with turn
alarm on case.
 Now we have to put an LED in the "Front Panel" for the
alarm on indication.
 Press "Right Click" on the "Front Panel"
 Go to the Controls-> Modern-> Boolean-> round LED
 The figure below shows all of the above steps.

16
 Now we have to put a beep sound when alarm is on and
led lights in the "Front Panel".
 Go to the FunctionsGraphics and sound Beep.vi

17
WORKING

Steps to Implement or Execute Code

Run the application


If you want to set the alarm, press the 'Set Alarm'
button.
Enter the 'Hour' and 'Minute' for the alarm settings.
When the alarm is on, a 'Beep' sound will
continuously be on.
Press the 'Stop Alarm' to stop it.
Press the 'Stop' button to terminate the
application.

Front panel

18
Execution of project on front panel

19
20
Applications

Alarm Clock can be used by connecting it with various

apps with different alarms for different purposes. It can be

used for various purposes.

 We can monitor activity status by alarm clock ringing


time.
 We can use it when we do not have a physical clock
nearby.
 We can use this in fire alarm systems.

 We can also implement the program with our phone in


reminder tasks.

21
Future Work

In future, we want upgrade this circuit and include other

functions of clock such as timer, display time and with

Arduino implement it. As a result the future circuit is not

very cheaper the present one, but we try our best.

 Easy to use

 Easy to install

 To make Available

 Make it simple

 Easy for maintenance and upgrade

22
CONCLUSION

The Alarm Clock employs a simple mechanism to detect


present time and compare with the alarm time and lights the
LED when it matches. It has various uses and low cost to
implement it on labview. State machine pattern provides
smooth connection and avoid entanglements of wires and
connections. It gives a clear flow of steps and distribute the
correct functioning to various cases. A State Machine is a
powerful programming structure that provides logical
branching to different operations. Use of a State Machine in
LabView is very advantageous because it can make
complicated programs easier to read and troubleshoot. In
addition, the use of Type Definitions (Type Defs) give
flexibility to expand and modify a VI with a minimal amount
of effort. A State Machine is almost always a better choice than
a (Stacked/Flat) Sequence structure because: A State Machine
allows decisions to change the program flow. The execution of
a Sequence is fixed. A State Machine allows specific window
of code to run more often than others. All code must run the
same in Sequence.

23
REFERENCE

http://www.unm.edu/~mph/500/Exercise12.pdf

https://www.ni.com/en-in/support/documentation/supplemental/16/simple-state-
machine-template-documentation.html

https://www.ni.com/docs/en-US/bundle/labview/page/lvhelp/labview_help.html

24

You might also like