-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YFS201 Sensor #6015
YFS201 Sensor #6015
Conversation
A problem was found with your submission git@github.com:4211421036/YFS201 ❌ ERROR: Invalid submission URL (parse "git@github.com:4211421036/YFS201": first path segment in URL cannot contain colon) |
A problem was found with your submission https://github.com/4211421036/githubiot ❌ ERROR: Submission URL is already in the Library Manager index. |
Thanks for your interest in contributing to the Arduino Library Manager index @4211421036 After resolving the issue, trigger this check again by doing one of the following:
❗ NOTE: It is not necessary to open a new pull request. ❗ More information: |
A problem was found with your submission https://github.com/4211421036/githubiot ❌ ERROR: Submission URL is already in the Library Manager index. |
Arduino Lint has suggestions for possible improvements to https://github.com/4211421036/YFS201:
|
Thanks for your interest in contributing to the Arduino Library Manager index @4211421036 After resolving the issue, trigger this check again by doing one of the following:
❗ NOTE: It is not necessary to open a new pull request. ❗ More information: |
Hi @4211421036 ❌ ERROR: Pull request removes newline from the end of a file. Please resolve this error. The checks will automatically run again once that is done. More information: |
Arduino Lint has suggestions for possible improvements to https://github.com/4211421036/YFS201:
|
Your submission has now been accepted! Thanks for your contribution to the Arduino Library Manager index. The library(s) will be available for installation via Library Manager within a day's time. You can check the logs from the Library Manager indexer for your library(s) here: |
YFS201
YFS201 Water Flow Sensor Module
Table of Contents
Introduction
The YFS201 Water Flow Sensor Module is an Arduino-compatible library designed to interface with the YF-S201 water flow sensor. This sensor measures the flow rate of water using the Hall Effect principle, generating pulses proportional to the flow rate. This library provides an easy-to-use interface to read the flow rate, calculate the total volume of water, and integrate with other components like LCDs, relays, or SD cards.
Features
Installation
To use the YFS201 library, follow these steps:
Sketch
>Include Library
>Add .ZIP Library
and select the downloaded file.Usage
Basic Setup
Connect the YF-S201 sensor to your Arduino:
5V
GND
D2
).Initialize the sensor in your sketch:
Read the flow rate and total volume in the
loop()
function:Mathematical Formulation
The flow rate$$Q$$ (in liters per minute) is calculated using the following formula:
Where:
The total volume$$V$$ (in liters) is calculated by integrating the flow rate over time:
In the code, this is approximated as:
Where:
Examples
Example 1: Basic Flow Rate Measurement
This example reads the flow rate and displays it on the Serial Monitor.
Example 2: Total Volume Calculation
This example calculates and displays the total volume of water that has passed through the sensor.
Caution
Important
Warning
License
This project is licensed under the MIT License. See the LICENSE file for details.