2 Inch Water Flow Sensor YF - DN50
2 Inch Water Flow Sensor YF - DN50
The 2 Inch Water Flow Sensor YF - DN50 is a digital water flow sensor designed to measure the flow rate of water in pipes with a diameter of 2 inches (DN50). This sensor is a popular choice in the Internet of Things (IoT) and industrial automation applications where accurate and reliable water flow measurement is crucial.
The 2 Inch Water Flow Sensor YF - DN50 measures the flow rate of water by using a magnetic mechanism to detect the movement of a paddle wheel, which is inserted into the flow stream. As the water flows through the pipe, the paddle wheel rotates, generating a magnetic field that is detected by the sensor's Hall effect sensor. The sensor then converts the detected magnetic field into an electrical signal, which is proportional to the flow rate of the water.
The sensor provides a digital output signal, making it easy to interface with microcontrollers, data loggers, and other IoT devices. The digital output signal is typically in the form of a pulse signal, where each pulse represents a specific volume of water flow.
0.5-50 L/min
5% of the full scale
1-500 pulses per liter
5-24 VDC
<20 mA
-25C to 80C
up to 1.6 MPa
IP67
120 mm x 60 mm x 40 mm
300 g
CE Certification
RoHS Compliance
FCC Compliance
2 Inch Water Flow Sensor YF - DN50 Documentation
Overview
The 2 Inch Water Flow Sensor YF - DN50 is a digital water flow sensor designed to measure the flow rate of liquids in industrial, commercial, and residential applications. This sensor uses a Y-shaped design to detect the flow of water and provides an accurate measurement of the flow rate. The sensor is compatible with pipes with a diameter of 2 inches (DN50) and operates on a 5V to 24V power supply.
Technical Specifications
Measuring range: 0.5-20 L/min
Accuracy: 5% of full scale
Power supply: 5V to 24V DC
Output signal: Hall effect pulse output
Interface: 3-pin connector (VCC, GND, OUT)
Material: Brass body with 2-inch (DN50) pipe connection
Operating temperature: -20C to 80C
Code Examples
### Example 1: Measuring Water Flow Rate using Arduino
This example demonstrates how to use the 2 Inch Water Flow Sensor YF - DN50 with an Arduino board to measure the water flow rate.
```c
const int flowSensorPin = 2; // Pin connected to the flow sensor's OUT pin
volatile int count = 0; // Variable to store the pulse count
float flowRate = 0.0; // Variable to store the flow rate (L/min)
void setup() {
pinMode(flowSensorPin, INPUT);
attachInterrupt(digitalPinToInterrupt(flowSensorPin), flowSensorInterrupt, RISING);
Serial.begin(9600);
}
void loop() {
flowRate = count / 7.5; // Calculate the flow rate (L/min)
Serial.print("Flow Rate: ");
Serial.print(flowRate);
Serial.println(" L/min");
count = 0; // Reset the pulse count
delay(1000); // Measure flow rate every 1 second
}
void flowSensorInterrupt() {
count++; // Increment the pulse count
}
```
### Example 2: Measuring Water Flow Rate using Raspberry Pi (Python)
This example demonstrates how to use the 2 Inch Water Flow Sensor YF - DN50 with a Raspberry Pi board to measure the water flow rate using Python.
```python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
FLOW_SENSOR_PIN = 17 # Pin connected to the flow sensor's OUT pin
GPIO.setup(FLOW_SENSOR_PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)
pulse_count = 0
flow_rate = 0.0
def flow_sensor_interrupt(channel):
global pulse_count
pulse_count += 1
GPIO.add_event_detect(FLOW_SENSOR_PIN, GPIO.RISING, callback=flow_sensor_interrupt)
while True:
flow_rate = pulse_count / 7.5 # Calculate the flow rate (L/min)
print("Flow Rate: {:.2f} L/min".format(flow_rate))
pulse_count = 0 # Reset the pulse count
time.sleep(1) # Measure flow rate every 1 second
```
Note: The examples provided assume that the flow sensor is properly connected to the Arduino or Raspberry Pi board, and the power supply is within the recommended range. The `flow_rate` calculation is based on the sensor's datasheet, which assumes 7.5 pulses per liter. You may need to adjust this value depending on your specific application.