Description
What it is
The YF-S402B water flow sensor is a device used to measure water flow in small quantities. It is suitable for projects that require water flow monitoring, such as automatic irrigation systems or home controls.
Features
- Measures flow from 0.2 to 8L/min
- Connection: G1/4 PE Pipe
- Supply Voltage: 12VDC
What it is for
Ideal for home or industrial automation projects, the YF-S402B sensor can be integrated with Arduino to create automatic irrigation systems. It is compatible with microcontrollers like Arduino and ESP.
Tutorial: How to use Flowsensor YF-S402B
The YF-S402B flowmeter measures water flow in small quantities, ideal for home or industrial automation projects.
What you need
- Flowmeter YF-S402B
- Arduino
- 10kΩ resistor
- 12VDC power cable
Steps
- 1. Install the flowmeter on the G1/4 pipe.
- 2. Connect the VCC pin to 12VDC.
- 3. Connect the GND pin to the GND pin of the Arduino.
- 4. Connect the SIG pin to a digital pin of the Arduino.
- 5. Attach a 10kΩ resistor between SIG and VCC.
- 6. Load the source code.
- 7. Test the flow meter with various water flows.
- 8. Check the datasheet for further details.
Example code
```
int sensorPin = 2;
int sensorValue = 0;
void setup() {
Serial.begin(9600);
pinMode(sensorPin, INPUT);
}
void loop() {
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue);
delay(1000);
}
```
Mini project
Create an automatic irrigation system with a YF-S402B flow meter and Arduino.
Common mistakes
- Set up the VCC, GND, and SIG pins correctly.
- Ensure that the power supply voltage is exactly 12VDC.
- Verify that the resistor is correctly connected.
- Check the proper functionality of the flow meter before connecting it to a more complex system.
Recommended accessories
- G1/4 Pipe
- Arduino Uno
- 10kΩ Resistor
- 12VDC Power Cable
Frequently asked questions
Does the flow meter work with voltages other than 12VDC?
Check the datasheet.
What is the measurement range of the flow meter?
0.2-8L/min.
Which Arduino pins should I use?
SIG on a digital pin, VCC and GND on respective pins.
Does the flow meter work with all types of water?
Check the datasheet.










Reviews
There are no reviews yet.