You are on page 1of 30

A Project Report on

,I,I'ATER
LEVET DETECTOR AND CONTROLLER'
A Project Work submitted in partial fulfif lment of requirements for the award of a
diploma
fn
ELECTRON ICS AN D TELECOM M U N ICATION ENG I N EERI NG

By
RAH U L SAHAN | (CtT/r 5 lET lOO4l
NtK|TA DEY (Ctr/ls /ET/AM/Ott1
ASH|M DAS (Ctr/ls /Er/023I.

Under the supervision of


Mr. HAMDHAN CHEL
Assistant Professor
Electronics and Communication Engineering

haffiror
fafn#rr: bttrl

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


CENTRAL INSTITUTE OF TECHNOLOGY, KOKRAIHAR

S-fi qffiFr+1TiR{Fr,etrqsru
(A Centrally funded institute under MHRD, Government of India)
BTAD ASSAM.78337O
Websit e: http ://www. cit. a c.i n
O-tra In-r- Ol
k fr.r::Ld-a
Central Institute of Technology, Kokrajhar
fr -fiq ffi Fral rie{Fr, siloqvru
EatD. :
(A Centrally funded institute under MHRD, Government of India)
ard .|t t|rt rFil
'DOA
crrrt r srllb{xr
BTAD ASSAM-783370

CERTIFICATE OF SUBMISSION OF PROJECT REPORT

This is to certify that the following students of 6th semester Diploma course (Electronics and
Telecommunication Engineering) have submitted their project report on "Water Level Detector and
Controller" in partial fulfilment for the Diploma in Electronics and Telecommunication Engineering.

RAHUL SAHANI
NIKITA DEY
ASHIM DAS

DR.SUNANDAN BHUNIA
(Associate Professor)
Head of thelc$rtment
El ectron i cs and com mun iffi\t$S1Infpe
Central Institute of Technology, Kokrajhar
Central Institute of Technology, Kokrajhar
Sfrq ftq]fta1 {iB{Fr, qil€q|gru
(A Centrally funded institute under MHRD, Government of India)
BTAD ASSAM.78337O

CERTIFICATE

This is to certify that the project entitled "Water Level Detector and Controller/'submitted by Rahul
sahani (ctr/L5/ET/a041, Nikita Dey(ctr/L5/ET/AM/011) and Ashim Das (ctr/Ls/ET/an) to the
Department of Electronics and Communication Engineering of Central Institute of Technology,
Kokrajhar has been prepared as per the regulations of Central Institute of Technology and qualifies
to be accepted as project, a part of the requirements for the Diploma in Electronics and
Telecom mu nication Engineering.

,/2
-A \ \^ i#,ll r
(N\Y-,4rtv'
\. '' "/ Ju'\'
MT. RAJIB CHETIA
Assistant Professor
Project Co-ordinator
Department of Electronics and Communication Engineering
Central Institute of Technology, Kokrajhar

Page I I
uh.n-dt.r-
i&.t-t::tdd
nnffl
Central Institute of Technology, Kokrajhar
cvD\
\\IIl.rl

t
--9L
xr&,
\ tftffinolrie{Fr,ot{rrgru
./)d
EEID. : aOOe
(A Centrally funded institute under MHRD, Government of India)
{Rl|i T'RTn|
arrl r {lffn
BTAD ASSAM-78337O

Certificate of Approval

This is to certify that the work embodied in this project entitled "Water Level Detector and
Controller" submitted by Rahul Sahani, Nikita Dey and Ashim Das to the Department of Electronics
and Communication Engineering, is carried under my supervision and guidance.

This project work has been prepared as per the regulations of Central Institute of Technology
Kokrajhar and I strongly recommend that this project work should be accepted in partial fulfilment
of the requirement for the Diploma in Electronics and Tele-communication.

Superviry r
$N$.srb
)flo"'
MT. HARADHAN CHEL
Assistant Professor
Department of Electronics and Communication Engineering
Central Institute of Technology, Kokrajhar
CERTI FICATE OF DECLARATION

We hereby declare that the project work entitled "Water Level Detector and Controlle/' is
authenticated work carried by us under the guidance of Mr. Haradhan Chel, Assistant Professor of
ECE, for the fulfilment of the award of the Diploma in Electronics and Telecommunication
Engineering and this work has been only submitted to The Department of Electronics and
Communication Engineering at Central tnstitute of Technology, Kokrajhar.

Date:
Place:

Rahul Sahani
(ctrlLslEr/004)
Reg. No. 8113 of 2015

Nikita Dey
(ctr /Ls/ErlAM/o11)
Reg. No.8251 of 2015

Ashim Das
(ctr/LslEr/0231
Reg. No. 8132 of 2015
ACKNOWLEDGEMENT

First of all, we pay our sincere thanks to our Project Guide, Mr. Haradhan Chel for giving us this
wonderful opportunity to take part in this project and guiding us throughout this project.

Secondly, w€ thank all the faculty members, staffand Lab-Technicians of the Electronics and
Communication Department for giving their valuable time in helping us.

We would like to thank our classmates and friends who helped to clear our doubts and for
motivating us. Also, we take this opportunity to thank our parents for financially supporting us
throughout this project. Finally we extend our sincere vote of thanks to all of those who help is in
the completion of this project and were involved directly or indirectly.

Date:
Rahul Sahani
(clr/ls /Er loo4l
Reg. No. 8113 of 2015

Nikita Dey
(cfr/ls lEr/AM/oLLl
Reg. No.8251 of 2OL5

Ashim Das
(clr/ls lErl023l
Reg. No. 8132 of zOLs
ABSTRACT

In this technological era, there is trend of automatic household systems which reduces human
efforts and saves time. The traditional way of checking the household water tank is done by turning
the motor or the pump set. This is difficult for an individual, as he/she has to check tank water level
regularly and wait for stoppage of tap water for indication of empty of water tank. Our project of
"Water Level Detector and Controller" enables the automatic control of water pumping system at a
predefined range of water level. lt automatically turns ON the motor at minimurn defined water
level and automatically turn OFF the motor beyond maximum defined water level.

In this project an Ultrasonic Sensor at the top of the water tank is installed which continuously
measures the water level. The ultrasonic sensor produces an ultrasonic pulse of 40 kHz. These
waves strike on the water surface and reflects back to the receiver of the sensor and generates
electrical signals. The microcontroller assembly calculates the propagation time between
transmission and reception of the sound waves from the received signal. The propagation time is
quantized and the quantized values are used to indicate the distance between sensor and the water
level. Wath the use of water level height, the microcontroller controls the water pumping system.
CONTENTS
1. CHAPTER-I
1.1 Introduction
2. CHAPTER-2
o Project Details
2.L Block Diagram
2.2 Circuit Diagram
2.3 Components used in the circuit
3. CHAPTER-3
o Description of components
3.1 Arduino Uno
3.2 Perfboard
3.3 Ultrasonic Transducer
3.4 Submersible pump
3.5 9V D.C Battery .
3.6 Battery Connector
3.7 Display
3.8 Relay
3.9 Pipe
3.10 Potentiometer
3.11 Resistor
3.t2 Containers
3.13 Connecting Wires
3.L4 Voltage Regulator
4. CHAPTER-4
.- Programming
4.L IDE(lntegrated Development Environment)
4.2 Steps to program Arduino
4.3 Code
5. CHAPTER-s
o Working of circuit
6. CHAPTER-5
o Result
7. CHAPTER-7
l. Advantage
ll. Disadvantage
8. CHAPTER-8
o Conclusion
9. APPENDIX
10. REFERENCE
CHAPTER 1

1. INTRODUCTION
Water the most important substance for the survival of living being. lt is the most necessary factor
is
as there
of our life. Therefore conservation of water should be the outmost priority of living beings
is only L%fresh water available in liquid form, 2%is in frozen state and rest of the 97%
water is

saline.
practicing
Conservation of water includes rain water harvesting, protecting ground water, and
water
sustainable methods of utilising water resources and educating the people through different
programs.

A microcontroller is a compact integrated circuit which is design to perform specific


lt requires
task.
consist of
a computer programming for its operation. An Arduino is a development board which
prototypes'
microcontroller. lt is an open source development board which is designed to build

which
In our project, we have used microcontroller to build "Water Level Detector and Controller",
serve the purpose of conservation of water. This circuit can be installed on water tank
and problem
turn off
of water overflow can be eliminated. This circuit measures height of water in the tank and
the pumping system when water reaches a certain level. This not only saves water but also save
electrical energy at the same time. Hence the ground water can be conserved.

This device is cheap, affordable and easy to install. lt is fully automated i.e., once installed
it can
operate on its own. lt also display the real-time data of the water present in the tank.

given in
The block diagram and the circuit diagram of the Water Level Detector and Controller is
programming
chapter 2. Description of the components used in the circuit is given in chapter 3. The
code and the working principle of the circuit is given in chapter 4 and 5 respectively.

Page
CHAPTER-2
PROJECI DETAILS
2.1 BLOCK DIAGRAM

16x2 Displav Unit

MICROCONTROLLER

Pumping
ULTRASONIC {Development Board} System
SENSOR (Arduino Uno)
(MoroR)

AC/DC Power Supply


FIGURE: Block Diagranr of Water Level Detector arrd Controller

A microcontroller embedded in the development board is used to control all the components that
are interfaced with it. lt controls all the components/peripherals that are interfaced with it by
producing the signal.

An ultrasonic range sensor is used to calculate the distance between the sensor and the object. lt
transmits and receive ultrasonic sound and calculates the time between transmission and reception
of sound signal. An LCD display is interfaced with the microcontroller to display the data and
information given by microcontroller.

The pumping system is connected with the microcontroller through relay which switches according
to the signal generated by the microcontroller.

An A.C supply can be used to supply power to the motor and L2V DC power is required to run the
microcontroller. 5V supply is required to run the components/peripheral which are interfaced with
microcontroller.

Page I
2.2CIRCUIT DIAGMM

FIG: Circuit Diagram of Water Level Detector and Controller.

Page | 3
2.3 COMPONENTS
Water Level Detector and Controller

Name of ltems Type/Value Quantity

L. Arduino Uno L

2. Perfboard 1,

3. Ultrasonic Transducer HC-SR04 1

4. Submersible Pump DC.5V I


5. 9V D.C Battery

6. Battery Connector

7. Display LCD (16x2) 1

8. Relay 5V t
9. Pipe P.V.C

10. Potentiometer 10K 1,

11 Resistor 220K T

12. Containers 2

13. Connecting Wires

14. Voltage Regulator 17805 (from 12V to 5V) 1

Page I 4
CHAPTER-3
DESCRIPTION OF COMPONENTS
3.1 ARDU I NO

Nowadays, a lot of development boards are available in the market for performing different small
or large project.Arduino is one of them.
Arduino is an open source micro-controller development board which consist of
Atmega32SP microcontroller chipset(created by Atmel in MegaAVR family).Although, Arduino uses
variety of microprocessor and controller. Since it is an open source project therefore it is available
in affordable prices.lt is cheaper compared to other development boards.
Arduino platform gives us pre-wiring(since it is single board microcontroller) and free code
libraries to start up on test our ideas.lt runs of C/C++ programming languages,so writing of low level
language codes are eliminated.
Different types of Arduino boards are:
1. Arduino Nano
2. Arduino Uno
3. Arduino Mega
4. Arduino Due and many more..

ARDUINO UNO

Arduino Uno (R3) is the mostly and widely used board in the entire arduino family.This board is
affordable yet fullfills our requirement for the project.lt is a single board microcntroller which runs
on 16Mhz base frequency generated by a crystal oscillator.
Specifications of Arduino Uno
M icrocontroller Atmega328P
Operating Voltage 5V
Input Voltage (recommended) 7-t2V
Input Voltage (limit) 6-20V
Digital l/O Pins 1a (of which 6 provide PWM output)
PWM Digital l/O Pins 6
Analog Input Pins 6
DC Current per l/O Pin 20 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATmega328P) of which 0.5 KB used by bootloader

SRAM 2 KB (ATmega328P)
EEPROM 1 KB (ATmega328P)
Clock Speed L6 MHz
LED BU ILTIN 13
Length 68.6 mm
width 53.4 mm
Weight 25e
En d u ra nce(Write Cycles) 10,000 times

Page | 5
Discription of Aduino Uno

3.1.1 USB plus


It is USB type B port used to power the arduino.Also it is used to program the arduino'

3.L.2 Power (Barrel Jackl


jack'
It is used to supply external DC power to the Arduino by connecting with barrel
3. l.3Voltage Regu lator
The voltage regulator automatically maintains constant voltage across
different components of the

Arduino.
3,.1.4 Crvstal Oscillator
It is the crystal oscillator which produces clock pulse of 16 Mhz. This clock pulse is used for
synchronisation of all internal operations'
3.1.5 Reset Pin
This is reset pin which can be used to reset arduino by an external signal.
3.1.6 VCC(3.3V1
This is an output pin which supply 3.3v DC output to interface other component.
3.1.7 VCC(SV)
This is an output pin which supply 5V DC output to interface other component.
3.1.8 Ground Pin
These are two ground pin use to ground the components.
3.1.10 Analog Pins
microcontroller' These
Arduino Uno has 6 analog pin which can be used to input analog datas into
which can be
pins read analog signal from the sensor like ultrasonic and convert into digital form
read by microcontroller.
3.1.11 Main lC (Atmeea328l
This tC(lntegrated chip) is the main lC of the development board.lt is the
brain of the board which

controls all the operations. lt has total 28 pin with DIP(Dual Inline Package).
of lC before writing
Different boads have different types of lC, one should know the specifications
code.

Page
3.1.12 ICSP
lCSp is basically"in circuit serial programming" which allows you to upload software to your MCU
without having to pull it out every time. Arduino compatible boards will have a2x3 pin ICSP header
on them. Some may even have more than one depending on how many lCs live on the PCB. lt breaks
out three of the SPI pins and power, ground, and reset.

3.1.13 Arduino ON (LED indicatorl


This is an LED which indicated whether Arduino is ON or OFF.

3.1.14 TX and RX:


The TX led flashes with different speed while sending the serial data. The speed of flashing depends
on the baud rate used by the board. RX flashes during the receiving process.

3.1.15 Dieital Pins


There are total L4 digitaal/O (lnput/Output) pins from which 6 pins can be used for PWM.
output.These pins can be used to read digital values (logic 0 or logic 1) or can be used to give digital
output.

3.1.16 Analog Reference


This is an analog reference pin.lt configures the reference voltage used for analog input.

3.1.L7 Reset
Aiduino can be reset by pressing reset button or by interfacing external reset button to RESET.

3.2 PERFBOARD

perfboard is a material for prototyping electronic circuits (also called DOT PCB). lt is a thin, rigid
sheet with holes pre-drilled at standard intervals across a grid, usually a square grid of 2.54 mm
(0.1 in) spacing. These holes are ringed by round or square copper pads, though bare boards are
also available. Inexpensive perfboard may have pads on only one side of the board.

This board is used for alternative to breadboard since components in breadboard cannot be
soldered. In this board, basic electronic components like resistor, capacitor, transistors, diodes etc.
can be soldered to fix them into the board. A figure of perfboard is shown below:

Page
I
3.3 U LTRASO N IC TRANSDUCER( HC-SRO4)

Fl G : Ultrasonic Transducer {HC-SRO4)


This is an ultrasonic transducer which is used for measuring distance.lt emits ultrasonic sound of
40KHz from its transmitter and if there is an obstacle in its path then the sound reflects back to
receiver of the module. By considering,the time and speed of the sound we can calculate the
distance. lt has 4 pins which serves different functions.The pin are VCC, TRIGGER, ECHO and
GROUND. When trigger pins goes HIGH for about 10ps. lt produces sonic burst which travels with
the speed of sound and are received at Echo pin.

Trig

prc-rIX)r-t iorra I
rarrge
Ech<>
FIG:Tirning Diagrarn

MATH EMATICAL FORM U LA FOR CALCU LATING DISTANCE


We know that speed of sound ,B = 340 m/s
= 0.034 cm/ps
Also, Time= Distance/Speed
t=s/ O
s= 19 *t
Therefore distance
s-(r*0.034)/2
(lt is divided bV 2 because sound will travel and will reflect back.Therefore travel time will be 2x).

Page
3.4 SUBMERSIBLE PUMP

Fig: 5V D.C Subrnersiblc PurnP

A submersible pump is an electrical device which is submerged in the water. The electric motor is
sealed in such a way that the power line and the spinning shaft are sealed to prevent water from
coming in. The pump picks up water around it and pump it to an outlet port.

3.5 DC Batterv (9V)


..rui**ro*

llf **ofl

Fig: 9V D.C Primary Battery

An electric battery is a device consisting of two or more than two electrochemical cells that converts
stored chemical energy to electrical energy. When an external load connects to a battery, electrons
cross from the negative to the positive terminal, creating an electrical current.
Batteries are classified into two group

Primarv: Primary batteries are those batteries which can be used only once and discarded
then. lt cannot be reuse because the chemical reaction that takes place within it cannot be reversed
and the active elements cannot go back to their original state.
Example: - alkaline batteries and zinc-carbon batteries.

Secondarv: secondary batteries are the rechargeable batteries. These batteries can be used
multiple times by recharging. These batteries can be recharged by passing current through it, the
chemical reaction that takes place during using can be reversed in these batteries. Example: - Lead-
acid batteries.

Page | 9
I

3.6 BATTERY CONNECTOR


A battery connector is a simple electrical contacts which are attached to the terminals of the battery
to connect it to the charger or to connect multiple cells.Here are two terminal contact positive and
negative.Both are connected to their respective terminals.

Fig:Battery Corrnector

3.7 LCD DISPLAY

LCD is combination of two states of matter, the solid and the liquid. LCD uses a liquid crystal to
produce a visible image. Liquid crystal display is composed of several layers which include two
polarized panel filters and electrodes. Light is projected from a lens on a layer of liquid crystal. An
LCD is either made up of an active matrix display grid or a passive display grid. The liquid has a
unique advantage of having low power consumption than the LED or cathode ray tube.

O-Crf(rrt+rC'-n-5
cloctoo600uJ

Fig: I6X2 LCD Display and its pin name

The Figure above shown is the !6X2 LCD display which is used to display a total character of t6*2=32
characters and each character will be made of 5*8 Pixel Dots.
It has a total number of 16 pins of which 8 are data lines.

Pin Description
Pin 1: This is ground pin of LCD
Pin 2: this provides 5V supply to the LCD
Pin 3: lt is used to control the brightness of the LCD.lts pin is usually connected to a POT.
Pin 4: lt is register select pin. lt toggles between (Command/Dato) Register
Pin 5: lt is Read/Write pin. lt toggle between (Read/Writel Commands.
Pin 6: ft is (Enoble) pin. lt must be high to perform (Read/Write)operations.
PinT-1,4: These pin are data lines which is used to transfer8 bits of data simultaneously.
Pin L4: This pin provide 5V supply to backlight UO of LCD screen.
Pin 16: This pin is the (Gro undl pin for Backlight LED.

Page | 10
I
r_
Data in LCD can be transferred in two mode
1. 4 bit mode:The data transferred in form of Nibble by nibble. In this mode only D0-D3 pins of
LCD are connected to microcontroller.

2. 8 bit mode: The data is transferred in form of byte. In this mode all the data lines (D0-D7)
are connected to the microcontroller.
An lC is integated in the LCD which takes command from Microcontroller and process them into
meaningful information.LiquidCrystal0 library funtion is used in Arduino to write code for the LCD
display.

3.8 RELAY

c(}Lsofr QO'L I{()ftIALLY CLO€ED


?ErcrrH l TERT}{AI.9 ilORrlALI.Y OPGI{
TENSilIAL TERHII{AI.
Figure: Strucure of an electromagnetic relay

A relay is a switching device which is used to control large voltages and current from small electrical
signal. Relays consist of an electromagnet and also a set of contacts. The switching mechanism is
carried out with the help of the electromagnet. lt has basically 5 pins from which two are used for
switching purpose. In the figure above, coil terminals are connected to an electromagnet. The
Common (COM) terminal is used to connect to main power supply.COM terminal is generally
connected to NC (Normally Closed) Terminal. For switching purpose, a small electrical signal is
applied to the coils terminals which energizes the coil and it behaves as an electromagnet, this pulls
the armature, which is held through springs, towards the NO (Normally Open) Terminals. For this
project a 5V Single Channel Single Pole Double Throw (SPDT) Relay module is used which is
compatible with Arduino. The Figure is shown below.

FIG:5V DC Single Channel SPDT Relay

Page | 11
3.9 PIPE
Pipe is a long hollow tube wich is used to transport liquid or gases from on container to other.The
Pipe which we have used in our project is made made up of PVC(Poly Vinyl Chloride). lt is transparent
and leak proof.The picture of pipe os shown below.

{}

\{*
FIG: PVC Pipe
3.10 POTENTIOMETER
Potentiometer is a variable resistor which is used to provide variavle resistance or voltages to the
circuit.The strip inside the potentiometer is the heart of the potentiometer.Strip provies variable
resistance one can adjest the knob of potentiometer to get required amount of resistance.it is
generally used in volume control of audio circuits,speed control of Motor,light dimming etc.

FIG: Rotary Potentiorneter


For our project we are using 10KO Rotary type potentiometer which is used to adjust the
brightness of the LCD Display.

3.11 RESISTOR
Resistance is two terminal passive electrical component which is used to provide opposition to the
flow of current through it.Resistor act to reduce current flow as well as reduce voltage level within
circuits. There are two types of resistor fixed and variable.

FIG: A Resistor

Fixed resistor have resistance that only changes slightly with temperature, time or operating voltage
where as the resistance in variable resistor can be adjusted.

Page | L2
3.T2 CONNE TING WIRES
Connecting wires allows an electrical current to travel from one point to another in an electrical
circuit because electricity needs a medium through which it can move. Most of the connecting wires
are made up of copper or aluminium. We have used PVC coated copper wire for connecting our
circuits and have used Jump wire to connect all the components through Arduino UNO.

Fig:Jtrrrrp \Afir(e and PVC coated Lab tAfire

3.13 CONTAINERS

Container are the any enclosures which are used for storage purpose.We have used two different
containers for storing water in it.ln our project one container act as water source where
submersible pump is submerged and other act as water tank.

3.T4 VOLTAGE REGULATOR

l
A voltage regulator is usedto regulate voltage level.lt generates fixed output voltage that remain i

constant for any changes in input voltage or load conditions.lt acts as abuffer for protection of
I

l
electronic components from damage.lt uses a simple feed forward design and negative loops. i

There are two types of Voltage regulators


1. Linear Voltage regualtors I

2. Switching voltage regulators l


Linear voltage regulators are easy to use and are compact and uses low power,low voltages. These l

are of two types Series and Shunt.Linear Regulator acts as voltage divider.ln ohmic region,it uses I
l

FET. The resistance of voltage regulator varies with load result in constant output voltage.We have 1

use 1M7805 Voltage regulator. I


I

I
l
l

I
I

.J -t

FIG: Voltage Regulator

Page | 13
CHAPTER 4

PROGRAMMING

Programming is an essential part for the working of microcontroller. Arduino Uno requires C/C++
language for its programming. C is a high level programming language. Programming defines which
ports/pin is to be used as input or output.lt controls the execution of the operations.

4.L IDE(lntegrated Development Environment)


An IDE is a software suite which contains basic tools and library functions which can be use to
develop software or test hardware.We have use Arduino IDE for the programming of
microcontroller ATmega328p because of its easy availability and wide range of library functions.

4.2 Step to program Arduino


1) Download Arduino lDE.
2l Install and run the software.
3) Write the required code.
4) Verify the Code by click on (,/)
5) Go to Tools, Board option then select the board which is to be used(Arduino UNO).
6) Connect the Board to the computer.
7l Again go to Tools and select port.
8) Upload the program by clicking on (s) option.

F|G:Arduino IDE Lrl

Page | 14
4.3 CODE
#incl ude<Liq idCrystal.h>
u

/ const int trigPin =10;


const int echoPin =9;
-,,
const int rs= 12,en =1 1,d4=5,d 5=4,d5=3,d7 =2;
LiquidCrystal lcd(rs,en d4,d5 d6 d7l;
| | defines variables
long duration;
int motor=7;
i nt d ista nce, level,vol;

void setup0
{
lcd.begin (L6,21;
pinMode(trigPin, OUTPUTI; ll Sets the trigPin as an Output
pinMode(echoPin, INPUT); | | Sets the echoPin as an Input
pi n Mode( motor,O UTPUT);
Serial.begin(950011; | | Starts the serial communication
)
void loopfl
{
| | Clears the trigPin
digitalWrite(trigPin, LOW);
delayM icroseconds( 2 );
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPi n, H IGH);
delayM icrosecon ds( 10);
digitalWrite(trigPin, LOW);
| | Reads the echoPin, returns the sound wave travel time in
microseconds
duration = pulseln(echoPin, HIGH);
| | Calculating the distance
d istance=((d u ration *0.03 ql / 2l;
;"u";=(20-distance);
vol=(3. 14* L0* L0* level)*0.001;
if(distance<=3)
{
d igitalWrite(motor,H lG H);
lcd.clear0;
lcd.setCursor(0,0);
lcd.print("MOTOR lS OFF");
lcd.setCursor(0,1);
lcd.print("Water level: ");
lcd.print(vol);
delay(500);
\)
\--****

Page I
else if (distance>=4 && distancea=16)
{
lcd.clear0;
lcd.setCursor(0,1);
lcd.print("Water level: ");
lcd.print(vol);
delay(500);
)
else if(distance>=17)
{
d igitalWrite(motor, LOW);
lcd.clear0;
lcd.setCursor(0,0);
lcd.piint("MOTOR lS RUN NING");
lcd.setCursor(0,1);
lcd.print("Water level: ");
lcd.print(vol);
delay(500);
)
)

Page | 15
CHAPTER 5

WORKING PROCEDURE OF CIRCUIT

which is a distance
The water Level Detector and controller consist of an Ultrasonic Transducer
pin is set to HIGH for
measuring device. lts transmitter produces sonic burst at 40 kHz when trigger
the
lols.After sonic burst has been sent the ECHO pin will remain to HIGH state until it receives
sonic burst which will be reflected back from nearby object after striking
with it. When ECHO pin
receives reflected waves it goes to logic LOW state and remain in LOW state
until TRIGGER pin goes
HIGH. The time of HIGH state to LOW state of ECHO pin measures the time
taken by wave to strike
of sound and the
with the object and reach back to the module. This time is multiplied with speed
distance is calculated as follow:
We know that speed of sound,v = 340 m/s
= 0.034 cm/ps
Also, Time(t)= Distance(s)/Speed(v)
t=sl B
s= 19*t
Therefore,d istance
s=(t*0.034)/2
in the
The ultrasonic module is control by Microcontroller ATmega328p which is embedded
development board known as Arduino uNo (R3).The micro-controller receives
the time from
in micro-controller'
Ultrasonic transducer and calculates distance based on the program written

A relay module is interfaced with the Arduino which uses logic LOW signal
for switching (Turn ON)'
produces sonic bursts continuously
The ultrasonic transducer is fixed in an tank of hight zocm which
transducer
when device is turned on. Initially the motor is turned oFF but when distance between
signal which activates the
and water level is 3 cm or more then microcontroller produces logic LOW
reaches near Ultrasonic
relay and the motor attached with the relay is turns ON. When water level
produces logic HIGH
transducer and the distance between them is 3 cm or less, the micro-controller
signal which de-activates the relayand motor is turns oFF. The motor
remain oFF until the distance

between transducer and water level increases to 17 cm or more'

in the circuit
An LCD display is also interfaced with Arduino. The connection of the LCD is shown
row is use to
diagram shown in chapter 2 topic 2.2. lt has two rows for displaying data,second
indicate the current volume of water present in the tank. First row indicate
whether motor is turned
"MoToR ls oFF"'
oN or oFF. When relay is activated,the LCD displays "MoToR ls RUNNING" else

The 12V
This circuit requires 12 D.C supply for Arduino and 5V D.C for rest for the components'
Barrel Jack' Two
supply is taken directly from 12v DC charger and is feed to the Arduino through
Linear voltage regulators(78o5) is used to provide constant DC supply. The
input pin of regulators
are connected with the 12V supply and ground is connected to the Sround
of charger i'e neSative

terminal. The 5v output is taken from pin 3 and is connected to the vcc of other
components'

Page | 17
CHAPTER-6

RESU LT

ln our project Ultrasonic transducer and Microcontroller are the core of Water level Detector
and
pumping
controller. The objective of circuit is to automatically turn ON and turn OFF the water
system.
It uses LCD display to indicate the water present in the water tank and the current condition of
pumping system. lt minimize the loss of water due to overflow from the tank.

of the
The Ultrasonic Transducer of Water Level Detector and Controller is to be installed on the top
tank such that it can measure the height of water present in the tank from top to bottom. When
water level reaches to the maximum defined height the motor automatically turns OFF and when
water level reaches to minimum defined level the motor turns ON automcatically. This eliminates
the problem of turning ON/OFF the motor manually by an individual.

In this way, it can saves water overflow from tank and aslo saves electrical energy require for
pumping system. lt also helps in reducing manual works as circuit is automatic. The experimental
were
model was made according to the circuit diagram show in chapter 2 topic 2.2 and the result
as expected.

For measuring the efficiency of the proposed water level indicator, w€ took a few actual
measurement by a ruler and compared it with the reading found from the LCD display'

AccuracY of Sensor
.] ti

1f\

I i)

1fl

q, t)
c*
'6

-! tt
6 i0 1: 14 i6 r8 2il l: 1tr li SU

Actual Distance{cm}+

The following graph shows the actuat vs obtained output plot.The result shows that the output
is

pretty accurate and useful.

Page | 18
CHAPTER-7
t.Advantages of the Proiect

o The pumping system is ful;ly automatic, hence required no human attenstion'


. Easily awares when water tank is full
o lndicates the volume of water present in the tank'
o Dry run-out Protection.
o Low cost
tt.Limitation of the Proiect

o Ultrasonic sensor is normally ON hence requires continuous power supply'


o Program modification is required for different tanks
o External power is required for circuit'
o This project may not be able to handle high power, higher rating relay is
req u ired.

Page lle
CHAPTER-8

CONCLUSION

As stated through the previous column of our project work, out aim was to solve
the problem of
manually turning ON/OFF of water pumping system and to eliminate the water
overflow from the

tank. Our project"Water Level Controller and Detecto/' is solution to eradicate


this problem'The
water volume
circuit used in our project automatically controls the water pump and indicates the
in the tank.

can measure upto


Our project is a prototype of the original circuit and the Ultrasonic Sensor used
great
few metre of depth. An Ultrasonic sendor of high magnitude/range can be used to measure
depth/distance to solve this distance limitation.

The future scope of this project includes implementation ina a multi-storied building and with
multiple pumping systems and tanks.

Page | 20
APPENDIX

1.. Cos t onolvsis of oroiect


QuantitY Cost(RuPees)
Name of ltems
1 525
1. I lrduino UNO (R3)
1 20
2. Perfboard
L 160
3. Ultrasonic Transducer
L 160
4. Submersible PumP --
1 40
5. 9V D.C BatterY
1 10
6. Battery Connector
L 200
7. Display
1 150
8. Relay
L 50
9. Pipe
1 r0
10. Potentiometer
L 2
LI Resistor
2 200
L2. Containers
as required 100
13. Wires & JumPer
L 20
L4. Voltage Regulator
1 100
15. Casing (BOX)
L747
Total

2. Software Used.
o Arduino IDE
. Fritzing

3.PhotograPh of the Proiect'

Page | 21
REFERENCE

Books:

o Principle of electronics

by V.K Mehta,M.K Mehta

. Electronics fundamentals

By David M. Thomas,Buchle l. FloYd

Websites:

http:'wW.electronicshub.org
http:'www.circuitdigest.com
https: //www.a rd u i no.cc

https: vww.voutube.com

Page | 22

You might also like