Mini Water Flow Sensor (White)
Mini Water Flow Sensor (White)
The Mini Water Flow Sensor (White) is a compact, reliable, and accurate sensor designed to measure the flow rate of liquids, particularly water, in a variety of applications. This sensor is ideal for monitoring water flow in industrial, commercial, and residential settings, such as in plumbing systems, irrigation systems, and medical equipment.
The Mini Water Flow Sensor works on the principle of hall effect, which detects changes in the magnetic field generated by the spinning magnet attached to the rotor. The rotor is connected to a piston that moves in response to the fluid flow, causing the magnet to rotate. The hall effect sensor measures the rotation speed of the magnet, which is directly proportional to the fluid flow rate. The sensor outputs a pulse signal, where the frequency of the pulses is directly proportional to the flow rate.
| Parameter | Value |
| --- | --- |
| Flow Rate Range | 1L/min to 30L/min |
| Accuracy | 5% of full-scale range |
| Operating Voltage | DC 5-24V |
| Power Consumption | Less than 20mA |
| Output Signal | Pulse signal ( frequency proportional to flow rate) |
| Operating Temperature | -20C to 80C |
| Thread Size | 1/2" BSP |
| Sensor Body Material | High-quality plastic |
| Dimensions | 28mm x 22mm x 12mm |
| Weight | Approximately 50g |
The specifications are subject to change without notice. Please verify the specifications with the manufacturer or supplier before using the component in your application.
Mini Water Flow Sensor (White) DocumentationOverviewThe Mini Water Flow Sensor (White) is a digital flow sensor designed to measure the flow rate of liquid fluids. It's a compact, easy-to-use sensor that provides accurate measurement of fluid flow in industrial, commercial, and residential applications. This sensor is particularly useful in IoT projects related to water management, irrigation systems, and liquid dispensing machines.Technical SpecificationsOperating Voltage: 5V DC
Output Signal: Digital (High/Low)
Flow Measurement Range: 1-30 L/min
Resolution: 1 pulse per liter
Sensor Material: Brass
Dimensions: 27mm x 18mm x 12mm (L x W x H)PinoutThe Mini Water Flow Sensor has three pins:VCC: 5V power supply
GND: Ground
OUT: Digital output signal (High/Low)Code Examples### Example 1: Basic Water Flow Measurement using ArduinoIn this example, we'll connect the Mini Water Flow Sensor to an Arduino board to measure the water flow rate.
```c++
const int flowSensorPin = 2; // Digital input pin for flow sensor output
volatile int flowCount = 0; // Variable to count the pulsesvoid setup() {
pinMode(flowSensorPin, INPUT);
attachInterrupt(digitalPinToInterrupt(flowSensorPin), countFlow, RISING);
Serial.begin(9600);
}void loop() {
Serial.print("Flow Rate: ");
Serial.print(flowCount);
Serial.println(" L/min");
flowCount = 0; // Reset the counter
delay(1000); // Take readings every second
}void countFlow() {
flowCount++; // Increment the pulse counter
}
```
### Example 2: Water Flow Monitoring using Raspberry Pi (Python)In this example, we'll connect the Mini Water Flow Sensor to a Raspberry Pi to monitor the water flow rate and log the data to a CSV file.
```python
import RPi.GPIO as GPIO
import time
import csv# Set up GPIO pins
GPIO.setmode(GPIO.BCM)
flowSensorPin = 17 # GPIO pin for flow sensor output
GPIO.setup(flowSensorPin, GPIO.IN, pull_up_down=GPIO.PUD_UP)# Set up CSV logging
log_file = open('water_flow_log.csv', 'w', newline='')
log_writer = csv.writer(log_file)while True:
# Count the pulses for 1 second
pulse_count = 0
start_time = time.time()
while time.time() - start_time < 1:
if GPIO.input(flowSensorPin) == GPIO.HIGH:
pulse_count += 1
flow_rate = pulse_count # 1 pulse per liter
log_writer.writerow([time.strftime('%Y-%m-%d %H:%M:%S'), flow_rate])
log_file.flush()
print(f"Flow Rate: {flow_rate} L/min")
time.sleep(1)
```
Note: These code examples are for illustration purposes only and may require modifications to suit your specific project requirements. Ensure you follow proper safety precautions when working with electrical and water-based systems.