You are on page 1of 42

BAHIR DAR UNIVERSI TY

Bahir Dar Institute of Technology


Faculty of Electrical and Computer Engineering
Stream of Power and Control Engineering
Final Project on: Design and Implementation of Automatic Water
Level Indicator and Control
Prepared by ID
1. Alemu Birhane………………………………….. 0500268
2. Andualem Molla…………………………………0500346
3. Yayew Fetene……………………………………0502818
4. Yewulzaf Mekonnen…………………………....0502867

Project advisor:
Mr. Kasiye T.
June, 2017
Bahir Dar, Ethiopia
Automatic water level indicator and control system 2017

Declaration
We declare that this final project is our original work, and it has not been presented for a project
in this or any other universities, and all sources of materials that will be used for the project work
have been fully acknowledged.
Name Signature
1. Alemu Birhane _____________
2. Andualem Molla _____________
3. Yayew Fetene _____________
4. Yewulzaf Mekonnen _____________

This project proposal has been submitted for examination with my approval as a university
advisor.
Project advisor Signature
Mr. Kasiye T. _______________

Submission date ___________

Faculty of Electrical and Computer Engineering, Final Project i


Automatic water level indicator and control system 2017

Acknowledgment
Firstly, we would like to express our deepest gratitude to our respected advisor Mr. Kasye T. for
his humble guidance, encouragement, patient enthusiasm, invaluable support and motivation
through the whole completion of this project. This project would not be succeeded without his
continuous support.
Secondly, we would like to drop our sincere appreciation to thank to our co- workers who have
been tolerant, motivated us and support us all these semester in accomplishing this project.
Thanks for their encouragement, love and emotional supports that they had given to us. Last but
not least, we would like to express our heartiest appreciation to our friends and those whom
involve directly or indirectly with this project. There is no such meaningful word thank, thank
you so much.

Faculty of Electrical and Computer Engineering, Final Project ii


Automatic water level indicator and control system 2017

Contents
Declaration ......................................................................................................................................................
Acknowledgment .......................................................................................................................................... ii
Abstract ........................................................................................................................................................ vi
Chapter One .................................................................................................................................................. 1
1 Introduction ................................................................................................................................................ 1
1.1 Background ......................................................................................................................................... 1
1.2 Statement of the Problem .................................................................................................................... 2
1.3 Objectives ........................................................................................................................................... 2
1.3.1 General Objective ........................................................................................................................ 2
1.3.2 Specific objectives ....................................................................................................................... 3
1.4 Significance of the project .................................................................................................................. 3
1.5 Scope of the project ............................................................................................................................ 3
1.6 Methodology ....................................................................................................................................... 3
1.7 Limitation of the Project ..................................................................................................................... 4
Chapter Two.................................................................................................................................................. 5
2 Literature Review....................................................................................................................................... 5
Chapter Three................................................................................................................................................ 7
3 Component Description, Design and specification of the system.............................................................. 7
3.1 Overall operation of the system .......................................................................................................... 7
3.2. Component Description, Design and Specification ........................................................................... 8
3.3 Flow chart for software simulation ................................................................................................... 23
Chapter 4 ..................................................................................................................................................... 25
4 Results and Discussions ........................................................................................................................... 25
4.1 Software Simulation Results and Discussions .................................................................................. 25
4.2 Hardware Results and Discussions ................................................................................................... 27
Chapter Five ................................................................................................................................................ 28
5 Conclusion and Recommendation ........................................................................................................... 28
5.1 Conclusion ........................................................................................................................................ 28
5.2 Recommendation .............................................................................................................................. 29
References ................................................................................................................................................... 30
Appendix ..................................................................................................................................................... 31

Faculty of Electrical and Computer Engineering, Final Project iii


Automatic water level indicator and control system 2017

List of figures

Figure 1.1: Methodology of the work ........................................................................................................... 3


Figure 3.1: overall block diagram ................................................................................................................. 8
Figure 3.2: Transistor interface with relay .................................................................................................. 10
Figure 3.3: LED symbolic diagram............................................................................................................. 11
Figure 3.4: Arduino uno R3 microcontroller module ................................................................................. 18
Figure 3.5: Potentiometer circuit ................................................................................................................ 20
Figure 3.6: Level sensor position ................................................................................................................ 21
Figure 3.7: LCD display module ................................................................................................................ 22
Figure 3.8: Arduino Buzzer Circuit Diagram ............................................................................................. 23
Figure 3.9: Flow chart diagram for simulation ........................................................................................... 24
Figure 4.1: overall circuit of automatic water level indicator and control .................................................. 25
Figure 4.2: Result when the source tank is empty ...................................................................................... 26
Figure 4.3: Result when top tank is empty.................................................................................................. 26
Figure 4.4: Result when the top tank is full ................................................................................................ 27
Figure 4.5: hardware circuit ........................................................................................................................ 27

Faculty of Electrical and Computer Engineering, Final Project iv


Automatic water level indicator and control system 2017

List of Acronyms
AC……………………………………….....Alternative current
DC………………………………………….Direct current
DOD…………………………………….. ...Depth of discharge
IC………………………………………….. Integrated circuit
IDE…………………………………………Integrated drive electronics
LCD…………………………………………liquid crystal display
LED………………………………………...Light emitting diode
PI…………………………………………...Proportional integrator
PLC………………………………………...Programmable logic control
SCADA.........................................................Supervising control and data acquisition
SG……………………………………………Specific Gravity
TDH………………………………………….Total Dynamic Head

Faculty of Electrical and Computer Engineering, Final Project v


Automatic water level indicator and control system 2017

Abstract

Water scarcity is one of the major problems facing major cities of country and wastage
during transmission has been identified as a major problem. This is one of the motivations for
project, to deploy computing techniques in creating a barrier to wastage in order to not only
provide more financial gains and energy saving, but also help the environment and water
cycle which in turn ensures that save water for future.
This project works by embedding a control system into an automatic water pump controller
through the use of different technologies in order to design and implement. The system use
Arduino microcontroller to automate the process of water pumping from source tank to the
over-head tank storage system and has the ability to detect the level of water in a top tank and
source tank, switch on/off the pump and buzzer accordingly and display the status on an LCD
screen.
This project provides an improvement on existing water level controllers by its use of
calibrated circuit to indicate the water level and use of DC instead of AC power thereby
eliminating risk of rectification. In general the microcontroller orders the motor, buzzer and
LCD depending on the information obtained from the sensors that are connected to the two
tanks. Depending on the pressure or force of the water that presents in tank the output of the
level sensor changes. The change of voltage in the level sensor produces change of
information in microcontroller. When the level sensor senses there is need of water in tank
the microcontroller sends message information as current to the motor and buzzer through the
transistor as base of current.
Key word: arduino, motor, buzzer and relay

Faculty of Electrical and Computer Engineering, Final Project vi


Automatic water level indicator and control system 2017

Faculty of Electrical and Computer Engineering, Final Project 1


Automatic water level indicator and control system 2017

Chapter One

1 Introduction

1.1 Background

In the past centuries, tanks were filling using manual system, so filling tank were full, energy
consuming and time consuming. Now we are going to design water level controller that uses
single motor and Arduino microcontroller. In many industrial processes, control of liquid
level is required. It was reported that emergency shut-downs in the nuclear power plant are
caused by poor control of the steam generator water level. Such shutdowns greatly decrease
the plant availability and must be minimized.

The project "automatic water level control system" is designed to monitor the level of liquid
in the tank. The system has an automatic pumping system attached to it so as to refill the tank
once the liquid gets to the lower threshold, while offing the pump once the liquid gets to the
higher threshold. Sustainability of available water resource in many reason of the word is
now a dominant issue.

In most houses and buildings, including Bahir Dar University BiT, water is first received and
stored in the ground or sometimes underground tank. The received water supply is allowed to
fill the source tank first, and a water pump motor is then switched on manually so that the
water from the lower tank is pumped and shifted into the upper tank on the roof. Once the
water from the lower tank is transferred into the upper tank until it completely fills, the pump
is again manually switched off. This results in the unnecessary wastage and sometimes non
availability of water in the case of emergency.

The water level control system automatically maintains the desired level of water in series of
tanks, when source tank water empty the microcontroller send signal to the buzzer to give
sound. On the top tank, it switches ON the pump when the water level in the tanks goes
below a predetermined minimum set level and switches it OFF as soon as the water level
reaches the predetermined maximum level in the tanks to prevent them from overflowing,
thus maintains the water at a five fixed levels. The five levels of the tank are displayed on the
LCD as ERROR, EMPTY, QUARTER, HALF, ¾FULL and FULL. User has the flexibility
to decide the water level set points for the operations of pump. It ensures no overflows there
by saving energy and water. Moreover the system consumes very little energy for continuous
operation. Water is provided to the housing by a water tank that is situated on top of the

Faculty of Electrical and Computer Engineering, Final Project 1


Automatic water level indicator and control system 2017

building and water tank is supplied by a source. Once the source has enough water, it is the
duty of the household to switch on the motor, which then pumps water from the source to the
tank that is situated on the roof or terrace. The project automates this process by placing
sensor unit in the tank that periodically take measurements of the water level and that control
the motor automatically, the system controls the desired level of liquid tanks.

1.2 Statement of the Problem

In the context of most country, people are still using manual process for water pumping and
motor control that used in home, office and industries. An operator has to arrive at a
particular interval of time and made the motor on for pumping; regardless of the water level
in the upper tank. Manual controlling process is difficult and time consuming when the water
tank is located at higher buildings and controlling from ground level. If they are unable to
monitor continuously, there will be loss of energy sources for pumping water as well as loss
of natural resources due to overflowing of water from tank. Even if the automatic water level
controller that applied in most industries does not consider the level of source tank, it only
concentrates on the top one. The water level controller designed in this project can be used to
control water flow. However, there is no way of knowing whether the source of water,
actually has water or not. If no water source is present, then the submersible pump would
start running unnecessarily and overheat itself. This could be taken care by implementing
another sensor.
This problem can be reduced by designing an automatic control system which checks the
condition both top and source water tank and display the present status.
Microcontroller reads the status of system and gives desired output by switching motor and
displaying on LCD. The Automatic Water Pump Controller system monitors the water levels
and controls the pump as necessary to prevent breakdown and maximize water storage
without overfilling the roof top tank and wasting water, the water level digital control system
automatically maintains the desired level of water in a tank.

1.3 Objectives

1.3.1 General Objective

The general objective of this project is design and implementation of automatic water level
indicator and controller.

Faculty of Electrical and Computer Engineering, Final Project 2


Automatic water level indicator and control system 2017

1.3.2 Specific objectives

 To know how water level sensors interface with Arduino microcontroller


 To holler the buzzer sound when source tank is empty
 To simulate the circuit design in proteus software
 To program the system by using Arduino code
 Implementation

1.4 Significance of the project

 Automatic water level controller save time


 It will reduce human power.
 There will be no overflow of the overhead tank.

1.5 Scope of the project

 Design and simulate automatic water level control circuit by using proteus software
 Construction of design for the driver circuit
 Sizing and selection of water pump and discharge
 Design the system in prototype

1.6 Methodology

First select the title and retrace different literature review, after this collect data, analysis it
and, selection of appropriate materials.

Identify the problem

Revised literature

System modeling and simulation

Implementation
Figure 1.1: Methodology of the work

Faculty of Electrical and Computer Engineering, Final Project 3


Automatic water level indicator and control system 2017

1.7 Limitation of the Project

It is significant to know that this design is limited to 12V power supply, 30amps electric
pump rating and cannot be used to control industrial water pump above 30 amps. When the
water flow is turbulent the signal is high and this affect the output of sensor. If the water
moves down quickly such that the sensor wire still has a film of moisture on it from the
previous water level ,this affect the reading of the sensor.

1.8 Major Assumptions Made for the system

The operational characteristics of most electronic components are compared against working
temperature range from 0 to 70 0c.
 Costs for each device are calculated based on the whole sale of the suppliers, not the
price of single unit in the electronics shop, hence minimum cost is considered.
 The life time of each device are assumed to be as mentioned in the data sheet of
manufacturers, less consideration we have made related to working environment
and fault caused aging.

1.9 Organization of the project

The organization of this Thesis report is well detailed and vast in its coverage it covers all the
activities encountered during the research work. The first chapter of this work took care of
the introduction, aims and objective, scope, Justification and thesis report organization.
Chapter two highlight on literature re-view, chapter three highlight on description of system
and some of the component used were emphasized.
Chapter four highlight on the system design simulation results and discussions
implementation, construction, testing and packaging of the pump. Chapter five is all about the
conclusions problem encountered recommendation.

Faculty of Electrical and Computer Engineering, Final Project 4


Automatic water level indicator and control system 2017

Chapter Two

2 Literature Review
Many earlier works dealt with various techniques of monitoring and controlling of liquid
levels in industrial and domestic applications. Broadly this automatic control problem can be
achieved under two means: mechanical methods and electrical methods. Float ball type liquid
level control is a popular method of control still used in practice for normal applications such
as overhead tank overflow restrictors etc. The electrical methods of control include
microcontroller-based circuits which automatically predict the liquid levels and accordingly
active the circuit to operate motors. In spite of several such available methods, still there are
new techniques in this application so avoid dangerous operating conditions in industrial
boilers.

A water level control system for nuclear steam generator. The control system consisted of a
feedback controller and a feed forward controller. The robustness and performance of both
the controllers are analyzed and tuning of the two parameters of the controllers. It is shown
that the proposed gain scheduled controller can achieve good performance at high and low
power levels. Control of UTSG water level strongly affects nuclear power station availability.
There has been a special interest in this problem during low power transients because of the
dominant thermal dynamic effects known as shrink and swell. Also, the non-minimum phase
property, changing parameter according to power level, make it difficult to control the water
level of SG to control the water level of a steam generator. [1].

Automatic water level control for domestic application. The water level controller designed
in this project can be used to control water flow. However, there is no way of knowing
whether the source of water, which in this case is the UGT, actually has water or not. If no
water source is present, then the submersible pump would start running unnecessarily and
overheat itself [2].

A control strategy to achieve desired tracking of drum water level. Transfer function between
drum water level (Output) and feed water Vs steam mass rate were considered [3].
Highlighted the principal dynamic phenomena which determine the structuring of Boiler
turbine control systems, clarifying the essential connections of such phenomena with the
Physical nature of the process [4].
Analyzed the water level control of pressurized water reactor nuclear power station using PID
and fuzzy controllers [6].

Faculty of Electrical and Computer Engineering, Final Project 5


Automatic water level indicator and control system 2017

An adaptive estimator based dynamic sliding mode control method for water level control
[7].
A proportional controller with partial feed forward compensation and decoupling control for
the steam generator water level [8].

The concept of Fuzzy Logic was conceived at the University of California at Berkley. He
presented fuzzy set theory not as a control methodology, but as a way of processing data by
allowing partial set membership rather than crisp set membership or non-membership. This
approach to set theory was not applied to control systems until the 70's due to insufficient
small-computer capability prior to that time. Professor Zadeh reasoned that people do not
require precise, numerical information input, and yet they are capable of highly adaptive
control. If feedback controllers could be programmed to accept noisy, imprecise input, they
would be much more effective and perhaps easier to implement.

Likewise, neural networks are also capable of representing the precise information from
existing data sets. These intelligent control techniques like neural networks, fuzzy logic and
genetic algorithms have been used in liquid level control for the last two decades [9].

Investigated self-organizing fuzzy logic controller for water level control of steam generators.

An automatic water level control detects the water level in the tank and also ensures
continuous water flow round the clock because of its automatic, this automatic water control
is made up of microcontroller written in C programming language this program is burn into
an IC called AT89S52 with 40 pins [10].

The level measurement consist of determining the distance from the upper surface of a liquid
in a reservoir or vessel or any arbitrarily chosen mark located above or below this surface by
itself the level is not an independent physical quantities describing the state of a substance
through direct and indirect level, some examples of direct level measurement are dip-stick,
the bubbler, immersion electrode, capacitor type, liquid level radiation type liquid level
measurement.

Faculty of Electrical and Computer Engineering, Final Project 6


Automatic water level indicator and control system 2017

Chapter Three

3 Component Description, Design and specification of the system

3.1 Overall operation of the system

This project is aimed to maintain the desired level of liquid or water level in top and source
tank Using a single12V DC motor, water level sensor, relay, buzzer and microcontroller. The
microcontroller sends a signal to set the motor ON, when the water level in the tank or
container goes below a predetermined minimum set level and it makes the motor OFF, when
the levels in the top tank reach a predetermined maximum set level and the source tank is
empty. Thus the water level in the tanks is maintained in between two fixed levels (minimum
and maximum). The user decides the set points by him/her.

When the tanks have different level, the sensor detects it and the arduino microcontroller
takes command from the sensor then it sends a signal to the transistor base and the transistor
amplifies the current to drive the motor. The tanks are connected to each other through strong
pipes. The connecting pipes are attached at the bottom of the tanks, and the top tank is
connected to the motor. When the motor is activated the tank connected to it fills water until
it reaches the predetermined maximum level.

There are level sensors connected to the top tank and source tank. Those sensors sense the
level and give information to the microcontroller. Then the microcontroller controls the
motor according to this information. But the signal which is given from the microcontroller is
not enough to activate the motor. Therefore, a transistor is used as relay driver. The base
current is amplified and given as collector current to the motor, then the motor activates. The
motor switches OFF, when the water in the tank reaches a predetermined maximum level.
When the source tank has no enough water levels to be pumped, motor becomes off and the
buzzer gives sound. When the water level in the top tank is at the predetermined minimum
level and source tank has enough water, the motor becomes ON.

Faculty of Electrical and Computer Engineering, Final Project 7


Automatic water level indicator and control system 2017

LCD

Top tank
water level Relay
Relay Motor
sensor driver
Arduino
microcontroller

Source tank Buzzer


Transistor
sensor

Figure 3.1: overall block diagram

3.2. Component Description, Design and Specification

1 Transistor
A transistor is a semiconductor device used to amplify and switch electronic signals and
electrical power. It is composed of semiconductor material with at least three terminals for
connection to an external circuit. A voltage or current applied to one pair of the transistor's
terminal changes the current through another pair of terminals. Here we are discussing about
NPN transistor switching circuit. We have to connect the base resistor (Rb) to limit the base
current otherwise the transistor become damage. Transistor switching circuits are also
employed in DC motor driver circuit.

Transistors are commonly used as electronic switches, both for high-power applications such
as switched-mode power supplies and for low power applications such as logic gates.
Transistors function as current regulators by allowing a small current. The controlling (base)
current and the controlled (collector) currents must be going in the proper directions to
control a larger current. The amount of current allowed between collector and emitter is
primarily determined by the amount of current moving between base and emitter. The choice
between NPN and PNP is really arbitrary. All matter is that the proper current directions are
maintained for the sake of correct junction biasing.

Faculty of Electrical and Computer Engineering, Final Project 8


Automatic water level indicator and control system 2017

2 Relays
A relay is electromechanical switch which is used in industrial application to provide
isolation between high voltage and low voltage circuits. These two circuits have different
voltage rating. One might be a low voltage side and other high voltage side. For example, in
microcontrollers based circuits, relay is used to isolate microcontrollers from 220 volt AC
supply. There are various types of relays, but all of them operate in the same way.

When current flows through the coil, the relay is operated by an electromagnet to open or
close one or more sets of contacts. Relays take advantage of the fact that when you pass an
electric current through a wire; a magnetic field is generated surrounding the wire as
well. This is called induction. When you place two pieces of ferrous metal near a coil of wire
and pass current through the wire, the magnetic field can move the two pieces of metal
towards each other. Those pieces of metal can form a switch, which can be turned on and off
by putting current through the coil. The connection between a microcontroller and a relay
must never be made directly. Microcontroller interfacing circuits are used for this purpose.
Driver circuit should be used between them because of two main reasons:

1. As the relay has to move its contacts mechanically therefore a lot of current is
required for the energizing of coil. The source or sink current of a microcontroller is
just 25mA whereas an amount of 50 to 100mA current is required by a relay to
function properly.
2. Due to the presence of back emf, the negative voltages can reach the microcontroller
and damage it.

2.1 Relay driver circuit using Transistor

Relay driver circuit using NPN transistor is given below. The transistor acts as a switch.
Microcontroller provides high or low input signals to NPN transistor. NPN transistor
provides high driving current to electro mechanical relay through 5 volt external power supply. The
amount of current needed for the relay operation is carried by this transistor. The transistor
used here is BC547. This transistor gets turned on when the output pin of the controller is at a
high potential. Therefore the current starts flowing through the relay.
Following components are used in relay driver circuit using transistor:

 Base current limiter resistor R1


 zener diode of 12 volt used as a freewheeling diode

Faculty of Electrical and Computer Engineering, Final Project 9


Automatic water level indicator and control system 2017

 NPN transistor
 12 volt dc power supply

A freewheeling diode is also connected across the relay in this circuit. The purpose of this
diode is to protect the microcontroller as well as the transistor from the back emf of the coil;
otherwise it can damage them both. A fast switching diode 1N4148 has been used here. A DC
voltage supply of 12V is given to the microcontrollers.

Figure 2.2: Transistor interface with relay


2.2 Design the value of base resistor
Now, let’s see how we can calculate the value of the resistor R1. The basic formula is given
here:
R1  U b  0.7   Hfe  Relay Current

0.7V  minimum transistor biasing voltage,


Here, U b  source voltage to R1,
Relay current may be calculated through the following given formula:
Relay I  Supply Voltage  Resistance of the relay coil
For our design the source voltage from Arduino output pin is 5V
Forward current gain  30
Resistance of the relay coil  100
Relay supply voltage  12V

Faculty of Electrical and Computer Engineering, Final Project 10


Automatic water level indicator and control system 2017

Relay current I  relay supply voltage / resistance of relay coil


I  12 /100  0.12 A
Base resis tan ce R1  5  0.7  * Hfe  / I
R1  1.075K  1K
2.3 Specifications for DC Relay
For this project parameter of DC relay are specified as follows for proper design of the
system.
Coil resistance  100 Ω
Operating current  120mA
Coil voltage  12 V
Operating power  1.44W
3 Light Emitting Diode
A light-emitting diode (LED) is a two lead semiconductor light source that resembles a basic
pn junction diode, except that an LED also emits light. When LEDs anode lead has a voltage
that is more positive than its cathode lead by approximately 0.6 to 2.2 Volts, current often
flows and light is often emitted. On the other hand, when LEDs anode lead has a voltage that
is less positive than its cathode lead by approximately 0.6 to 2.2 Volts, current often does not
flow and light is often not emitted. Small rating LEDs have many advantages over
incandescent light sources including lower energy consumption, longer lifetime, improved
physical robustness, smaller size, and faster switching.

Figure 3.3: LED symbolic diagram


4 Water pump motor
A pump motor uses the mechanical input of a prime mover and converts it into pressurized
fluid power to perform work. The prime mover can be a diesel or gasoline engine. But for
electro-hydraulic pumps, the prime mover is an electric motor. D.C. motors have been used
as pump drives for many decades because of their ease of variable speed control and faster
response in transient conditions. This article will discuss the types of hydraulic pumps and

Faculty of Electrical and Computer Engineering, Final Project 11


Automatic water level indicator and control system 2017

motors used in pumping applications and the important factors to consider when sizing a DC
motor for a hydraulic pump.
4.1 Pump Types
Hydraulic pumps are classified in two broad categories: rotodynamic (centrifugal) and
positive displacement. Centrifugal pumps employ a rotating impellor that uses centrifugal
force to drive fluid from the inlet to the discharge side of the pump. Common types of
centrifugal pumps include submersible, priming, and axial flow. Positive displacement pumps
are the other broad category of hydraulic pumps. These pumps typically use gears, vanes,
diaphragms or pistons to force a fixed amount of fluid through the inlet to the discharge side
of the pump. Generally a large number of pump types exist, but for simplicity, is divided into
the following main categories:

1 Jack Pump: is actually a mixture of the two types. The motor, gears and electrical are on
the surface, but move a shaft (sucker rod) that attaches to the pump which is submerged.
Good for very deep wells. Example: Solar motor Jack Pump.

2 Submersible Pumps: The submersible pump is one of the most recent developments in the
water well pump industries. Submersible pumps can deliver water from any depth at a wide
range of capacities, may be installed in wells three inches or more in diameter, require no
well house or frost proofing, and have proven to be a very dependable type of pump. The
submersible pump has an electric motor and pump assembly that is suspended in the well
below the pumping water level on the pump discharge pipe. It has a special water-proof
electrical cable. The intake for the pump assembly is located directly below the pump section
and above the electric motor.

3 Surface Pumps: These types of pumps use a suctioning approach and are good for
applications with shallow wells, ponds, streams or storage tanks. Surface Pumps are not
waterproof. They must be located in weatherproof area near the water level, usually a pump
pit or pump house. All electrical parts are located away from the water. If the pump is too
high above the water level, these pumps will have suction problems that can make the system
unreliable or damage the pump. Examples: Shurflo pressure pump, Dank off Flow light
pressure pump, hot water circulator. The maximum possible suction for any pump is about 20
feet but if you push them to lift more than a few feet they will become noisy and come under
more strain.

Faculty of Electrical and Computer Engineering, Final Project 12


Automatic water level indicator and control system 2017

Among the various types of pumps available, we have selected Submersible Pump for it’s the
following characteristics and distinctive features.
 Applicable in drinking water supply, livestock watering, pond management, irrigation
 Max. efficiency 92 % (motor + controller)
 Reduces the high cost of water pumping, cost-effective pumping
 Simple installation
 Lifts up to 240 m
 Flow rate up to 11.0 m3/h
 High reliability and life expectancy
 Maintenance-free
4.2 Pump Parameters
As with most pumps, the primary specifications to consider when discerning DC powered
pump performance are flow rate, pump head, pressure, horsepower, and efficiency.
Volume flow rate (Q), also referred to as capacity, is the volume of liquid that travels
through the pump in a given time measured in gallons per minute or gpm . It defines the rate
at which a pump can push fluid through the system. In some cases, the mass flow rate is
also used, which describes the mass through the pump over time. The volume flow rate is
related to mass flow rate by the fluid density ρ via the equation:

When selecting pumps, the flow rate or rated capacity of the pump must be matched to the
flow rate required by the application or system.

Pressure is a measure of resistance: the force per unit area of resistance in the system. The
pressure rating of a pump defines how much resistance it can handle or overcome. Pressure,
in conjunction with flow rate and power, is used to describe pump performance. Centrifugal
pumps, however, typically use head instead of pressure to define the energy or resistance of
the pump, since pressure in a centrifugal pump varies with the pumped fluid's specific
gravity. When selecting pumps, the rated operating or discharge pressure of the pump must
be equal to or more than the required pressure for the system at the desired flow rate.

Head is the height above the suction inlet that a pump can lift a fluid. It is a shortcut
measurement of system resistance (pressure) which is independent of the fluid's specific
gravity. It is defined as the mechanical energy of the flow per unit weight. It is expressed as a
column height of water given in feet (ft) or meters (m).

Faculty of Electrical and Computer Engineering, Final Project 13


Automatic water level indicator and control system 2017

Pump head (H) can be converted to pressure (P) using the specific gravity (SG) of the fluid
by the equation:

Or by the density of the fluid ρ and the acceleration due to gravity (g):

When selecting centrifugal pumps, the rated pump head must be equal to or greater than the
total head of the system (total dynamic head or TDH) at the desired flow rate.

Power: Net head is proportional to the power actually delivered to the fluid, called output
power (Pout) or the water horsepower (measured in horsepower or hp). This is the horsepower
rating which describes the useful work the pump will do to the fluid. It can be calculated by
the equation:

Pout
Where:
ρ is fluid density
g is the acceleration due to gravity
Q is the volumetric flow rate
H is the pump head
is the mass flow rate
In all pumps there are losses due to friction, internal leakage, flow separation, etc. Because of
these losses, the external power supplied to the pump, called the input power (Pin) or brake
horsepower, is always larger than the water horsepower. This specification is typically
provided by the pump manufacturer as a rating or in the pump's performance curve and is
used to select the proper motor or power source for the pump.

Pump efficiency (ηpump) defines the percentage of energy supplied to the pump that is
converted into useful work. It is the ratio between the water horsepower and brake
horsepower (useful power vs. required power):

ηpump = Pout/Pin

Underground depth = 10 meter

Above ground depth = 5 meter

The above two parameters are taken from our usual observations and experience in the
project area.

Faculty of Electrical and Computer Engineering, Final Project 14


Automatic water level indicator and control system 2017

vertical lift +pressure head + frictional loss


Frictional loss is mostly taken as 4 every 100 feet.
Vertical lift +pressure head = (10+5)*3.28 = 49.2feet
Where 3.28 is factor to change meter into feet
Fractional loss is 4/100ft*49.2ft = 1.968 ft.
Therefore total feet (TDH) = 49.2 + 1.968 = 52ft
By taking the above TDH and well water source, we selected dc submersible pump.
R = 1m, usually we have seen such radius of well in the project area. This is related to well
capacity and ease of access to the deep well.
πr2h
=π*1*10 = 31.4m3
Assuming recycling time = 8hour, the water hole will be filled three times a day.
Total volume
An estimate of the required flow rate of the pump can be determined by the following
equation:
Gallons per day / (peak sun hours per day *60 minutes)
gallon per day

4.3 DC Motors in Pump Applications


DC motors have been used as pump drive motors due to their variable speed control ability,
especially at low speeds, simple control system, high starting torque and good transient
response. Brushed, wound-field DC motors have formed the primary type of DC motor used
in pump applications for many years. But permanent magnet (PMDC) and brushless DC
motors have seen greater adoption rates, primarily due to their simple and compact design,
high efficiency and power density, a wide range of frame sizes, and their need for less
maintenance.
4.3.1 DC Vs AC
The main advantage of DC (direct current) pumps over AC (alternating current) pumps is
that they can operate directly from a battery, making them more convenient and portable.
They are easier to operate and control, since AC systems typically require a controller to
manage speed. DC pumps also tend to be more efficient. However, AC pumps usually are
designed for higher speeds and larger bursts of power. They also have a longer working
lifespan than DC pumps.

Faculty of Electrical and Computer Engineering, Final Project 15


Automatic water level indicator and control system 2017

4.3.2 Servo motor: Servo motor is a special type of motor which is automatically operated
up to certain limit for a given command with help of error-sensing feedback to correct the
performance. There are some special types of application of electrical motor where rotation
of the motor is required for just a certain angle not continuously for long period of time. For
these applications some special types of motor are required with some special arrangement
which makes the motor to rotate a certain angle for a given electrical input (signal). For this
purpose servo motor comes into picture. This is normally a simple DC motor which is
controlled for specific angular rotation.

There are two fundamental characteristics of any servo motor. These are:
 The motor output torque is proportional to the voltage applied to it (i.e. control voltage
developed by amplifier in response to an error signal).

 The instantaneous polarity of control voltage governs the direction of torque developed
by servomotors.

4.3.2.1 Types of DC Servomotor

There are various types of dc servomotors which are series motors, split series motors, shunt
control motor and permanent magnet shunt motor.
A. Series motors: The series motor has a high starting torque and draws large current .Speed
regulation of this kind of motor is poor. Reversal can be obtained by reversing the polarity of
field voltage with split series field winding. This method reduces motor efficiency to some
extent.
B. Split series motors: Split series motor are the dc series motor with split-field rated with
some fractional kilowatt. This type of motor can operate as a separately excited field-
controlled motor. The armature is supplied with a constant current source. Split series motor
has a typical torque-speed curve. This curve denotes high stall torque and a rapid reduction in
torque with increase in speed. This results in good damping.
C. Shunt control motor: DC shunt type servomotor is not different from any other dc shunt
motor. It has two separate windings; field windings placed on stator and armature winding
placed on the rotor of the machine. Both windings are connected to a dc supply source. In a
conventional dc shunt motor, the two windings are connected in parallel across the dc supply.
In case of a servomotor, the windings are supplied with separate dc source.

D. permanent magnet shunt motor: Permanent magnet shunt motor is a fixed excitation
motor where the field is actually supplied by a permanent magnet. Performance is similar to

Faculty of Electrical and Computer Engineering, Final Project 16


Automatic water level indicator and control system 2017

armature controlled fixed field motor. In case of field controlled dc motor, the field is excited
by the amplified error signal mentioned earlier. The armature winding is energized from a
constant current source. Torque developed is proportional to field current (If) up to saturation
level. This method is applied in small servomotors. It has longer time constant owing to
highly inductive field circuit so dynamic response is slower than armature controlled dc
motor. But in armature controlled dc motor, the motor armature is energized by amplified
error signal and field is supplied from a constant current source. High field flux density also
increases torque sensitivity of motor (torque proportional current times flux).

4.3.2.2 Servo Motor Selection

There are many types of motor that can be selected in pump design. Currently, several types
of motors being used in the world are: Step-motor, Servo-motor, AC asynchronous motor,
permanent magnetic DC servo motor, permanent magnetic brushless synchronous motor, etc.
Finally we have selected 100v serious GYS401D5 DC servo motor with the following
standard specifications.
Max. Torque [Nm] =3.58
Rated current [A] =4.8
Rated speed[r/min] =3000
Rated output [kW] =0.375

5 Arduino Microcontrollers

Microcontrollers must contain at least two primary components. Random access memory
(RAM) and an instruction set. RAM is a type of internal logic unit that stores information
temporarily. RAM contents operation, the microcontroller will step through a program (the
firmware). Each valid disappear when the power is turned off. While RAM is used to hold
any kind of data, some RAM is specialized, referred to as registers. The instruction set is a
list of all commands and their corresponding functions. During instruction set and the
matching internal hardware that differentiate one microcontroller from another.
Microcontroller has basically three functions these are sensing, communicating and
controlling. It senses what the input says and using this input, communication among
different devices takes place. Finally it controls the output based on the microcontroller. The
type of microcontroller we have used for this project is called Arduino uno R3 type
microcontroller. Arduino has 14 digital input-output ports and 8 analog input-output ports. In

Faculty of Electrical and Computer Engineering, Final Project 17


Automatic water level indicator and control system 2017

this project Arduino receives an input from level sensors and it controls the pump motor
according to the level of the water.

Arduino Uno: Arduino is a tool for making computers that can sense and control more of the
physical world than your desktop computer. It's an open-source physical computing platform
based on a simple microcontroller board, and a development environment for writing
software for the board. Arduino can be used to develop interactive objects, taking inputs from
a variety of switches or sensors, and controlling a variety of lights, motors, and other physical
outputs. The Arduino programming language is an implementation of Wiring, a similar
physical computing platform.

Figure 3.4: Arduino uno R3 microcontroller module


We have selected Arduino microcontroller for it has the following features and
characteristics.
 Inexpensive: Arduino boards are relatively inexpensive compared to other
microcontroller platforms
 Cross-platform: The Arduino software runs on Windows, Macintosh OSX, and Linux
operating systems.
 Simple, clear programming environment: The Arduino programming environment is
easy-to-use for beginners. The language can be expanded through C++ libraries, and
people wanting to understand the technical details can make the leap from Arduino to the
AVR C programming language on which it's based. Similarly, you can add AVR-C code
directly into your Arduino programs if you want to.
 Open source and extensible hardware: The Arduino is based on Arduino UNO R3
microcontrollers.

Faculty of Electrical and Computer Engineering, Final Project 18


Automatic water level indicator and control system 2017

The current version of the Arduino hardware reference design is called the “Uno” or “One”
in Italian) and is published by the Arduino team. It provides four basic functional elements:
 A simple 5V power supply
 A USB-to-serial converter for loading new programs onto the board
 I/O headers for connecting sensors, actuators, expansion boards, etc.
It is a feature of most Arduino boards that they have an LED and load resistor connected
between pin 13 and ground; a convenient feature for many simple tests. The previous code
would not be seen by a standard C++ compiler as a valid program, so when the user clicks the
"Upload to I/O board" button in the IDE, a copy of the code is written to a temporary file
with an extra include header at the top and a very simple main () function at the bottom, to
make it a valid C++ program.

6 Level Sensor

In this project the type of sensors that we have selected is water level sensor which is float
potentiometer which is a displacement sensor.

Potentiometer: A potentiometer consists of a resistance element with a sliding contact which


can be moved over the length of the element. Such element can be used for linear or rotary
displacements, the displacement being converted in to a potential difference.

An important effect to be considered with potentiometer is the effect of a load RL connected


across the output. The potential difference across the load VL is only directly proportional to
VO if the load resistance is infinite. For finite loads, however, the effect of the load is to
transform what was a linear relationship between output voltage and angle in to a non-linear
relationship. Some RAM is specialized, referred to as registers. The instruction set is a list of
all commands and their corresponding functions. During instruction set and the matching
internal hardware that differentiate one microcontroller from another. Microcontroller has
basically three functions these are sensing, communicating and controlling. It senses what the
input says and using this input, communication among different devices takes place.

Finally it controls the output based on the Microcontroller has basically three functions these
are sensing, communicating and controlling. It senses what the input says input. The type of
microcontroller we have used for this project is called Arduino uno3 type microcontroller.
Arduino has 14 digital input-output ports and 8 analog input-output ports. In this project
Arduino receives an input from level sensors and it controls the pump motor according to the
level of the water.

Faculty of Electrical and Computer Engineering, Final Project 19


Automatic water level indicator and control system 2017

6.1 Potentiometer
The potentiometer is an electrical device comprising a resistor with a sliding third con-tact,
often termed a wiper, which allows the voltage to be varied depending upon where the slider
is positioned along the length of the resistor. Manual adjustment of the wiper along the length
of the fixed resistance produces a variable voltage at the wiper. The magnitude of this output
voltage is directly proportional to its relative position along the length of the resistor. If the
potentiometer wiper is appropriately connected to a moving system then any movement in
that system will cause the wiper to move and so change the output voltage. This signal
provides a direct measurement of position or change in position, water level in our cases.
Hence, although still a potentiometer, it is of use as a sensor for measuring linear
displacement.
Let Vs is the input source to the potentiometer, Vo output to any load and Rp is the total
resistance of the potentiometer.
The relationship between and when the wipe moves some distance X by any cause of
movement is any kind of load is connected at the wipe terminal.

Figure 3.5: Potentiometer circuit


)
The total resistance of potentiometer will be

In our assumption Ω

Faculty of Electrical and Computer Engineering, Final Project 20


Automatic water level indicator and control system 2017

Here we have taken =100kΩ potentiometer resistance, supply voltage


For , , the microcontroller senses as tank is empty

7 Tanks

The thanks that we used for this specific project are different in size and are connected in a
cascaded or interacting way so that they filled water at the same time. Those tanks must be
strong to prevent themselves from any hazardous external environments. The sensor is
connected to the tank with a highest volume. The collected water in the tank is supplied by
the voltage source. Hence, the water in the tank becomes electrically conducting.

Figure 3.6: Level sensor position


8 LCD Display
The LCD we have used is LM016L type and it have different use and features. Frequently, an
arduino program must interact with the outside world using input and output devices that
communicate directly with a human being. One of the most common devices attached to an
arduino is an LCD display. Some of the most common LCDs connected to the arduino are
16x2 displays. This means 16 characters per line by 2 lines. The 44780 standard requires 3
control lines as well as either 4 or 8 I/O lines for the data bus. The user may select whether
the LCD is to operate with a 4-bit data bus or an 8-bit data bus. If a 4-bit data bus is used the
LCD will require a total of 7 data lines (3 control lines plus the 4 lines for the data bus). If an
8-bit data bus is used the LCD will require a total of 11 data lines (3 control lines plus the 8
lines for the data bus).

Faculty of Electrical and Computer Engineering, Final Project 21


Automatic water level indicator and control system 2017

Figure 3.7: LCD display module


The three control lines are referred to as EN, RS, and RW.
The EN line is called "Enable." This control line is used to tell the LCD that you are sending
it data. To send data to the LCD, your program should make sure this line is low (0) and then
set the other two control lines and/or put data on the data bus. When the other lines are
completely ready, bring EN high (1) and wait for the minimum amount of time required by
the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.
The RS line is the "Register Select" line. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is high
(1), the data being sent is text data which should be displayed on the screen. For example, to
display the letter "T" on the screen you would set RS high.
The RW line is the "Read/Write" control line. When RW is low (0), the information on the
data bus is being written to the LCD. When RW is high (1), the program is effectively
querying (or reading) the LCD. Only one instruction ("Get LCD status") is a read command.

LCD with Arduino UNOR3 is an amazing tool for physical computing it's an open source
micro-controller board, plus a free software development environment. Use it to make cool
interactive objects that can sense inputs from switches, sensors, and computers and then
control motors, lights, and other physical outputs in the real world.

9 Buzzer
A buzzer is a device which makes a buzzing or beeping noise. There are several kinds; the
most basic is a piezoelectric buzzer, which is just a flat piece of piezoelectric material with
two electrodes. This type of buzzer requires some kind of oscillator (or something more
complicated like a microcontroller) to drive it. If you apply a DC voltage you will just get a
click. They are cheap and can be very loud without using very much power and also very
thin, so they can be used in flat objects like “singing” greeting cards.

Faculty of Electrical and Computer Engineering, Final Project 22


Automatic water level indicator and control system 2017

A piezoelectric element also produces a voltage in response to pressure, so piezoelectric


buzzers can also be used as crude pressure sensors or microphones. A similar device, the
crystal earpiece, can be used in unpowered crystal radios (now mainly built by hobbyists),
because it’s very high sensitivity means it can be powered by the radio signal itself.
More complex buzzers include the oscillator circuit and the piezoelectric element or speaker
in a single package, so all you need to do is apply a voltage and you will get an annoying
beeping or buzzing sound.

There are also electromechanical buzzers, which use a coil and a moving electrical contact.
When the coil is energized, the contact is pulled toward the coil, but this breaks the circuit
and the contact rapidly moves back to its original position. This makes a loud buzzing sound.

9.1 Arduino Buzzer Circuit Diagram

The circuit shown here uses a NPN transistor to connect the buzzer to the Arduino. The
transistor allows the buzzer to be powered from a different voltage to the Arduino. Any NPN
transistor that can handle the current drawn by the buzzer can be used. With a NPN transistor
and base resistor, the circuit can be used to operate a buzzer that draws up to about 200mA.

Figure 3.8: Arduino Buzzer Circuit Diagram

3.3 Flow chart for software simulation

In this topic we will describe the flow chart, algorithm and program code of the operational
project task. These are the main parts of the project design. The controller we have used is
software dependent. Then the operational principle of this software will be shown in the last
sections of this purpose.

Faculty of Electrical and Computer Engineering, Final Project 23


Automatic water level indicator and control system 2017

Figure 3: Flow chart diagram for simulation


The algorism of this system describes the overall flow process of the project in a detail
words.
START: initialize the port of the microcontroller. The microcontroller checks if the source
tank is empty or not, if the source tank is empty, the microcontroller make OFF the motor and
ON the buzzer. If the source tank has enough water, the microcontroller checks whether the
top tank is empty or not. If it is empty, the microcontroller make ON the motor and OFF the
buzzer until the top tank is full.
Therefore, generally the motor becomes ON and the buzzer OFF, when the top tank is not full
and source has water. And motor becomes OFF if the top tank is full or the source has no
water to be fed to top the tank. The buzzer only ON when source tank is not enough water.
Based on the flow chart and algorism the program code is written to the microcontroller the
microcontroller intern performs based on these the instructions given.

Faculty of Electrical and Computer Engineering, Final Project 24


Automatic water level indicator and control system 2017

Chapter 4
4 Results and Discussions

4.1 Software Simulation Results and Discussions


In this project design, the components we have used are Arduino UNO R3, servo DC motor,
relays, transistor, and BC LCD displayer and battery source. In this section those components
are interconnected to show the procedure and method of the real design in protease 8.1
professional. These components are connected and exhibits as they are connected practically.
The components are connect on a Printed Circuit Board as per the given connection details in
the circuit diagram. The functioning of the circuit can be explained with respect to the action
format that occurs in the circuit.

The level sensor is connected to the input side of the Arduino UNOR3, and the motor and
LCD is connected to the output side of the Arduino UNOR3. 5V voltage is given to the motor
to be energized. Since the water in the tank is conductive because of the 5V voltage source
given to the tank. The level sensor senses the level of the tank to which it is connected to the
Arduino and take action to control the system.

The motor becomes on if the source tank has enough water to pump and top tank is empty,
quarter, half and ¾ full.

Figure 4.1: overall circuit of automatic water level indicator and control

Faculty of Electrical and Computer Engineering, Final Project 25


Automatic water level indicator and control system 2017

When the source tank is empty the LCD display “Error”, the buzzer pin energized and the
motor becomes OFF.
Result when the source tank is empty

Figure 4.2: Result when the source tank is empty


When the source tank has enough amount of water and the top tank is empty, LCD is display
“EMPTY”, motor ON and buzzer OFF.
Result when top tank is empty

Figure 4.3: Result when top tank is empty

Faculty of Electrical and Computer Engineering, Final Project 26


Automatic water level indicator and control system 2017

When the top tank is full, the LCD display as” TANK IS FULL” and the motor becomes
OFF.
Result when the top tank is full

Figure 4.4: Result when the top tank is full

4.2 Hardware Results and Discussions

Figure 4.5: hardware circuit

Faculty of Electrical and Computer Engineering, Final Project 27


Automatic water level indicator and control system 2017

Chapter Five

5 Conclusion and Recommendation

5.1 Conclusion

Automatic water level control system automatically maintains the desired level of water in a
tank. When source tank is empty the microcontroller send signal to the buzzer to give sound.
When the source tank have enough water, it switches ON the pump as the water level in the
top tank goes to minimum set level and switches it OFF as soon as the water level reaches the
maximum level. It can be used in hotels, factories, homes, apartments, commercial
complexes, drainage, etc.

Designing the controlling part of the proposed system, as being the main task of our project,
has been achieved with great success, supported by simulation results and hard ware
implementation. Water pump sizing and selection with its power source requirement and all
accomplished in prior to the allocated time frame.

From the hardware circuit, one can find that very few external components are needed and we
are forced to replace water level sensor by push button, others with related equipment. We
know that the hard ware is challenged compared to that of software implementation. From
this project we get little knowledge about automatic level controller and indicator.
Generally this project plays a vital role in avoiding wastage and scarcity of water and
everyone can buy with in a low price and use as a house appliance to save the energy and
time.

Faculty of Electrical and Computer Engineering, Final Project 28


Automatic water level indicator and control system 2017

5.2 Recommendation
When we did this project, we had faced different problems such as lack of access to internet,
computer services and room to do hard ware. We cannot get the necessary material in the
time that we want and the school did not supply the material. Therefore we strongly
recommended that the department should facilitate such kind of services to encourage the
students in performing such a rare and splendid project and initiates the student to do
prototype. A user who wants to improve this project can progress it by using a metal
connected to the tanks and a resistor is connected to the metal microcontroller too in order to
amplify the power that is given to the microcontroller and to use the system as a switch. Also
he can also use a number of sensors to increase efficiency and to sense their own level
measure.

Faculty of Electrical and Computer Engineering, Final Project 29


Automatic water level indicator and control system 2017

References

[1] S. al, "water level control system for horizontal generators using quantitative feedback
theory".
[2] M. al, "control strategy to achive desired tracking of drum water level".
[3] Maffezoni, "Boiler turbine dynamics in power plant control";control Eng practical
volume 5., 1997.
[4] Z. &. L.S.Hu, "Water level control sysytem using PI controller", 2006.
[5] Z. e. al, water level control using Pid and Fuzzy controller.
[6] A. e. al, Adaptive estimator based dynamic sliding mode control method for water level
control.
[7] L. e. al, controller with partial feed forward compensation and decoupling control for
steam generator water level.
[8] P. Lotfizadeh, "Concept of fuzzy logic", Berkley, 1965.
[9] G. a. P.H.Seong, "Application of a self-organizing fuzzy logic controller to steam
generator level contro"l;Nuclear Engg.,Design, vol.167, 1997.
[10] Tan, "water level control system for nuclear steam generator", vo,24, 2011.
[11] P. a. Seong," Self organizing fuzzy logic controller for water level control of steam
generators".

Faculty of Electrical and Computer Engineering, Final Project 30


Automatic water level indicator and control system 2017

Appendix

#include<LiquidCrystal.h>;

int motorpin=8;

int buzzerpin=7;

LiquidCrystal lcd(12,11,5,4,3,2);

int s=A0;

int q=A1;

int h=A2;

int q_3=A3;

int f=A4;

//float V1, V2;

int quat=0;

int half=0;

int quar_3=0;

int full=0;

int sump=0;

void setup() {

pinMode(motorpin, OUTPUT);

pinMode(buzzerpin, OUTPUT);

pinMode(quat, INPUT);

pinMode(half, INPUT);

pinMode(quar_3, INPUT);

pinMode(full, INPUT);

pinMode(sump, INPUT);

lcd.begin(16,2);

lcd.setCursor(0,0);

lcd.print("TANK");

lcd.setCursor(0,1);

lcd.print("AMOUNT:");

//delay(100);

Faculty of Electrical and Computer Engineering, Final Project 31


Automatic water level indicator and control system 2017

// put your main code here, to run repeatedly:

//V1=map(analogRead(A0),0,1023,0,5);

//V2=map(analogRead(A1),0,1023,0,5);

lcd.setCursor(7,1);

lcd.print(full);

//lcd.clear();

void loop() {

while(1){

quat=digitalRead(q);

half=digitalRead(h);

quar_3=digitalRead(q_3);

full=digitalRead(f);

sump=digitalRead(s);

if(sump==LOW) //when tank is empty

//lcd.clear();

digitalWrite(motorpin,LOW);

digitalWrite(buzzerpin,HIGH);

lcd.setCursor(5,0);

lcd.print("ERROR");

lcd.setCursor(7,1);

lcd.print(quat);

delay(1000);

if(sump==HIGH && quat==LOW && half==LOW &&quar_3 ==LOW && full==LOW) //when tank is
empty

//lcd.clear();

digitalWrite(motorpin,HIGH);

digitalWrite(buzzerpin,LOW);

Faculty of Electrical and Computer Engineering, Final Project 32


Automatic water level indicator and control system 2017

lcd.setCursor(5,0);

lcd.print("IS EMPTY");

lcd.setCursor(7,1);

lcd.print(quat);

delay(1000);

// start motor

else if(sump==HIGH && quat==HIGH && half==LOW && quar_3==LOW && full==LOW)

//lcd.clear();

digitalWrite(motorpin,HIGH);

digitalWrite(buzzerpin,LOW);

lcd.setCursor(5,0);

lcd.print("IS Quar");

lcd.setCursor(7,1);

lcd.print(quat);

delay(1000);

// when tank is qaurter

else if(sump==HIGH && quat==HIGH&& half==HIGH && quar_3==LOW&&full==LOW) // when tank


is half

//lcd.clear();

digitalWrite(motorpin,HIGH);

digitalWrite(buzzerpin,LOW);

lcd.setCursor(5,0);

lcd.print("IS Half");

lcd.setCursor(7,1);

lcd.print(half);

delay(1000);

Faculty of Electrical and Computer Engineering, Final Project 33


Automatic water level indicator and control system 2017

else if(sump==HIGH && quat==HIGH&&half==HIGH&&quar_3==HIGH&&full==LOW) // when tank is


three fourth

//lcd.clear();

digitalWrite(motorpin,HIGH);

digitalWrite(buzzerpin,LOW);

lcd.setCursor(5,0);

lcd.print("IS 3/4 full");

lcd.setCursor(7,1);

lcd.print(quar_3);

delay(1000);

else if(sump==HIGH && quat==HIGH&&half==HIGH&&quar_3==HIGH&&full==HIGH) // when tank is


full

//lcd.clear();

digitalWrite(motorpin,LOW);

digitalWrite(buzzerpin,LOW);

lcd.setCursor(5,0);

lcd.print("IS Full");

lcd.setCursor(7,1);

lcd.print(full);

delay(1000);

Faculty of Electrical and Computer Engineering, Final Project 34

You might also like