You are on page 1of 24

U NIVERSITY OF B ARISAL

P ROJECT R EPORT

Smart Water Reserve System

Author: Supervisor:
Hasan Shahriar B ONI SamiranR OY

A Project Report submitted in fulfillment of the requirements


for the degree of Bechelor of Science
in the

Microcontroller Resarch Group


Computer Science and Engineering

December 16, 2017


iii

Declaration of Authorship
I, Hasan Shahriar B ONI, declare that this thesis titled, “Smart Water Reserve System”
and the work presented in it are not my own. I confirm that:

• This work was done wholly or mainly while in candidature for a research de-
gree at this University.

• Where any part of this report has previously been submitted for a degree or
any other qualification at this University or any other institution, this has been
clearly stated.

• Where I have consulted the published work of others, this is always clearly
attributed.

• Where I have quoted from the work of others, the source is always given. With
the exception of such quotations, this thesis is entirely my own work.

• I have acknowledged all main sources of help.

• Where the project report is based on work done by myself jointly with others, I
have made clear exactly what was done by others and what I have contributed
myself.

Signed:

Date:
v

“Thanks to my solid academic training, today I can write hundreds of words on virtually any
topic without possessing a shred of information, which is how I got a good job in journalism.”

Dave Barry
vii

UNIVERSITY OF BARISAL

Abstract
Science and Engineering
Computer Science and Engineering

Bechelor of Science

Smart Water Reserve System


by Hasan Shahriar B ONI

This is a simple electrical device and circuit project report. The project report is
based on a smart water reserve system. The system will be embedded with a tra-
ditional water reserve system and will make the system automated. The project is
aimed to develop an efficient, low cost smart water reserve system. The project is
implemented by a PIC16F887 microcontroller with additional programming.
ix

Acknowledgements
We are using this opportunity to express our gratitude to everyone who supported
us throughout this project. We have the deepestappreciation to them for providing
us the possibility to complete this project and report. Weare highly indebted to Sami-
ran Roy, our project supervisor for his guidance and constant supervision. We are
also thankful Imdadul Huq, Mr. Khalid bin Walid, and Ms. Bohnisikha Haldar for
their aspiring guidance, invaluably constructive criticism and friendly advice dur-
ing the project work. Weare sincerely grateful to them for sharing their truthful and
illuminating views on a number of issues related to the project. We would also like
to thank our family and friends who helped us a lot in finalizing this project within
the limited time frame.
xi

Contents

Declaration of Authorship iii

Abstract vii

Acknowledgements ix

1 Introduction 1
1.1 Problem Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Scope and Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Document Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2 Theory and Desing Method 3


2.1 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

3 Description and Desing 5


3.1 System Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2 Required Instrumets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.3 Simulated Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.4 Source code for Microcontroller . . . . . . . . . . . . . . . . . . . . . . . 6
3.5 Burning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4 Measured and Simulated Results 9


4.1 Simulated Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.2 Working Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5 Conclusion 11

Bibliography 13
xiii

List of Figures

3.1 The system diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5


3.2 The simulated circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3 The burning process of Microcontroller. . . . . . . . . . . . . . . . . . . 8

4.1 The system diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9


4.2 The Working Cuitcuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
xv

List of Abbreviations

RAM Random Access Memory


ROM Read Only Memory
IDE Intigrated Development Environment
IC Intigrated Circuit
xvii

List of Symbols

a distance m
P power W (J s−1 )
ω angular frequency rad
xix

Dedicated to my parents
who inspired me all time
1

Chapter 1

Introduction

This is a project proposal for smart water reserve system. The smart water reserve
system is a automated system that controls the water reserve system, including the
water supply motor, with a microcontroller device. The proposed system starts to
fill the water of the tank by the supply motor automatically when the tank is empty
and stops the motor when the tank is full.

1.1 Problem Description


Water is an essential element for living purpose. In most city life, we obtain our
essential water from under earth resource and reserve in a water tank for further
use. For most of time we reserve our water tank by an electrical motor. The overall
process sounds like this, if the water reserve system is empty, which is we can assure
by checking the tank manually, we turn on the motor, let the tank fill and after a
certain period of time, we check the water tank and stop the tank. Though most of
time assume we do not check the tank, we just assume it by our timing sense that
the water tank is empty. But if the assumption is wrong, and most of time which
is, the water reserve system fills and overflow. This is a vast waste of time and
energy[Kelter, Wehren, and Niere, 2005].

1.2 Scope and Objectives


The main objective of the project is to introduce an automated water reserve system
and make the minimum wastage of time, money , energy and water. According to
an estimation, around 30 % of water coming from underground is wasting because
of manual water reserve system. This is a huge amount of wastage. The smart water
reserve system that the project is about is going to eradicate the most of the problem.
Though it’s a sample project, the future scope of the project is much bright [Firley
et al., 1999].

1.3 Document Overview


The first chapter gives a sample introduction to the problem and gives a short de-
scription of the aim of the project. The second chapter gives the theory of the project
and the descriptive and theatrical approach to solve the problem. The next chapter
shows how the system has been implemented in details. The next chapter is about
the result and output of the project. The final chapter has some limitation discussion
and suggestion for further improvement.
3

Chapter 2

Theory and Desing Method

2.1 Methodology
The water reserve system is going to be a smart system which will be controlled au-
tomatically. To control the water reserve system there is a lot of electrical device that
is going to work for us.But the project will be implemented by a PIC microcontroller.
There is a lot of reason to use that beautiful class of device.

1. Microcontrollers are special types of processor chips that are very small and
somewhat flexible, due to their programmable nature.
2. Since microcontrollers are fully integrated inside the processor, i.e., a “com-
puter on a chip,” these devices operate at faster speeds to execute instructions
compared to general purpose microprocessors.
3. Microcontrollers are cheap and very small in size, therefore they can be em-
bedded on any device.
4. Programming of Microcontrollers is simple to learn. Its not much complicated.
5. We can use simulators on Computers to see the practical results of our pro-
gram. Thus we can work on a Embedded project without even buying the
required Components and Chips. Thus we can virtually see the working of
our project or program.
6. As microcontrollers are fully integrated onto one chip, these devices are cheap
to manufacture. Usually, microcontrollers have much lower specifications than
low-power consumer-grade general-purpose microprocessors, making them
even easier to mass produce.
7. Once microcontrollers are programmed, typically they cannot be reprogrammed,
if microcontrollers are controlled by Read-Only Memory (ROM) only rather
than Random Access Memory (RAM) .
8. Many tasks can be performed by microcontrollers repetitively and human ef-
forts can be saved. The programmable nature of these devices also allows man-
ufacturing robots to reproduce these motions very quickly and consistently,
increasing productivity.
9. Size of a circuit can be reduced significantly - one microcontroller can replace
several other ICs.

Advantage of using microcontroller in this project:


4 Chapter 2. Theory and Desing Method

• Using a microcontroller to power the system makes the system more simple

• A microcontroller replace several ICs, thus making the project less complex

• One microcontroller has more then 40 ports, thus by programming one micro-
controller, many water reserve rank can be controlled

• Though the microcontroller in this project is just turning on and off the system,
it can be used to indicate the water level of the tank too.

• Most of all, for further development, the chip can be programmed again to
fulfill the future need, making the project more dynamic.

2.2 Implementation
The system is basically powered by a microcontroller. The system has 3 major part:

1. The water level indicator:The water level indicator is a major part of the sys-
tem. This part indicates the water level of the tank and thus generates two
signals. The device is mainly mechanical. It consist of an tiny path of water
and an empty inside cylinder. There is two switches on top and bottom of the
path. If the water tank is full, the cylinder will sink below and turn on the
lower switch. If the tank is full, it will float to upper side of the path and turn
on the upper switch, which indicates the tank is full [ Szlenk, 2006 ].

2. The working microcontroller:The microcontroller, here PIC16F887 is the main


components of the project. It will have 3 input signal and works as follow:

• If the water tank is empty, a signal will be generated and feeded to the
microcontroller
• The microcontroller will generate a signal to turn on the motor.
• After the motor will totally fill the tank, a signal will be generated and
again will be feed to the microcontroller.
• Again, after “Tank full” signal, the microcontroller will produce a stop
signal for the motor and the motor will be stop.
• This process will be automatically continue without any human interac-
tion.

3. The output of the IC is feeded to a relay connected with motor. The relay will
active in 5V and turn on the 220V AC motor.
5

Chapter 3

Description and Desing

3.1 System Diagram

F IGURE 3.1: The system diagram.

Figure 4.1 shows the required system diagram which we to make for our project.

3.2 Required Instrumets


Hardware:
1. A water tank

2. Empty Inside Cylinder

3. PIC16F887 Microcontroller

4. Microcontroller Programmer

5. 5V Relay

6. 7805 Voltage Regulator IC


Software:
6 Chapter 3. Description and Desing

1. A MicroC IDE for PIC microcontroller

2. Protieus Design Suit and simulator

3.3 Simulated Description

F IGURE 3.2: The simulated circuit.

Figure 3.2 shows the working circuit for the project.

3.4 Source code for Microcontroller


The main element of this project is its microcontroller and the microcontroller’s main
working fluid is its programming. A microcontroller is a programmable device that
can be programmed to do a task. Depending on the programming, a microcontroller
can virtually do all kind of task[ Kemeny and Snell, 1960 ]. A microcontroller can be
programmed by assembly language or by high level programming language such as
C. Though it is quit difficult to program a microcontroller in assembly, most of time
they are programmed in C then the code are converted into hex code. In this project
the microcontroller is programmed in C language [Wohlin et al., 2012]. The editor
used in this project is MicroC IDE. The code for the microcontroller is given bellow:
// m i c r o c o n t r o l l e r code i n C
void main ( ) {
i n t flag =0;
ANSEL = 0 ;
ANSELH = 0 ;
TRISA = 0xFF ;
3.5. Burning 7

TRISC=0 x00 ;
PORTC=0 x00 ;
while ( 1 )
{
i f (PORTA . RA0 == 1 )
{
i f (PORTA . RA1 == 1 )
{
flag =0;
}
e l s e i f (PORTA . RA2 == 1 )
{
flag =1;
}
i f (PORTA . RA1 == 1 && PORTA . RA2 == 1 )
flag =0;
i f ( f l a g ==0)
PORTC=0 x00 ;
else
PORTC=0 x01 ;
}
else
{
PORTC=0 x00 ;
flag =0;
}
}
}

3.5 Burning
Figure 3.3 shows the burining process of the Microcontroller.
8 Chapter 3. Description and Desing

F IGURE 3.3: The burning process of Microcontroller.


9

Chapter 4

Measured and Simulated Results

4.1 Simulated Result


The working circuit of the smart water reserve systemis first simulated by using a
simulation software. In this case, the software has been used is PROTIOUS.

F IGURE 4.1: The system diagram.

All the circuit components of the circuit has been connected properly including
the PIC16F887. The simulated result is exactly same as expected.

4.2 Working Circuit


The working circuit is connected in bread board exactly according to the circuit dia-
gram as 4.2:

The working circuit works exactly it was expected. In the working circuit if the
enable input is turned off, the other two input will have no effect in the circuit. If the
enable input in turned on, the system is alive. Now, if the on button is temporarily
turned on, the output will be high and the motor is turned on. If the off button is
pressed, the motor will be turn on. Any other condition like on=off=1 and on=off=0,
the motor will be still turned off [Ullah, Morisio, and Vetro, 2012].
10 Chapter 4. Measured and Simulated Results

F IGURE 4.2: The Working Cuitcuit.


11

Chapter 5

Conclusion

Though the water reserve system is quite impressive, it has several limitations as
follow:

• The water level indicator is mechanical, thus it is much error prone

• Though the microcontroller will work perfectly in the printed board, but if
there is any kind of situation to change the program of the microcontroller,
there will be a lot of hazard to do that.

• The motors functionality depends on a relay, which is also a mechanical device

There is many scope that can be improved further. Some of are:

• It is quite possible to handle many water reserve system by only one micro-
controller.

• If a water level indicator that can be used to indicate the exact level of the water
reserve system, it will be helpful tool for the user

• The microcontroller can be used to control the tank supply, such as hot water
and cold water.
13

Bibliography

Firley, Thomas et al. (1999). “Timed sequence diagrams and tool-based analysis—a
case study”. In: 99—The Unified Modeling Language. Springer, pp. 645–660.
Kelter, Udo, Jürgen Wehren, and Jörg Niere (2005). “A Generic Difference Algorithm
for UML Models.” In: Software Engineering 64.105-116, pp. 4–9.
Kemeny, John G, James Laurie Snell, et al. (1960). Finite markov chains. Vol. 356. van
Nostrand Princeton, NJ.
Szlenk, Marcin (2006). “Formal semantics and reasoning about uml class diagram”.
In: Dependability of Computer Systems, 2006. DepCos-RELCOMEX’06. International
Conference on. IEEE, pp. 51–59.
Ullah, Najeeb, Maurizio Morisio, and Antonio Vetro (2012). “A comparative analy-
sis of software reliability growth models using defects data of closed and open
source software”. In: Software Engineering Workshop (SEW), 2012 35th Annual IEEE.
IEEE, pp. 187–192.
Wohlin, Claes et al. (2012). Experimentation in software engineering. Springer Science
& Business Media.