DBminiproject

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

KATHMANDU UNIVERSITY

SCHOOL OF ENGINEERING
DEPARTMENT OF ELECTRICAL AND ELECTRONICS
ENGINEERING

Mini Project Report

Water Level Controller

A mini project report submitted in partial fulfilment


of the requirement for the course COEG 401

By:
Manoj Kumar Sah (41049)
Ram Bikesh Sah (41050)
Abhishek Shrestha (41054)
Shahil Shrestha (41055)

Submitted To:
Diwakar Bista
Assistant Professor

December 4, 2019
LIST OF FIGURES

Figure Title Page no.

1 The scheme of a water level tank used for storage (buffer) and a 1
pump.

2 Open water tank 1

3 Simulink model of water tank 2

4 Graph of time vs height when Qin=0 and outlet is opened 3

5 Graph of time vs height of water level when Qin=0.0001 and 3


outlet is opened
6 Graph of time vs height of the water level when Qin=0.001 and 4
outlet is opened
7 Graph of time vs height of the water level when Qin=0.0001 4
and set to 0 after 400 sec
8 Graph of time vs height of the water level when Qin=0.001 and 5
set to 0 after 400 sec
9 Simulation of Water level Controller in Multisim 7
Table of content
Introduction ................................................................................................................................1
Objective.....................................................................................................................................1
Description..................................................................................................................................1
Matlab simulation .......................................................................................................................2
Hardware Implementation ...........................................................................................................6
Conclusion ..................................................................................................................................8
Introduction
Water level tanks are used in homes to store water. The purpose is to give enough pressure
for continuous water supply .Many water tanks are filled manually each time they are
emptied. That can in some cases make problems (while we take a shower the water suddenly
is empty). It will many times lead to waste of water; the pump filling the tank is stopped after
the water flows over the tank. In Kathmandu, more people would get water if all the pumps
were stooped before the water was flowing over the tank. To simplify this, and improve the
water supply to Kathmandu, an automatic control system could be installed for every water
level tank.
Automatic water pump is the pump which fill up the tank automatically and pump will turn
on and off automatically. There are many technique and ways to control the water pumps but
we have use logic gates and flip-flop to control it.

Water inlet

Water outlet

Figure 1: The scheme of a water level tank used for storage (buffer) and a
pump

Objective
1. To design water level controller

Description
The system is designed for controlling the water pump. When by detecting the level of water,
the pump turns on and off. Both software simulation and hardware have been done to
understand about the control system.

qin Following the conservation of mass equation, the equation for the
fig 1. Gives

dh
A  qin  qout  qin  a 2 gh
dt ---------------- eq(1)
h

qout

Figure 2: Open water tank


Page | 1
Writing eq(1) in integral form
t 1 t 1
h(t )  h(0)  0 A in
( q (t ')  qout (t '))dt '  h(0)  0 A (qin (t ')  a 2gh(t '))dt '
----------eq(2)

Taking Laplace transform of eq(2) and setting time (t) = 400 sec

1
H (s)  H (0)  [(qin  a 2 gh ]
As

Matlab Simulation
Let us consider
A=2.3*10-3 m2
a=7.1*10-6 m2
g=9.82 m/s2
Replacing the above value in eq. (3) and simulating in Matlab, we get the graph as shown in
Figure: 4

Figure 3: Simulink model of water tank


Now we discuss about some real time cases of the above model.

Page | 2
Case I: With Qin=0 and outlet is opened

Figure 4: Graph of time vs height when Qin=0 and outlet is opened

Since no any inflow in the tank, we found that the height will not increase.
Case II: With Qin=0.0001 and outlet is opened

Figure 5: Graph of time vs height of water level when Qin=0.0001 and


outlet is opened

Since the discharge is low in this case, the maximum height attained is only about 7m at
simulation time t=400 sec and the nature of increasing is also exponential.

Page | 3
Case III: With Qin=0.001 and outlet is opened

Figure 6: Graph of time vs height of the water level when Qin=0.001 and
outlet is opened
With high inflow of water the attained height is also high i.e. about 140m and the nature of
fill is also linear.
Case IV: For initial Qin=0.0001 is now set to zero after 400 sec simulation time and we find
the nature of height change

Figure 7: Graph of time vs height of the water level when Qin=0.0001 and
set to 0 after 400 sec
The curve obtained in the figure before t=400 sec is same as before. But after t=400 sec, we
close the water inlet into the tank. The nature of height decreasing is obtained exponential.

Page | 4
Case V: Initial Qin=0.001 is now set to zero after 400 sec simulation time and we find the
nature of height change

Figure 8: Graph of time vs height of the water level when Q in=0.001 and
set to 0 after 400 sec

For higher value of flow, we find the nature of the curve to be linear. After t=800 sec we find
the height to remain at some value around 80m. Since high height refers to high pressure the
outflow after Qin set to zero is also obtained linear not exponential.
From the graph, we can see that no steady state is achieved in any of the cases. This is
because of the fact that no sensor has been placed in the simulation system to control the
water level. Also in the simulation system, the height of the tank has not been fixed. So, no
steady state is achieved. But in the real life system, the height of the tank is known to us and
fixed. And in that condition, the steady state is achieved.

Hardware Implementation
For the implementation of the system, a truth table was designed.

Inputs Output
Level ‘L’ Level ‘H’
0 0 Motor On
0 1 In determinate
1 0 Motor Latched
1 1 Motor Off

Let us consider ‘H’ be high level which indicates the water level above the tank and ‘L’ be
low level which indicates the lowest level height of water level. For such latching purpose we
used S-R latch for the hardware. We now analyse and compare the actual truth table and truth
table of the S-R latch.

Page | 5
Inputs Output Inputs Output
Level ‘L’ Level ‘H’ S R
0 0 Motor On 1 0 Set
0 1 In determinate 1 1 In determinate
1 0 Motor Latched 0 0 Latch
1 1 Motor Off 0 1 Reset

We individually convert the required truth table to the S-R latch truth table.
1. For turning the Motor on for Lowest Level i.e. 00 Logic

2. For Latching the state of Motor on reaching the intermediate water level i.e. 01 logic
This latching state is necessary because if not provided the motor will turn off at the 01 logic
height i.e. 10 cm every time the motor is turned on and the tank would never be filled up to
the 11 logic height.

3. For turning off the Motor on reaching the high water level i.e. 11 logic

Page | 6
From the above conditions we put just a not gate in the Low level sensor output and send it to
the S-R latch and our objective is completed.
Before implementing the system, a circuit diagram was prepared and it was simulated using
Multisim.

Figure 9: Simulation of Water level Controller in Multisim

After the successful software simulation, the system was implemented. The following
components were used for implementation.
1. NOT Gate
2. SR Latch
3. Push button
4. Relay
5. Led

The height sensors were modelled with the help of switch that gives high output when
pressed. If the switch is pressed it represents that the water has just crossed that level. Motor
pump was modelled using LED that denotes the on and off state of the motor pump. When L
and H, both were given low signal which indicates that neither the water level is below the
threshold height (00 logic) and a signal is passed to relay through the Transistor which in turn
turns ON the LED. So we can say that transistor is used as a switch. This indicates that the
water pump is turned on.

After the motor is turned on, the water level rises linearly as seen from the MATLAB
simulation. When it reaches above the lower threshold height (00 logic) the output is latched
(i.e. remains same as previous state) and hence the motor remains on. Finally when it reaches
the higher threshold height (11 logic). The S-R latch resets and the motor is turned off.

Page | 7
Now after usage of water, the water level decreases exponentially as seen from the MATLAB
Simulation. On the process of decreasing the water level decreases below the higher threshold
(11 logic) and the sensor gives 10 output. This output latches the latch and the motor is still
remained off. So after crossing the lower threshold height the motor is turned. In this way the
water level is controlled with the help of two height sensors placed at lowest allowed height
and highest allowed height.

Conclusion
Hence, by using SR latch, the motor pump is controlled. At the lowest level, the logic has
been defined in such a way that the motor is turned on. After reaching the level above the
lowest height, the output is latched and the motor remains turned on. When the water level
crosses, above the highest level point, the output resets and the motor is turned off. Also, the
steady state does not occur in the simulated system because height of the tank is not known to
us.

Page | 8

You might also like