Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use YF-S201 Water Flow Meter: Examples, Pinouts, and Specs

Image of YF-S201 Water Flow Meter
Cirkit Designer LogoDesign with YF-S201 Water Flow Meter in Cirkit Designer

Introduction

The YF-S201 Water Flow Meter is a compact and reliable device designed to measure the flow rate of water in a pipe. It operates using a turbine mechanism, where the flow of water spins an internal rotor. This motion generates a series of electrical pulses that can be read and processed by a microcontroller or other electronic systems. The frequency of these pulses is directly proportional to the flow rate, making it an efficient and accurate tool for water flow measurement.

Explore Projects Built with YF-S201 Water Flow Meter

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
YF-S201 Water Flow Meter Interface with SN74AHCT125N Level Shifter
Image of Copy of flow: A project utilizing YF-S201 Water Flow Meter in a practical application
This circuit is designed to interface a YF-S201 Water Flow Meter with an SN74AHCT125N buffer/level shifter, likely for signal conditioning purposes. The power supply provides the necessary voltage to the flow meter, and decoupling capacitors are used to stabilize the buffer's power supply. The circuit is prepared for further expansion or connection to a microcontroller for data processing, although no microcontroller or its code is included in the provided information.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino-Based Water Quality Monitoring System with SIM900A and Multiple Sensors
Image of feito: A project utilizing YF-S201 Water Flow Meter in a practical application
This circuit is a water quality monitoring system that uses an Arduino UNO to collect data from a YF-S201 water flow meter, a turbidity sensor, and a temperature sensor. The collected data is then transmitted via a SIM900A GSM module to a remote server or user through SMS. The system measures water flow rate, temperature, and turbidity, and sends periodic updates.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based Water Flow and Temperature Monitoring System with LCD Display
Image of flow & temp: A project utilizing YF-S201 Water Flow Meter in a practical application
This circuit is a monitoring system that uses an Arduino UNO to measure water flow and temperature. It utilizes a YF-S201 water flow meter and a DS18B20 temperature sensor to collect data, which is then displayed on a 16x2 I2C LCD. The Arduino processes the sensor data and updates the display in real-time.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Water Flow Monitoring System with OLED Display
Image of Smart Flow Metre: A project utilizing YF-S201 Water Flow Meter in a practical application
This circuit features an ESP32 microcontroller connected to a YF-S201 Water Flow Meter and a 0.96" OLED display. The ESP32 reads the flow rate data from the water flow meter via a digital input (D15) and communicates with the OLED display over I2C (D21 for SCK and D23 for SDA) to display the flow information. The Breadboard Power Module supplies power to the ESP32, the water flow meter, and the OLED display.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with YF-S201 Water Flow Meter

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Copy of flow: A project utilizing YF-S201 Water Flow Meter in a practical application
YF-S201 Water Flow Meter Interface with SN74AHCT125N Level Shifter
This circuit is designed to interface a YF-S201 Water Flow Meter with an SN74AHCT125N buffer/level shifter, likely for signal conditioning purposes. The power supply provides the necessary voltage to the flow meter, and decoupling capacitors are used to stabilize the buffer's power supply. The circuit is prepared for further expansion or connection to a microcontroller for data processing, although no microcontroller or its code is included in the provided information.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of feito: A project utilizing YF-S201 Water Flow Meter in a practical application
Arduino-Based Water Quality Monitoring System with SIM900A and Multiple Sensors
This circuit is a water quality monitoring system that uses an Arduino UNO to collect data from a YF-S201 water flow meter, a turbidity sensor, and a temperature sensor. The collected data is then transmitted via a SIM900A GSM module to a remote server or user through SMS. The system measures water flow rate, temperature, and turbidity, and sends periodic updates.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of flow & temp: A project utilizing YF-S201 Water Flow Meter in a practical application
Arduino UNO-Based Water Flow and Temperature Monitoring System with LCD Display
This circuit is a monitoring system that uses an Arduino UNO to measure water flow and temperature. It utilizes a YF-S201 water flow meter and a DS18B20 temperature sensor to collect data, which is then displayed on a 16x2 I2C LCD. The Arduino processes the sensor data and updates the display in real-time.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Smart Flow Metre: A project utilizing YF-S201 Water Flow Meter in a practical application
ESP32-Based Water Flow Monitoring System with OLED Display
This circuit features an ESP32 microcontroller connected to a YF-S201 Water Flow Meter and a 0.96" OLED display. The ESP32 reads the flow rate data from the water flow meter via a digital input (D15) and communicates with the OLED display over I2C (D21 for SCK and D23 for SDA) to display the flow information. The Breadboard Power Module supplies power to the ESP32, the water flow meter, and the OLED display.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Irrigation Systems: Monitoring and controlling water usage in agricultural or garden irrigation.
  • Aquariums: Ensuring proper water circulation and flow in aquatic environments.
  • Water Management Systems: Measuring and managing water consumption in residential, commercial, or industrial setups.
  • DIY Projects: Used in hobbyist projects involving water flow monitoring and automation.

Technical Specifications

Below are the key technical details of the YF-S201 Water Flow Meter:

Parameter Value
Operating Voltage 5V to 18V DC
Operating Current ≤ 15 mA (at 5V DC)
Flow Rate Range 1 to 30 liters per minute (L/min)
Output Pulse Frequency 4.5 Hz per L/min
Maximum Water Pressure 1.75 MPa
Operating Temperature -25°C to 80°C
Accuracy ±10%
Output Signal Pulse signal (digital)

Pin Configuration

The YF-S201 has three wires for connection:

Wire Color Function Description
Red VCC (Power) Connect to a 5V to 18V DC power source.
Black GND (Ground) Connect to the ground of the circuit.
Yellow Signal (Pulse Out) Outputs the pulse signal proportional to flow rate.

Usage Instructions

Connecting the YF-S201 to a Circuit

  1. Power Supply: Connect the red wire to a 5V to 18V DC power source. For most microcontroller applications, 5V is sufficient.
  2. Ground: Connect the black wire to the ground (GND) of your circuit.
  3. Signal Output: Connect the yellow wire to a digital input pin on your microcontroller. Use a pull-up resistor (e.g., 10kΩ) if necessary to stabilize the signal.

Important Considerations

  • Orientation: Ensure the water flow direction matches the arrow printed on the sensor body.
  • Debris Protection: Use a filter upstream to prevent debris from clogging the turbine.
  • Calibration: The sensor's output frequency is proportional to the flow rate, but calibration may be required for precise measurements.
  • Voltage Levels: If using a 3.3V microcontroller, use a level shifter to safely read the 5V signal from the sensor.

Example Code for Arduino UNO

Below is an example of how to use the YF-S201 with an Arduino UNO to measure water flow:

// YF-S201 Water Flow Meter Example Code
// Measures water flow rate and total volume using Arduino UNO

volatile int pulseCount = 0;  // Variable to store pulse count
float flowRate = 0.0;         // Flow rate in liters per minute (L/min)
float totalVolume = 0.0;      // Total volume in liters
unsigned long lastTime = 0;   // Time tracking for calculations

// Pin configuration
const int flowSensorPin = 2;  // YF-S201 signal wire connected to digital pin 2
const float calibrationFactor = 4.5; // Pulses per liter per minute

void setup() {
  pinMode(flowSensorPin, INPUT_PULLUP); // Set pin as input with pull-up resistor
  attachInterrupt(digitalPinToInterrupt(flowSensorPin), pulseCounter, RISING);
  Serial.begin(9600); // Initialize serial communication
}

void loop() {
  unsigned long currentTime = millis();
  unsigned long elapsedTime = currentTime - lastTime;

  if (elapsedTime >= 1000) { // Calculate every second
    noInterrupts(); // Disable interrupts to safely access pulseCount
    float frequency = pulseCount / (elapsedTime / 1000.0); // Pulses per second
    flowRate = frequency / calibrationFactor; // Convert to L/min
    totalVolume += (flowRate / 60.0); // Convert to liters
    pulseCount = 0; // Reset pulse count
    lastTime = currentTime; // Update last time
    interrupts(); // Re-enable interrupts

    // Print results to serial monitor
    Serial.print("Flow Rate: ");
    Serial.print(flowRate);
    Serial.println(" L/min");
    Serial.print("Total Volume: ");
    Serial.print(totalVolume);
    Serial.println(" L");
  }
}

// Interrupt service routine to count pulses
void pulseCounter() {
  pulseCount++;
}

Notes on the Code

  • The calibrationFactor (4.5) is specific to the YF-S201 and may vary slightly between units. Adjust it if necessary.
  • Ensure the signal wire is connected to a pin that supports hardware interrupts (e.g., pin 2 or 3 on Arduino UNO).

Troubleshooting and FAQs

Common Issues

  1. No Output Signal

    • Cause: Incorrect wiring or insufficient power supply.
    • Solution: Double-check the wiring and ensure the power supply is within the specified range (5V to 18V).
  2. Inaccurate Flow Rate

    • Cause: Calibration factor mismatch or debris in the sensor.
    • Solution: Recalibrate the sensor and clean the turbine if necessary.
  3. Unstable Readings

    • Cause: Electrical noise or lack of pull-up resistor.
    • Solution: Add a pull-up resistor to the signal line and ensure proper grounding.
  4. Sensor Not Responding

    • Cause: Flow direction is incorrect.
    • Solution: Verify that the water flow matches the arrow on the sensor body.

FAQs

Q: Can the YF-S201 measure other liquids besides water?
A: The sensor is designed for water and may not provide accurate readings for other liquids. Additionally, certain liquids may damage the internal components.

Q: How do I protect the sensor from high water pressure?
A: Ensure the water pressure does not exceed the maximum rating of 1.75 MPa. Use a pressure regulator if necessary.

Q: Can I use the YF-S201 with a 3.3V microcontroller?
A: Yes, but you will need a level shifter to safely read the 5V signal output from the sensor.

Q: How do I clean the sensor?
A: Disconnect the sensor, remove debris from the turbine, and rinse it with clean water. Avoid using harsh chemicals.