Water Flow Sensor ‐ 1/2″ SKU: SEN0217
Contents
1 Introduction
2 Specification
3 Board Overview
4 Tutorial
4.1 Requirements
4.2 Connection Diagram
4.3 Sample Code
5 FAQ
Introduction
The Water Flow sensor measures the rate of a liquid flowing through it. The YF-S201 water flow
sensor consists of a plastic valve body, flow rotor and hall effect sensor. It is usually used at the inlet
end to detect the amount of flow. When liquid flows through the sensor, a magnetic rotor will rotate
and the rate of rotation will vary with the rate of flow. The hall effect sensor will then output a pulse
width signal. Connect it to a microcontroller and you can monitor multiple devices such as your
coffee maker, sprinkler or anything else, and control the water flow rate to suit your needs!
A 20 mm rifled pipe is recommended
Avoid unit contact with corrosive chemicals
The unit must be installed vertically, tilted no more than 5 degrees
Liquid temperature should be less than 120 C to avoid damage to unit
Specification
Inner Diameter: 11 mm
Outside diameter: 20 mm
Proof Water Pressure: <1.75 MPa
Water Flow Range: 1-30 L/min
Voltage Range: 3.5~12 V
Operating Current: 15 mA (DC 5V)
Insulation Resistance: >100 MΩ
Accuracy: ±5% (2~30L/min)
The Output Pulse High Level: >4.7 VDC (DC input voltage 5 V)
The Output Pulse Low Level: <0.5 VDC (DC input voltage 5 V)
Output Pulse Duty Ratio: 50% ± 10%
Water-flow Formula: 1L = 450 square waves
Working Humidity Range: 25% ~ 95% RH (no frost)
Dimension: 62*36*35 mm/2.44*1.37*1.37 inches
Weight: 52g
Board Overview
Number Color
1
2
3
Green
Red
Black
Name
Signal
VCC
GND
Description
Pulse Signal
5~12V
GND
Pulse Signal
Tutorial
In this Tutorial, we'll measure liquid flow using this sensor.
Requirements
Hardware
DFRduino UNO R3
Water flow sensor
Jumper Wires
Software
Arduino IDE,
Click to Download Arduino IDE from Arduino®
https://www.arduino.cc/en/Main/Software
Connection Diagram
Sample Code
1 /***************************************************
2
3
4
5
Created 2016-3-13
By berinie Chen <bernie.chen@dfrobot.com>
This example reads Water flow sensor Sensor.
6
7
8
9
10
11
12 /***********Notice and Trouble shooting***************
13 1.Connection and Diagram can be found here http://www.dfrobot.com/wiki/i
ndex.php?title=Water_Flow_Sensor_-_1/2%E2%80%B3_SKU:_SEN0217#Sample_Code
14
15
2.This code is tested on Arduino Uno.
****************************************************/
GNU Lesser General Public License.
See <http://www.gnu.org/licenses/> for details.
All above must be included in any redistribution
****************************************************/
16 volatile double waterFlow;
17 void setup() {
18
19
20
21 }
22 void loop() {
23
24
25
26
27 }
28
29 void pulse()
30 {
31
32 }
waterFlow += 1.0 / 450.0;
//measure the quantity of square wave
Serial.print("waterFlow:");
Serial.print(waterFlow);
Serial.println("
delay(500);
L");
Serial.begin(9600);
waterFlow = 0;
attachInterrupt(0, pulse, RISING);
//DIGITAL Pin 2: Interrupt 0
//baudrate
FAQ
For any questions, advice or cool ideas to share, please visit the
DFRobot Forum.
Powered By DFRobot © 2008-2017