View Categories

YF-S201 – Information

About #

Water flow meter 1-30L/Min 1/2" DN15 kunststof 3-pin JST-SM YF-S201


Why and Where to Use a Water Flow Sensor?

Being an engineer, you must have visited any automation company especially chemical and soft drink industries. In such automation industries, the most common task is to monitor quality and quantity of liquids. For example, in the soft drink industry, the constant task is to ensure that bottles must be filled with an exact amount of cold drinks liquid. In such applications, flow rate sensors are used. Similarly, Automatic water dispensers also make use of flow rate sensors to estimate how quantity of water to be provided to the user according to the amount paid by the user.

In short, we can use YF-S201 water flow sensor with any microcontroller such as Arduino, Raspberry Pi, Pic microcontroller, 8051 microcontrollerSTM32 Blue Pill, ESP32, ESP8266 to measure water flow rate. Some of the important applications of water flow sensor are:

  • Coffee Machines
  • Water Recycling plants
  • Mining Industry (Chemical industry)
  • Smart irrigation system
  • Automatic water dispensers

What is a Water Flow Sensor?

A water flow sensor is an electronic device that is used to measure water flow rate. Furthermore, the flow rate means the volume of water passes through a sensor per unit of time. There are many types of water flow rate measurement sensors available in the market such as YF-B1, YF-B2, YF-B3, YF-B4, YF-B5, YF-B6, G1&2, G3&4, G1&8, and YF-S201. All these sensors are almost the same except for the difference in flow rate range, operating voltage range, length, size, and material used. But their working principle and the procedure to interface with microcontrollers such as Arduino remains the same.

YF-S201 Water Flow Sensor Introduction

YF-S201 is a water sensor technically designed to measure the flow rate and volume of the desired fluid through the pipelines. It is a low-cost water flow sensor that consists of a copper body and water rotor. In addition to this, it also contains an internal circuit of the Hall effect sensor that works on the principle of electromagnetism and provides pulses at the output pin. It is a power-friendly and MCU compatible device with a flow rate of a maximum of 30 liters per minute. A small device with high accuracy finds its application from DIY projects to the industry for flow measurement.

Features and Specifications

  • Operational Voltage: 4.5 – 24 Volts
  • Normal Voltage:5 – 18 Volts
  • Maximum Current: 15 mA @ 5V
  • Load Capacity: ≤10 mA Volts @ 5V
  • Flow Rate Capacity: 1 -30 L/min
  • Electric Strength: 1250 V/min
  • Water pressure Range: ≤ 1.75 MPa
  • Operational Temperature: ≤ 800C
  • Operational Fluid Temperature: ≤ 1200C
  • Humidity Range: 35% – 90% RH
  • Insulation Resistance: ≥ 100 Mohms

YF-S201 is a plastic body water flow sensor that has a valve, rotor, and a Hall effect sensor. They work on the Hall effect principle and output the volume and flow rate in the form of pulses on the signal pin. It has only three wires i.e. two supply wires and an output pulse wire.

How does Water Flow Sensor works? #

This water flow sensor consists of a water rotor (turbine wheel) and a Hall effect sensor. Water enters through of end and leaves through the other end of the sensor. When water flows through the flow sensor, it strikes the turbine wheel and the turbine wheel rotates. The speed of the turbine wheel has a direct relation with the speed of the flow of water through the water flow sensor. On each complete rotation of the turbine wheel, a hall effect sensor also produces a pulse that appears on the signal output pin. In other words, the number of pulses that appear on the signal output pin is directly proportional to the rotational speed of the turbine.

Water flow meter YF-S201 werking

The YF-S201 is known as a Hall effect sensor because it operates on the Hall effect. In order to measure the flow or volume of the fluid, we fix the sensor between the water inlet and outlet valves. When the fluid flows through, it rotates the rotor which has a magnet attached to it. The speed interferes with the magnetic flux which is sensed by the Hall effect sensor and the sensor in returns generates an output signal proportional to the magnetic flux with every revolution that the rotor makes.

In short, for every rotation of the water rotator, the water flow sensor produces a square wave at the output pin. Hence, we can measure the water flow rate by measuring the number of pulses sensors produce in one second or in one minute. That means, we can count the number pulse which provides us information on water flow rate.

Water Flow Sensor Interfacing with Arduino

This section deals with the interfacing of an Arduino microcontroller to the YF-S201 Water Flow Sensor. As discussed earlier, we need to count the output pulses of a sensor to measure the water flow rate. We can use interrupt pins of Arduino to detect a pulse. For example, whenever a pulse occurs on the output pin, the output signal goes from active low to active high state which is also known as a positive or rising edge of the pulse as shown in the figure below:

We can count these rising edges with the help of one of the interrupt pins of Arduino. Arduino provides two external interrupt pins such as Digital I/O Pins 2 and 3. We can program one of the interrupt pins in such a way that whenever a rising edge occurs, the interrupt is triggered. Hence, we can create a counter variable that will increment by one whenever the interrupt will trigger. We can start a timer for one second and count the interrupt events for one second. This will give us the number of pulses generated by the water flow sensor in one second.


Afmetingen #

Pinout #

The following diagram shows the pinout of the YF-S201 water flow sensor. It consists of three pins:

Water flow meter YF-S201 pinout

Wire Configuration #

Let us discuss the pinout of the  YF-S201 Water Flow Sensor. The wire configuration detail in tabular is mentioned below:

Pin NumberPin NameFunction
1REDPositive supply wire
2BLACK Ground wire
3YELLOWOutput Voltage wire


Fritzing #


Source: https://omnigatherum.ca/wp/?p=87


3D model #


Products #


Sources #