Description
What it is
The YF-201S flow sensor is a useful device for monitoring and controlling water flow in pipes. It is designed to be used with Arduino or other compatible microcontrollers, allowing for the automation of systems such as home irrigation.
Features
- Water Flow Sensor G1/2 YF-201S
- DC 12V
- Compatible with solenoid valves
What it is for
The flow sensor is ideal for home projects such as automatic irrigation control or leak alarm. It can be used with Arduino or ESP to manage and monitor water flow.
Tutorial: How to use G1/2 YF-201S Water Flow Sensor
The YF-201S water flow sensor is a useful component for monitoring the amount of water passing through a pipe. It is ideal for home projects such as automatic irrigation control or leak alarm.
What you need
- Arduino Uno
- G1/2 Connection
- 12V power cable
Steps
- Connect the solenoid valve to the YF-201S detector according to the datasheet specifications.
- Connect the detector to a 12V DC power supply.
- Install the G1/2 connector on the water pipe.
- Connect the detector data pins to the Arduino microcontroller (see schematic in the datasheet).
- Write a sketch to read flow values from the detector and display them on Serial Monitor.
- Verify that the detector correctly senses the water flow.
- Configure the solenoid valve to open or close the valve based on flow data.
- Test the complete system with a small demo project.
Example code
void setup() {
Serial.begin(9600);
}
void loop() {
int flowValue = analogRead(A0); // Verifica sul datasheet per la pin corretta.
Serial.println(flowValue);
}
Mini project
Create an automatic irrigation system that opens the solenoid valve when the soil is dry and the temperature is appropriate.
Common mistakes
- Incorrect connection of the detector to Arduino pins.
- Non-compliant 12V DC power supply.
- G1/2 connection not installed correctly.
- Choosing an inappropriate connector for the pipe diameter.
Recommended accessories
- Arduino Uno R3
- 12V Solenoid Valve
- Soil Moisture Sensors
- Temperature Sensors
Frequently asked questions
Does the sensor work with battery power?
Check the datasheet for the minimum and maximum voltage supported.
Can it be used outdoors?
Protect it from weather; consider a protective PVC cover.







Reviews
There are no reviews yet.