Out Of Stock
Description
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. 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.
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 water flow. 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!
The YF-S201 operates on the Hall effect. In order to measure the flow or volume of the fluid, we connect the sensor between the water inlet and outlet valves, and 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. As the water flow sensor is compatible with microcontrollers,
The pulse signal is a simple square wave so it's quite easy to log and convert into liters per minute using the following formula.
Pulse frequency (Hz) / 7.5 = flow rate in L/min.
Features:
- 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: 450
- Durability: minimum 300,000 cycles
- Cable length: 15cm
- 1/2" nominal pipe connections, 0.78" outer diameter, 1/2" of thread
- Size: 2.5" x 1.4" x 1.4"
Connection details:
- Red wire : +5V
- Black wire : GND
- Yellow wire : PWM output.
Documents
The YF-S201 Module Connections With Arduino:
the digital I/O pin 2 of Arduino as an external interrupt capture pin to count the number of pulses. Now make the connection with the water flow sensor and Arduino according to this Picture:
Arduino Code for the YF-S201 Water Fluid Sensor:
/*YF- S201 water Flow sensor code for Arduino */ const int Output_Pin = 2; volatile int Pulse_Count; unsigned int Liter_per_hour; unsigned long Current_Time, Loop_Time; void setup() { pinMode(Output_Pin, INPUT); Serial.begin(9600); attachInterrupt(0, Detect_Rising_Edge, RISING); Current_Time = millis(); Loop_Time = Current_Time; } void loop () { Current_Time = millis(); if(Current_Time >= (Loop_Time + 1000)) { Loop_Time = Current_Time; Liter_per_hour = (Pulse_Count * 60 / 7.5); Pulse_Count = 0; Serial.print(Liter_per_hour, DEC); Serial.println(" Liter/hour"); } } void Detect_Rising_Edge () { Pulse_Count++; }
YF-S201 Water Flow Sensor Video Tutorial: