Você está na página 1de 36

A REPORT

ON

SMART OFFICE
Software Development for Embedded Systems (CS G523)
by

Abhijit Hota
---------------------------2008A7PS095G

BIRLA INSTITUTE OF TECHNOLOGY & SCIENCE, PILANI


April 2012
i

TABLE OF CONTENTS

Smart Office

UML

Use Case Diagrams

Class Diagrams

Statechart Diagrams

10

Activity Diagrams

13

Sequence Diagrams

18

Collaboration Diagrams

22

Component Diagrams

25

Deployment Diagrams

27

Code and Simulation

28

Bibliography

33

ii

SMART OFFICE
The idea behind a Smart Office is to come up with an innovative solution to automate the control of
various electrical equipment and devices for different functionalities in an office space with the use of
control systems and software. Such an office space eliminates human intervention to carry out certain
tasks and helps prevent wastage of electrical energy. The units are controlled by processors based on
the parameters that are constantly sensed and fed to the controller through sensors present in different
parts of the building. The sensors are used to either detect human activity or quantify environmental
factors.
The subsystems that come under the Smart Office are:

Entry System
Door System
Elevator System
Air-Conditioning System
Lighting System
Cube System
Lab Authentication System
Central Control System
Smoke Detector System
Parking Lot System

Entry System- This system deals with the authentication of employees with a valid ID card bearing the
encrypted magnetic strip/RFID. This system reads the data, extracts the ID and checks it against the
employee database for validity. If valid, it records the log in a record database. In case of a failure, it
raises a trespassing alarm.

Door System- Each of the doors in the building open automatically whenever the attached presence
sensor senses someone approaching. The doors are kept open during and for some time after sensing a
human presence. If they get no input, the doors are closed and the process is repeated.

Elevator System Requirements- The elevator in the building works as a normal elevator, except that it is
programmed to service to a requester floor only when there is someone present as the lift approaches

the floor. If not, it removes the request and continues without stopping at the floor. The person waiting
for the lift is detected with the help of presence sensors.
Air-conditioning system- The air-conditioners in each of the rooms of the building function
automatically depending on the occupancy state and the temperature of the room. The AC is activated
only when there are people inside the room. Once activated, the AC starts working to bring down the
temperature to a set value, and then stops. This process continues until it is deactivated in the case
when no one is present in the room anymore. The temperature sensor is used to evaluate the
temperature in the room and a presence sensor is used for sensing people in the room.

Lighting system- A big conference room (with a projector) may consist of more than one set of lights in a
series and the not all of them may be required based on the number of people in the room. This system
controls the number of lights to be switched on depending on the number of people present inside the
room. The people count is maintained by using a direction sensor installed in the doors of the room,
which senses the direction of human movement through it, and accordingly increments (inward
direction movement) or decrements (outward direction movement) the counter. The lights are switched
on or off depending on the state of the counter. Also, the lights just above the projector screen, if on,
are switched off temporarily whenever the projector is switched on to increase visibility of the screen. It
switches back on when the projector is switched off and those lights are required to be on depending on
the counter value. There is also an override button to switch on all lights of the room irrespective of the
state of occupancy.

Cube System- The equipment in a cube, like the cube lights, desktop etc. are powered on automatically
whenever an employee occupies his/her cube. They can be switched off by the employee manually
before leaving the cube or at any point of time.

Lab Authentication System- The labs provide access to only authorized people in the office. In this
system, there would be an ID card reader which reads the ID and checks it against the database of
authorized IDs. If matched, it unlocks the door for the person. The person passes through and the door
locks automatically when it closes. If there is a mismatch, a beeper is activated for some time.

Central Control- This system allows the administrator to control all the other systems.

Smoke Detector System- This system detects for any smoke caused by fire or short-circuits in the
building, and raises an alarm to alert the occupants. The alarm can be reset by the administrator when

the danger is averted. There are several smoke sensors attached in different parts of the building to
check for any emergency.
Parking Lot System- This system controls the parking gate of the parking lot based on the category of
person parking his/her car. There are 2 parking lanes in the building, one for the regular employees and
the other for the visitors. The person has to swipe his/her ID card while approaching the parking entry.
Depending on the ID encrypted in the card, the employee parking gate or the visitor parking gates
opens. It closes automatically after the car has passed though the gates. The exit gate of the parking lot
opens with the press of a button and closes automatically after the car passes by.

Unified Modelling Language (UML)


Unified Modeling Language

(UML) is one of the most useful tool in the process of system

development. It is a standardized general purpose modeling language in the field of object-oriented


software engineering. It enables system builders to create blueprints that capture the functionalities in a
standard, easy-to-understand way, and provides a mechanism to effectively share and communicate
these with others. It is the brainchild of Grady Booch, James Rumbaugh and Ivar Jacobson. The standard
was set by the Object Management Group in 1997.
The diagrams used as part of UML modeling fall into 3 categories, namely the Structure Diagrams, the
Behavior Diagrams and the Interaction Diagrams.
Structure Diagrams emphasize the things that must be present in the system being modeled. In other
words, these diagrams represent the structure of the system. Class diagrams, component diagrams and
deployment diagrams fall into this catrgory.
Behavior Diagrams emphasize what must happen in the system being modeled. They describe the
functionality of the system. This includes the use case diagrams, the state-chart diagrams and the
activity diagram.
Interaction Diagrams, a subset of behavior diagrams, emphasize the flow of control and data among the
things in the system being modeled. It encompasses the sequence diagram and the collaboration
diagram.
These diagrams are further explained in the next sections.

UML Diagrams
Use Case Diagrams
A use case illustrates a unit of functionality provided by the system. The main purpose of the use-case diagram is to
help visualize the functional requirements of a system, including the relationship of "actors" (human beings or external
entities who interact with the system) to essential processes, as well as the relationships among different use cases.
The Use-Case diagrams if the different systems of our Smart Office is given below.

Entry System

Air-Conditioning System

Light System

Cube System

Lab Authentication System

Door System

Elevator System

Central Control System

Smoke Detector System

Parking System

Class Diagrams
A class diagram is a type of static structure diagram that describes the structure of a system by showing the system's
classes, their attributes, operations (or methods), and the relationships among the classes
The Class Diagrams of the different systems of our Smart Office is given below.

Statechart Diagrams
The statechart diagram models different states that a system can be in and how that the transitions from state to state
take place.
The Statechart Diagrams of the different systems of our Smart Office is given below.

Entry System

Entry System

10

Door System

Air-Conditioning System

Light System

11

Cube System

Smoke Detector System

Parking Lot Entry System

Parking Lot Exit System

12

Activity Diagrams
Activity diagrams are graphical representations of workflows of stepwise activities with support for choice, iteration
and concurrency. They are used to describe the operational step-by-step workflows of components in a system.
The Activity Diagrams of the different systems of our Smart Office is given below.

Entry System

13

Door System

Air-Conditioning System

Smoke Detector System

14

Cube System

Light System

Lab System

15

Elevator System

16

Parking Lot Entry System

Parking Lot Exit System

17

Sequence Diagrams
Sequence diagrams show how processes operate with one another and in what order. They show the calls between
the different objects in their sequence and different calls to different objects.
The Sequence Diagrams of the different systems of our Smart Office is given below.

Entry System

Door System

18

Elevator System

Air-Conditioning System

19

Light System

Lab System

Cube System

20

Smoke Detector System

Parking System

21

Collaboration Diagrams
A collaboration diagram models the interactions between objects or parts in terms of sequenced messages. Messages
are labeled with a chronological number and placed near the link the message is sent over. It describes both the static
structure and dynamic behavior of a system.
The Collaboration Diagrams of the different systems of our Smart Office is given below.

Entry System

Door System

Cube System

Smoke System

22

Elevator System

Air Conditioning System

Lighting System

23

Lab System

Parking System

24

Component Diagrams
A component diagram provides a physical view of the system. Its purpose is to show the dependencies that the
components have on the other components in the system to form the whole system.
The Component Diagrams of the different systems of our Smart Office is given below.

Entry and Lab System

Elevator System

Other Systems

25

Parking Lot Entry System

Parking Lot Exit System

26

Deployment Diagrams
The deployment diagram shows how a system will be physically deployed in the hardware environment. Its purpose is
to show where the different components of the system will physically run and how they will communicate with each
other.
The Deployment Diagrams of the different systems of our Smart Office is given below.

AC, Light, Door & Cube System

27

Entry & Lab System

Elevator System

Cube System

Parking Lot Entry System

Parking Lot Exit System

28

Code and Simulation


The start screen of the
demonstration, which presents the
list of all the system to simulate.

1. Entry System

The above snapshots demonstrate the entry system. The left figure shows the case of a valid
entry where an employee enters by swiping his ID Card. He is granted entry and the activity is
successfully logged inside the database.
The left figure portrays the situation when an unauthorized person tries to enter the building.
An alarm is raised in this case to alert the administration.

2. Lab System

The above snapshots demonstrate the lab system. The left figure shows the case of valid entry
in which an employee enters by swiping his ID Card. He is granted entry.
29

The left figure portrays the situation when an unauthorized person tries to enter the building.
An alarm is raised in this case to alert the administration.

3. Cube System

The entry of employee into his cube is detected by the occupancy sensor and controls all the
cube equipment to turn on (if off).

4. Door System
The sensor detects the presence of an employee
and raises and event to the door controller. The
door opens and waits for some time till the
employee passes through it. The doors are
automatically closed if the sensor does not sense
any presence.

5. Air Conditioning System


The AC System tries to maintain the room
temperature within a fixed range. As soon as the
temperature increases above the threshold, the AC is
turned ON. And when the temperature decreases
below the minimum threshold, it is turned OFF. This
sequence of actions is repeated to maintain a
comfortable room temperature.

30

6. Light System

The light system controls lighting inside the rooms depending on the number of employees
present. In the above figure, only 5 employees are present, thus only 2 light bulbs are lit up.
In the figure shown below, there are 12 people inside the room, so all the 5 light bulbs are lit
up.

Also, there is a light bulb over the projector screen which should be switched off in case the
projector is switched on. This is represented in the figure below.

31

7. Parking System

The above snapshots show the demonstration of the parking system. The left figure shows the
case of an employee approaching the parking lot. He/she swipes his/her ID card and the
employee parking gate opens up. When the vehicle is passes through the door, detected by the
sensor, the doors are closed automatically.
The left figure shows the same scenario for a visitor entering the parking lot.

8. Smoke System

The smoke detector is always active in the sensing state. As soon as it detects smoke, it raises
the alarm.

32

9. Elevator System

The simulation for the elevator system is shown in the figure above. The entity labeled S
represent the sensors, which turns red when activated, and the buttons labeled F represent the
floor buttons. The lift is called to a floor whenever a floor button is pressed. On reaching the
floor, it checks whether the sensor senses a person (S is toggled ON represented by a red
colour). If yes, then it stops at that floor, the elevator doors open for the people to get in/out
and then starts to service the next requestor floor. The actions taken on stopping are shown in
the command prompt. If on reaching a requested floor, the sensor doesnt detect a person (S
button in green state), it removes the request by resetting the floor button and continues
without stopping at that floor. Multiple requests can be activated at a time and the algorithm
takes care of serving each of them.

33

BIBLIOGRAPHY

1. Real -Time Systems by C.M.Krishna & Kang G.Shin, McGraw-Hill International


Editions

2. UML for Real Design of Embedded Real-Time systems by Bran Selic

3. Real-Time UML: Advances In The UML For Real Time Systems (Third Edition)
by Bruce Powel Douglass, Addison Wesley (Pearson Education).

4. Java 2 Complete Reference (Fifth Edition) by Herbert Schildt, Tata McGraw Hill

34

Você também pode gostar