Arduino B.Tech/Diploma Beginner

Arduino Water Flow Sensor to Measure Flow Rate & Volume

Arduino Water Flow Sensor to Measure Flow Rate & Volume: interface YFS201 Hall Effect Water Flow Sensor with Arduino. Code & circuit diagram

  • Suitable forB.Tech/Diploma Arduino students
  • Build time1-2 weeks
  • LevelBeginner
  • Available atAjvika Labs, Kakinada

About this project

Introduction:
In this project, we will
interface YFS201 Hall Effect Water Flow Sensor with Arduino
for measuring
flow rate
and
volume of water
or any other
liquid
. This is a very wonderful project that can be used in industry or at home or at
water flow measurement application
in water tap, tunnel, river, etc. Water Flow Sensor for
Flow Rate & Volume Measurement using Arduino
code along with the circuit diagram is explained below.
This project can be used to measure liquid flowing through a pipe or container or to create a control system based on the water flow rate or quantity. For example, you could use this while gardening to measure the amount of water used to water your plants, to prevent wastage. Or you can use it to make
Water Dispenser Machine
used in industry and drinks items.
Check the advance version of this Project to monitor Water Flow Rate & Volume Remotely:
IoT Water Flow Meter using ESP8266
Water Flow Sensor for Flow Rate & Volume Measurement using Arduino:
Bill of Materials
S.N.
Components Name
Quantity
Purchase Links

Arduino UNO Board

Amazon
AliExpress

YFS201 Hall Effect Water Flow Sensor

Amazon
AliExpress

16x2 LCD Display

Amazon
AliExpress

Potentiometer 10K

Amazon
AliExpress

Connecting Wires

Amazon
AliExpress

Breadboard

Amazon
AliExpress
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, D2.
Connect
YFS201 Hall Effect Water Flow Sensor
VCC pins to 5V Power supply & GND to GND. Since it’s an analog sensor, so connect its analog pin to A0 of Arduino as shown in the figure above.
YFS201 Hall Effect Water Flow Sensor:
Introduction:
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.
Check the
YF-S201 Hall Effect Water Flow Meter / Sensor Datasheet
The sensor comes with three wires: red (5-24VDC 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. It will need careful calibration if better than 10% precision is required. However, it’s great for basic measurement tasks!
Features of Flow Sensor:
Model: YF-S201
Sensor Type:
Hall effect
Working Voltage:
5 to 18V DC (min tested working voltage 4.5V)
Max current draw:
15mA @ 5V
Output Type:
5V TTL
Working Flow Rate:
1 to 30 Liters/Minute
Working Temperature range:
-25 to +80℃
Working Humidity Range:
35%-80% RH
Accuracy:
±10%
Maximum water pressure:
2.0 MPa
Output duty cycle:
50% +-10%
Output rise time:
0.04us
Output fall time:
0.18us
Flow rate pulse characteristics:
Frequency (Hz) = 7.5 * Flow rate (L/min)
Pulses per Liter:

Durability:
minimum 300,000 cycles
Working of YFS201 Hall Effect 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.
The 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
Source Code/Program:

#include <LiquidCrystal.h>
LiquidCrystal
lcd
(

)
;
int
;
int
Y
;
float
TIME
=

;
float
FREQUENCY
=

;
float
WATER
=

;
float
TOTAL
=

;
float
LS
=

;
const
int
input
=
A0
;
void
setup
(
)
{
Serial
begin
(
9600
)
;
lcd
begin
(

)
;
lcd
clear
(
)
;
lcd
setCursor
(

)
;
lcd
(
“
Water
Flow
Meter
”
)
;
lcd
setCursor
(

)
;
lcd
(
“
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
”
)
;
delay
(
2000
)
;
pinMode
(
input
INPUT
)
;
}
void
loop
(
)
{
=
pulseIn
(
input
HIGH
)
;
Y
=
pulseIn
(
input
LOW
)
;
TIME
=
+
Y
;
FREQUENCY
=
1000000
/
TIME
;
WATER
=
FREQUENCY
/
7.5
;
LS
=
WATER
/

;
if
(
FREQUENCY
>=

)
{
if
(
isinf
(
FREQUENCY
)
)
{
lcd
clear
(
)
;
lcd
setCursor
(

)
;
lcd
(
“
VOL
:
0.00
”
)
;
lcd
setCursor
(

)
;
lcd
(
“
TOTAL
:
”
)
;
lcd
(
TOTAL
)
;
lcd
(
”
L
”
)
;
}
else
{
TOTAL
=
TOTAL
+
LS
;
Serial
println
(
FREQUENCY
)
;
lcd
clear
(
)
;
lcd
setCursor
(

)
;
lcd
(
“
VOL
:
“
)
;
lcd
(
WATER
)
;
lcd
(
”
L
/
M
”
)
;
lcd
setCursor
(

)
;
lcd
(
“
TOTAL
:
”
)
;
lcd
(
TOTAL
)
;
lcd
(
”
L
”
)
;
}
}
delay
(
1000
)
;
}
Video Preview & Demonstration:
Water Flow Rate & Volume Measurement using Water Flow Sensor & Arduino
Watch this video on YouTube
Check the advance version of this Project to monitor Water Flow Rate & Volume Remotely:
IoT Water Flow Meter using ESP8266

Technologies used

ESP8266ArduinoLCD

Hardware components

  • ESP8266
  • Arduino

Software & tools

  • Arduino IDE

What you get

  • Working project / hardware kit, tested before delivery
  • Complete source code with explanation
  • Project demo and guidance for your viva
  • Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed. Payment is in two parts: • 50% advance to start the project • Remaining 50% before delivery Note: • Documentation and PPT are not included by default • If you need documentation/PPT, it can be arranged for extra time and cost We'll confirm the exact timeline and cost with you after reviewing your requirements.