• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Contact | Calculators-online
You are here: Home / Arduino Projects / Simple Digital Water Flow Meter Circuit using Arduino

DIY Circuits | Learn Basics | Arduino Coding




Simple Digital Water Flow Meter Circuit using Arduino

Last Updated on November 6, 2025 by Swagatam 9 Comments

In this post I will show how 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:

//-----Improved Version, Based On Original Design-----//

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

unsigned long X, Y;
float Time = 0;
float frequency = 0;
float waterFlow = 0;
float total = 0;
float LS = 0;

const int inputPin = A0;

void setup() {
  Serial.begin(9600);
  lcd.begin(16, 2);

  lcd.setCursor(0, 0);
  lcd.print("Water Flow Meter");
  lcd.setCursor(0, 1);
  lcd.print("Initializing...");
  delay(2000);

  pinMode(inputPin, INPUT);
}

void loop() {

  // Measure pulse widths
  X = pulseIn(inputPin, HIGH, 1000000); 
  Y = pulseIn(inputPin, LOW, 1000000);

  if (X == 0 || Y == 0) {
    // No pulses detected
    lcd.setCursor(0,0);
    lcd.print("L/Min: 0.00     ");

    lcd.setCursor(0,1);
    lcd.print("Total: ");
    lcd.print(total);
    lcd.print(" L   ");

    delay(500);
    return;
  }

  Time = X + Y; // microseconds
  frequency = 1000000.0 / Time; 
  waterFlow = frequency / 7.5;
  LS = waterFlow / 60.0;
  total += LS; // accumulate liters

  // LCD update without flicker
  lcd.setCursor(0,0);
  lcd.print("L/Min: ");
  lcd.print(waterFlow, 2);
  lcd.print("   ");

  lcd.setCursor(0,1);
  lcd.print("Total: ");
  lcd.print(total, 2);
  lcd.print(" L   ");

  Serial.println(waterFlow);
  delay(500);
}

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:

  • Interfacing SD Card Module for Data Logging
  • P 20160419 235234Digital Clock Circuit Using 16×2 LCD Display
  • schematic 1Color Detector Circuit with Arduino Code
  • arduino ledLearning Basic Arduino Programming – Tutorial for the Newcomers

Filed Under: Arduino Projects, Water Controller Tagged With: Arduino, Digital, Flow, Meter, Simple, Water

About Swagatam

I am an electronics engineer and doing practical hands-on work from more than 15 years now. Building real circuits, testing them and also making PCB layouts by myself. I really love doing all these things like inventing something new, designing electronics and also helping other people like hobby guys who want to make their own cool circuits at home.

And that is the main reason why I started this website homemade-circuits.com, to share different types of circuit ideas..

If you are having any kind of doubt or question related to circuits then just write down your question in the comment box below, I am like always checking, so I guarantee I will reply you for sure!

Previous Post: « Joystick Controlled 2.4 GHz RC Car Using Arduino
Next Post: Buck Converter Circuit Using Arduino »

Reader Interactions

Comments

Shaikh murad says:
May 15, 2018 at 5:45 pm

Water pressure should be less than 1.75 mpa so . sir can we use this project for petrol pump pressure. Because im not sure about the pressure of petrol pumps in mpa thankyou

Reply
GR says:
May 16, 2018 at 3:19 am

Hi Shaihk,

Petrol should work fine with this sensor. I won’t recommend using with petrol or any expensive liquids because this sensor has tolerance of +/- 10%. Meaning you will end up in pumping 10% more or 10% less petrol.

Regards

Reply
Ameesha Singh says:
April 16, 2018 at 9:13 pm

can you give the flow chart of this program?

Reply
Wexler says:
March 8, 2018 at 2:09 am

Hi
is it possible to add an Eprom Memory to the circuit in order to keep the consumption over time even the power is turned off? I suppose some changes must be done also over the code. Can You solve this issue ? Thank You!

Reply
GR says:
March 8, 2018 at 5:35 pm

Hi Wexler,

Yes, we can add an SD card or utilize built-in EEPROM of ATmega 328P for saving data. We can provide you the solution.

Customized Arduino code is premium as of now , if you are interested comment with your detailed requirements, we will proceed.

Regards

Reply
rahul k says:
February 20, 2018 at 4:34 pm

sir, i know that connecting LCD to potentiometer is for adjusting brightness but why did you connect the 5v pin of the flow sensor to the potentiometer? can i know why is that connection needed?

Reply
GR says:
February 22, 2018 at 5:13 pm

HI Rahul,

Look at the circuit carefully, the 5V line is common for the potentiometer and flow sensor, it is just 5V path, red wire.

Regards

Reply
afrid says:
October 3, 2017 at 8:32 am

Sir kindly answer my question
I made a transformer which have primery winding is 220 turn(18 swg wire 1kg) and secondary turn is 22 turn(10 swg 650gram) now the input voltage is 210 volt and output is 18 volt
bobin size is ( 6inch×3inch) how much current given in output ?????
Plz answer my question

Reply
Swagatam says:
October 3, 2017 at 11:10 am

Afrid,

It cannot be possible to judge the current through a visual analysis…you will have to check it with an ammeter.

Reply

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

circuit simulator image



Subscribe to get New Circuits in your Email



Categories

  • Arduino Projects (95)
  • Audio and Amplifier Projects (133)
  • Automation Projects (18)
  • Automobile Electronics (103)
  • Battery Charger Circuits (87)
  • Datasheets and Components (109)
  • Electronics Theory (149)
  • Energy from Magnets (27)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (20)
  • Health related Projects (27)
  • Home Electrical Circuits (13)
  • Indicator Circuits (16)
  • Inverter Circuits (95)
  • Lamps and Lights (159)
  • Meters and Testers (71)
  • Mini Projects (28)
  • Motor Controller (68)
  • Oscillator Circuits (28)
  • Pets and Pests (15)
  • Power Supply Circuits (91)
  • Remote Control Circuits (50)
  • Renewable Energy (12)
  • Security and Alarm (64)
  • Sensors and Detectors (106)
  • SMPS and Converters (34)
  • Solar Controller Circuits (60)
  • Temperature Controllers (43)
  • Timer and Delay Relay (49)
  • Voltage Control and Protection (42)
  • Water Controller (37)
  • Wireless Circuits (31)





Other Links

  • Privacy Policy
  • Cookie Policy
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap



People also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Stack Exchange
  • Linkedin



Recent Comments

  • Swagatam on Make this Radio Repeater Circuit at Home
  • Swagatam on 10 Automatic Emergency Light Circuit Diagrams Explain
  • Swagatam on Arduino 2-Step Programmable Timer Circuit
  • Earl leer on Make this Radio Repeater Circuit at Home
  • Ghulam Mohio Din on Arduino 2-Step Programmable Timer Circuit

© 2026 · Swagatam Innovations