• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

New Projects | Privacy Policy | About us | Contact | Disclaimer | Copyright | Videos | Circuits for Beginners | Basic Circuits | Hobby Projects | Transistor Circuits | LED Drivers 

You are here: Home / Arduino Engineering Projects / Simple Digital Water Flow Meter Circuit using Arduino

Simple Digital Water Flow Meter Circuit using Arduino

Last Updated on February 23, 2020 by Swagatam

caution electricity can be dangerous

In this post we are going to construct a digital water flow meter using Arduino and 16 x 2 LCD display. We will be taking a look at YF-S201 water flow sensor, its construction and working and how to interface with Arduino to extract some useful readings.

The proposed project can measure the rate of water flow in litre / minute and total water flow in litres.

Let’s take a look at YF-S201 water flow sensor.

Illustration of YF-S201:

YF-S201 is a Hall Effect based water sensor. It has three terminals 5V (nominal working voltage), GND and output. The +5V is red coloured wire, the black one is GND and yellow one is output.

The sensor gives out frequency directly proportional to water flow. The YF-S201 sensor can measure from 1 litre / minute to 30 litre / minute. The water pressure should be less than or equal to 1.75 MPa.

The water can be injected from one end and water flows through the other end.

The sensor may be placed after the main gate-valve of tank; if you want to measure the water flow in a network of water pipes or you can place just before a water tap to measure the water flow of single tap.

The placement of the sensor can be anywhere according to user’s need but, care must be taken to avoid leakage of water.

The sensor has a magnet and Hall Effect sensor; if we take a look at the sides of the water flow sensor, we can witness a plastic turbine in the path of water flow.

A round shaped magnet is embedded at the center of the turbine and the Hall Effect sensor is sealed and protected from moisture and placed above the magnet. The Hall Effect sensor produces a pulse for every revolution of the turbine.

Water Flow Waveform on Serial Plotter

We can see the pulses generated by water flow sensor on serial plotter of arduino IDE, shown below (Using Arduino Single channel Oscilloscope).

We have blown air through the sensor to rotate the turbine as a test and the waveform generated is shown above. The denser waveform on left hand side represents higher frequency and faster rotation of turbine, the less dense waveform at right hand side signifies the vice versa.

A consistent water flow gives out consistent frequency output.

We have to convert the frequency into litre/minute scale. To do this, the manufacturer has given a formula:

Water flow rate (litre/min) = frequency / 7.5

So, we need to measure the generated frequency and apply the above formula in the program code.

Technical Specifications of YF-S201:

·        Accuracy: +/- 10%, if you need better precision, we need to calibrate.

·        Working Temperature: -25 to + 80 degree Celsius.

·        Working humidity: 35% to 80% RH.

·        Output duty cycle: 50% +/- 10%.

·        Maximum water pressure: 1.75 MPa.

·        Pulses per Litre: 450.

·        Maximum current draw: 15 mA at 5V

That concludes the YF-S201 water flow sensor.

Now let’s move to the schematic.

Schematic Diagram:

The water flow sensor’s output pin is connected to A0 of Arduino. Use the 10K potentiometer for adjusting display contrast. Wire the Arduino and LCD display as per the above diagram.

Program Code:

//-----Program Developed by R.Girish-----//
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int X;
int Y;
float Time = 0;
float frequency = 0;
float waterFlow = 0;
float total = 0;
float LS = 0;
const int input = A0;
const int test = 9;
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);
pinMode(test, OUTPUT);
analogWrite(test,100);
}
void loop()
{
X = pulseIn(input, HIGH);
Y = pulseIn(input, LOW);
Time = X + Y;
frequency = 1000000/Time;
waterFlow = frequency/7.5;
LS = waterFlow/60;
if(frequency >= 0)
{
if(isinf(frequency))
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("L/Min: 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("L/Min: ");
lcd.print(waterFlow);
lcd.setCursor(0,1);
lcd.print("Total: ");
lcd.print(total);
lcd.print(" L");
}
}
delay(1000);
}
//-----Program Developed by R.Girish-----//

Author’s Prototype:

The “L/Min” indicates the current water flow rate and the “Total” indicates the total water flowed since the circuit turned ON.

You can also flow any liquids whose viscosity value is near to water.

If you have any questions regarding this digital water flow meter using Arduino, feel free to express in the comment section, you may receive a quick reply.

You'll also like:

  • 1.  Car Reverse Parking Sensor Circuit with Alarm
  • 2.  Digital Clock Activated Water Level Controller Circuit
  • 3.  2 Simple Arduino Temperature Meter Circuits Explored
  • 4.  Simple TV Transmitter Circuit
  • 5.  2 Simple Voltage to Frequency Converter Circuits Explained
  • 6.  Automatic Street Light Dimmer Circuit

About Swagatam

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials.
If you have any circuit related query, you may interact through comments, I'll be most happy to help!

Have Questions? Please Comment below to Solve your Queries! Comments must be Related to the above Topic!!

9 Comments
Newest
Oldest
Inline Feedbacks
View all comments

Primary Sidebar

Calculators

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (52)
  • 4060 IC Circuits (25)
  • 555 IC Circuits (98)
  • 741 IC Circuits (19)
  • Arduino Engineering Projects (83)
  • Audio and Amplifier Projects (114)
  • Battery Chargers (82)
  • Car and Motorcycle (94)
  • Datasheets (46)
  • Decorative Lighting (Diwali, Christmas) (33)
  • Electronic Components (100)
  • Electronic Devices and Circuit Theory (36)
  • Electronics Tutorial (116)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Fun Projects (13)
  • GSM Projects (9)
  • Health Related (20)
  • Heater Controllers (29)
  • Home Electrical Circuits (102)
  • How to Articles (20)
  • Incubator Related (6)
  • Industrial Electronics (28)
  • Infrared (IR) (40)
  • Inverter Circuits (98)
  • Laser Projects (12)
  • LED and Light Effect (93)
  • LM317/LM338 (21)
  • LM3915 IC (25)
  • Meters and Testers (65)
  • Mini Projects (148)
  • Motor Controller (67)
  • MPPT (7)
  • Oscillator Circuits (26)
  • PIR (Passive Infrared) (8)
  • Power Electronics (34)
  • Power Supply Circuits (77)
  • Radio Circuits (10)
  • Remote Control (48)
  • Security and Alarm (61)
  • Sensors and Detectors (121)
  • SG3525 IC (5)
  • Simple Circuits (75)
  • SMPS (29)
  • Solar Controllers (60)
  • Timer and Delay Relay (53)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (40)
  • Ultrasonic Projects (16)
  • Water Level Controller (45)

Calculators

  • AWG to Millimeter Converter
  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator

© 2023 · Swagatam Innovations

wpDiscuz