You are on page 1of 19

Accelerat ing t he world's research.

Measuring water Flow Rate and


Volume using Arduino and Flow
Sensor By
Muhammad Tahir

Final Year Project

Cite this paper Downloaded from Academia.edu 

Get the citation in MLA, APA, or Chicago styles

Related papers Download a PDF Pack of t he best relat ed papers 

Measuring wat er flow rat e and Volume using arduino and flow sensor
DADI T IRUMALA TARUN

Single Phase aut o reclosing Prot ect ion Syst em of Double Circuit Transmission Line Based on Fuzzy L…
Engr. Talha Arshad

RANCANG BANGUN PROT OT IPE ALAT PENCATAT PEMAKAIAN BAHAN BAKAR PADA SEPEDA MOT OR D…
Adet ia Prat ama
Measuring water Flow Rate and Volume using Arduino and Flow Sensor
By
Muhammad Tahir
2017-ag-7509
B. Sc Agricultural Engineering

A Project and Report-2 submitted in the fulfillment of requirements for the


Degree of
Bachelor of Sciences
In
Agricultural Engineering
To
Engr. Rao Husnain Arshad
DEPARTMENT OF IRRIGTAION & DRAINAGE
FACULTY OF AGRICULTURAL ENGINEERING & TECHNOLOGY,
UNIVERSITY OF AGRICULTURE
FAISALABAD, PAKISTAN
2021

1
CERTIFICATE

Certified that this project report “Measuring water Flow Rate and Volume

using Arduino and Flow Sensor” is the bonafide work of Muhammad Tahir
(2017-ag-7509) who carried out the project work under my supervision.

Engr. Rao Husnain Dr. Muhammad Adnan Dr. Muhammad Arshad


Supervisor Chairman Dean

DEPARTMENT OF IRRIGTAION & DRAINAGE


FACULTY OF AGRICULTURAL ENGINEERING & TECHNOLOGY,
UNIVERSITY OF AGRICULTURE
FAISALABAD, PAKISTAN
2021

2
ACKNOWLEDGEMENT

All praise to ALLAH, lord of all the worlds, the most Affectionate, the
most Merciful, who taught writing by pen, taught me what I knew not. After the
Almighty Allah, all praise and thanks to the Holy Prophet Muhammad (P.B.U.H)
who is forever a model of guidance and knowledge for humanity. I would like to
express my special thanks of gratitude to my project guide Iftikhar Ahmad as well
as our Supervisor Engr. Rao Husnain Arshad, Lecturer Dept. of Irrigation & Drainage
Faculty of Agricultural Engineering and Technology UAF who gave me the golden

opportunity to do this wonderful project on the topic “Measuring water Flow Rate
and Volume using Arduino and Flow Sensor”, which also helped me in doing a
lot of research and i came to know about so many new things. We are grateful to
her ever-inspiring guidance, keen interest, scholarly comments and constructive
suggestions throughout the course of our studies. May Allah almighty infuse us
with the energy to fulfill his noble inspiration and expectation and to further
modify our competence. May Allah bless him with long happy and peaceful life.
Secondly I would also like to thank my parents and friends who helped me
a lot in finalizing this project within the limited time frame.

3
ABSTRACT

The irrigation systems modernization is a part of the water resources management


improvement process which requires a decision support system, the core of such system is
an automated procedure for simulating the relevant processes governing the system. Water
is nessarcy thing to sustain life on earth but due to poor management the resourses of pure
water decrease day by day. This infulation is due to Poor check and balance on Well
Drilling and installing pump. Discharging of Groundwater is increased to dangerous level
and recharging is so less that we are handling this problem by automation process, and the
most common sensor which we used to measure the flow of a liquid is a Flow Sensor.

By using a flow sensor with a microcontroller like Arduino, we can calculate


the flow rate, and check the volume of liquid that has drilled through the GroundWater
table, and control it as required. Apart from water management, flow sensors can also be
found in the agriculture sector, food processing, manufacturing industries, mining industry,
water recycling, coffee machines etc. Further, a water flow sensor will be a good addition
to projects like Automatic water dispenser and smart irrigation systems where we need to
monitor and control the flow of liquids.

In this project, we are going to build a water flow sensor using Arduino. We will interface
the water flow sensor with Arduino and LCD, and program it to display the volume of
water, which has passed through the valve. For this particular project, we are going to use
the YF-S201 water flow sensor, which uses a hall effect to sense the flow rate of the liquid.

4
TABLE OF CONTENTS

CHAPTER # TITLE PAGE #

1 INTRODUCTION 06

2 REVIEW OF LITERATURE 07

3 MATERIALS AND METHODS 09

4 RESULTS AND CONCLUSION 13

5 FUTURE SCOPE 14

6 SOURCE CODE 15

7 REFERANCES 18

5
INTRODUCTION

Water is very important to the Living Organism. Every one of Living Organism
use water to help with temperature regulation, keeping hydrated and maintaining bodily
functions.According to calculation Earth cover with 71% of water by area but pure water
is only 1% But due to High Discharge and Low Recharging Groundwater and Rivers water
The amount of drinkable water decrease day by day. According to Survey Asian countries
add in the list of Water Scarcity countries in 2025. So we need to giving attention on this
issue before we fall in this problem. Main problem is that we don’t think that we are wasting
water. This automation Project attach with the main water supply and everyone see the
amount of water that they use and in future we do some modification this project and
convert this system into utility sytem.

Flow rate and volume helps tell the amount of fluid going into, or through a particular
vessel. For certain process automation applications, this simple-sounding fluid
measurement task is so critical to the success of the project that, failure to get it right, could
bring the entire process to its knees.The water flow sensor uses the principles of
electromagnetism, such that, when liquids flow through the sensor, the flow action impacts
the fins of a turbine in the sensor, causing the wheel to spin. The shaft of the turbine wheel
is connected to a hall effect sensor so that with every spin, a pulse is generated, and by
monitoring that pulse with a microcontroller, the sensor can be used in determining the
volume of fluid passing through it. As the microcontroller for today, we will use the
Arduino Uno. The Uno will be used to count the number of pulses detected over time and
calculate the flow rate (in liters/hour) and total volume of fluid that has passed through it
using the total number of pulses. The result, flow rate and volume, will then be displayed
on a 16×2 LCD so as to provide a visual feedback to the user. To make reading the sensor
and calculating flow easy, the interrupt feature of the Atmega328p on the Ardunio is
employed, as such, the signal pin of the YF-S201 is connected to one of the interrupt-
enabled IOs of the Uno (in this case, pin D2). The LCD, on the other hand, is connected in
a 4-bit mode to the Arduino. To save some time on connections, you could also decide to
use an I2C enabled version of the 16×2 LCD display. For this, you will only need to connect
4 wires from the display to the Arduino.

6
REVIEW OF LITERATURE

Kuganesan Kumar, MoaminA. Mahmoud [1] have developed an online Mobile app that
monitors and controls the water flow through taps whenever there is an unusual Reading
of the water usage at home. The developed App enables a user in monitoring and
Controlling the water flow at home via an online mobile application’s graphical user
interface (GUI).This makes the monitoring process more efficient and convenient for house
owners.

Rasin,Z.;Hamzah,H.;Aras,M.S.M [2] resolves the problem of the manual analytical


method Adopted in water flow detection with bad real-time character, this paper introduces
a remote Water flow measuring and monitoring system. It has used wireless sensor network
based on the ZigBee to realize the water quality parameter remote probing and the real-
time monitoring Smart water flow control and monitoring system 2017-2018.

Zulhani Rasinand Mohd Rizal Abdullah [3] make a application which is particularly Used
for wireless networks, specifically a water equitable distribution and monitoring system is
Been used. A possible communication system for the water equitable distribution and
monitoring the quality, and describe our channel measurement approach is proposed.

Ejio for VirginiaEbere, Oladipo Onaolapo Francisca [4] use microcontroller for the
automatic Water level monitor with feedback, having passed her necessary tests with the
other components interfaced to it, is here by presented. With this implemented system, it is
possible to monitor the water level in an over-head tank, switch on the water pump when
the tank is empty and switch off the same pump when the tank is full without any need for
human intervention. By so doing, the incidence of water wastage is eliminated and abrupt
cut-off of water supply is equally also eliminated.

T.Deepiga, A.Sivasankari [5] developing an efficient wireless sensor network (WSN)


based water monitoring system. Three different ways to monitoring the water such as water
level monitoring, water pollution monitoring and water pipe line leakage monitoring.
Finally the water monitoring system of smart homes/office research concept will be
completed by using wireless sensor technology.

7
FrankA. Richerand [6] The system will consist of monitors in tandem or as required
working in Conjunction with inter face probes reading in multiple locations, and diversion
valves directly Operated based on the output of the interface probe sand monitors. The
probes relay the water Interface location at multiple locations throughout the process and
send that data to a Programmable Logic Controller (PLC).

8
MATERIALS AND METHODS

Require Material:

Sr COMPONENTS DESCRIPTION QUANTITY


1 Arduino Board Arduino UNO R3 1
2 Water Flow Sensor YFS201 Hall Effect 1
3 LCD Display 16x2 LCD 1
4 Connecting Wires Jumper Wires 40
5 Breadboard simple 1
6 LED 5mm 2
7 Resistor 1k 2

METHODOLOGY

The circuit diagram is shown in the figure 1.1. In circuit diagram, Connect the LCD pin 1,
3, 5, 16 to GND & 2, 15 to 5V VCC. And then connect LCD pins 4,6,11,12,13,14 to
Arduino digital pins D7, D6, D5, D4, D3, and D2. Connect YFS201 Hall Effect Water
Flow Sensor VCC pin (red wire) to 5V Power supply & GND pin (black wire) to Arduino
GND. Since it’s an analog sensor, so connect its analog pin to A0 of Arduino. So connect
LED positive wire to 1k resistor positive side and connect to with analog pin of sensor
(yellow wire) and put the negative side of LED in A0 of Arduino. So when YFS201 Hall
Effect Water Flow Sensor start working LED light start glowing. Voltage measuring meter
is connect on Breadboard Input wires, which show the operating voltage of sensors.

9
Circuit Diagram:

Fig 1.1

Working Principle: In my project, I connected the water flow sensor to a pipe. If the
output valve of the pipe is closed, the output of the water flow sensor is zero (No pulses).
There will be no interrupt signal seen at the pin 2 of the Arduino, and the count of the flow
frequency will be zero. In this condition, the code which is written inside the else loop will
work. If the output valve of the pipe is opened. The water flows through the sensor, which
in turn rotates the wheel inside the sensor. In this condition, we can observe pulses, which
are generated from the sensor. These pulses will act as an interrupt signal to the Arduino
UNO. For every interrupt signal (rising edge), the count of the flow frequency variable will
be increased by one. The current time and cloopTIme variable ensure that for every one
second the value of the flow frequency is taken for calculation of flow rate and volume.
After the calculation is finished, the flow frequency variable is set to zero and the whole
procedure is started from the beginning.

10
Apparatus:

1. YFS201 Hall Effect Water Flow Sensor: This


sensor sits in line with your water line and
contains a pinwheel sensor to measure how
much liquid has moved through it. There’s an
integrated magnetic Hall Effect sensor that
outputs an electrical pulse with every
revolution. The Hall Effect sensor is sealed from the water pipe and allows the
sensor to stay safe and dry. The sensor comes with three wires: red (5-12VDC
power), black (ground), and yellow (Hall Effect pulse output). By counting the
pulses from the output of the sensor, you can easily calculate the water flow rate.
Each pulse is approximately 2.25 milliliters. Note: This isn’t a precision sensor, and
the pulse rate does vary a bit depending on the flow rate, fluid pressure, and sensor
orientation.
2. ARDUINO UNO REV R3: is a microcontroller
board based on the ATmega328P (datasheet). It
has 14 digital input/output pins (of which 6 can
be used as PWM outputs), 6 analog inputs, a 16
MHz ceramic resonator (CSTCE16M0V53-R0),
a USB connection, a power jack, an ICSP header and a reset button. It contains
everything needed to support the microcontroller; simply connect it to a computer
with a USB cable or power it with an AC-to-DC adapter or battery to get started.
3. LCD DISPLAY: can display 16 characters
per line and there are 2 such lines. In this
LCD each character is displayed in 5x7 pixel
matrix. The 16 x 2 intelligent alphanumeric
dot matrix display is capable of displaying 224 different characters and symbols.

11
Working Principle of Water Flow Sensor: The Water Flow Sensor for Flow Rate &
Volume Measurement using Arduino works on the principle of the Hall Effect. According
to the Hall Effect, a voltage difference is induced in a conductor transverse to the electric
current and the magnetic field perpendicular to it. Here, the Hall Effect is utilized in the
flow meter using a small fan/propeller-shaped rotor, which is placed in the path of the liquid
flowing.

Fig 1.2 (working principle of water flow sensor)

Liquid pushes against the fins of the rotor, causing it to rotate. The shaft of the rotor is
connected to a Hall Effect sensor. It is an arrangement of a current flowing coil and a
magnet connected to the shaft of the rotor, thus a voltage/pulse is induced as this rotor
rotates. In this flow meter, for every liter of liquid passing through it per minute, it outputs
about 4.5 pulses. This is due to the changing magnetic field caused by the magnet attached
to the rotor shaft. We measure the number of pulses using an Arduino and then calculate
the flow rate in liters per hour (L/hr) and total volume in Litre using a simple conversion
formula.

12
EXPERIMENTAL RESULT: This project has successfully monitoring the Flow
and Volume of water automatically. Thus we can check how much water we use on daily
basis.

CONCLUSION: Designed a smart system capable of controlling the water


automatically. This project is of low cost and the efficiency of the project is more compared
to the previous methods. Using this project, automatic controlling and monitoring the flow
of water is done. Thus, required amount of water is discharged. Same methodology can be
implemented in case of any fluids in the industries. The disadvantage of the previous
systems, which required manpower was eliminated. This real time project represents a
solution for easy and automated management of water which helps in preventing wastage
of water. We simple check the volume of water and after desire amount simple
automatically trip.

13
Future scope

There is no restriction on water use in Asian countries spacially in Pakistan, Due to this
resourses of fresh water decrease day by day, groundwater depth increase day by
day.According to survey Pakistan add in the list of water scarcity zone in 2025. Then we
take this problem seriously and then government install water utility system so in future we
convert this project to water utility machine by doing some modifications. We develop a
water utility system where people can go to fetch water and insert their cards with some
credit on them and when they do so, the system first accepts the payment before it dispenses
the water equivalent to the credit paid. For that system we use RFID System and a keypad.
Rfid for access controlling and keypad for selecting amount/volume of water that is to be
drawn.

14
Source Code:

//Measuring Water flow rate using Arduino

// Program Written By Engr. ASIM RAZA

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
int X;
int Y;
float TIME = 0;
float FREQUENCY = 0;
float WATER = 0;
float TOTAL = 0;
float LS = 0;
const int input = A0;
void setup()
{
Serial.begin(9600);
lcd.begin(16, 2);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“Water Flow Meter”);
lcd.setCursor(0,1);
lcd.print(“****************”);
delay(2000);
pinMode(input,INPUT);
}
void loop()
{
X = pulseIn(input, HIGH);

15
Y = pulseIn(input, LOW);
TIME = X + Y;
FREQUENCY = 1000000/TIME;
WATER = FREQUENCY/7.5;
LS = WATER/60;
if(FREQUENCY >= 0)
{
if(isinf(FREQUENCY))
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“VOL. :0.00”);
lcd.setCursor(0,1);
lcd.print(“TOTAL:”);
lcd.print( TOTAL);
lcd.print(” L”);
}
else
{
TOTAL = TOTAL + LS;
Serial.println(FREQUENCY);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“VOL.: “);
lcd.print(WATER);
lcd.print(” L/M”);
lcd.setCursor(0,1);
lcd.print(“TOTAL:”);
lcd.print( TOTAL);

16
lcd.print(” L”);
}
}
delay(1000);
}

17
References:
1. Kuganesan Kumar, Moamin A.Mahmoud “Monitoring and Controlling Tap Water
Flow at Homes Using Android Mobile Application”. American Journal of Software
Engineering and Applications. Vol.6, No.6, 2017
2. Ejio for Virginia Ebere, Oladipo Onaolapo Franciscaentitled “Microcontrollerbased
Automatic Water Level Control System” Vol.1, Issue6, August2013
3. FrankA.Richerand“Smart Water Discharge and monitoring system” Aug.12,2011
4. http://www.engineeringtoolbox.com/flow-meters-d_493.html [Accessed 26 July
2013].
5. https://circuitdigest.com/

18

You might also like