Professional Documents
Culture Documents
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
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.
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
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
1 INTRODUCTION 06
2 REVIEW OF LITERATURE 07
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.
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.
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:
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:
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.
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.
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:
#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