{"id":23389821,"url":"https://github.com/hafidhh/flowsensor-arduino","last_synced_at":"2025-04-11T08:10:12.170Z","repository":{"id":64893386,"uuid":"577596793","full_name":"hafidhh/FlowSensor-Arduino","owner":"hafidhh","description":"Water Flow Sensor / Flow Meter Arduino Library, Flow Rate, Volume, YF-S201, YF-B1, OF10ZAT, OF10ZZT,  OF05ZAT, OF05ZZT","archived":false,"fork":false,"pushed_at":"2024-08-19T14:34:23.000Z","size":64,"stargazers_count":46,"open_issues_count":4,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T05:41:32.833Z","etag":null,"topics":["arduino","arduino-library","esp32","esp8266","flow-sensor","sensor","waterflow-sensor"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hafidhh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["hafidhh"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://www.buymeacoffee.com/hafidh"]}},"created_at":"2022-12-13T04:53:02.000Z","updated_at":"2025-03-11T02:15:09.000Z","dependencies_parsed_at":"2023-02-10T16:15:21.103Z","dependency_job_id":"b63cf14b-0859-4f78-8f45-87675cdc64da","html_url":"https://github.com/hafidhh/FlowSensor-Arduino","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafidhh%2FFlowSensor-Arduino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafidhh%2FFlowSensor-Arduino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafidhh%2FFlowSensor-Arduino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafidhh%2FFlowSensor-Arduino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hafidhh","download_url":"https://codeload.github.com/hafidhh/FlowSensor-Arduino/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248360344,"owners_count":21090680,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","arduino-library","esp32","esp8266","flow-sensor","sensor","waterflow-sensor"],"created_at":"2024-12-22T03:18:23.577Z","updated_at":"2025-04-11T08:10:12.149Z","avatar_url":"https://github.com/hafidhh.png","language":"C++","funding_links":["https://github.com/sponsors/hafidhh","https://www.buymeacoffee.com/hafidh"],"categories":[],"sub_categories":[],"readme":"# Water Flow Sensor Library Arduino\n[![arduino-library-badge](https://www.ardu-badge.com/badge/FlowSensor.svg)](https://www.ardu-badge.com/FlowSensor?)\n[![PlatformIO Registry](https://badges.registry.platformio.org/packages/hafidh/library/FlowSensor.svg?)](https://registry.platformio.org/libraries/hafidh/FlowSensor)\n[![GitHub release](https://img.shields.io/github/release/hafidhh/FlowSensor-Arduino.svg?)](https://github.com/hafidhh/FlowSensor-Arduino/releases)\n[![License](https://img.shields.io/github/license/hafidhh/FlowSensor-Arduino.svg?)](https://github.com/hafidhh/FlowSensor-Arduino/blob/master/LICENSE.md)\n\n## 🚀 Description   \nArduino library for Flow Sensor\n\n### Volume Formula   \n```math\nVolume (L) = {Total Pulse \\over Pulse/Liter}\n```\n\n### Flow rate Formula   \n```math\nQ = {Frequency \\over Pulse/Liter}60\n```\n```math\nQ = {Pulse/Time \\over Pulse/Liter}60\n```\nQ = Flowrate (Liter/minute)   \n\n## 🔥 Features\n* Get Volume in Liter\n* Get Flow Rate in Liter/Secound\n* Get Flow Rate in Liter/Minute\n* Get Flow Rate in Liter/hour\n* Count Pulse and get Value\n\n## ✨ Tested Devices\n* Arduino Nano ATMega328P\n* NodeMCU ESP8266\n* NodeMCu ESP32\n* LGT8F328P (Logic Green)\n\n## 💻 Installation\n### Using Library Manager\n#### Arduino\nAt Arduino IDE, go to menu Sketch -\u003e Include Library -\u003e Manage Libraries...\n\nIn Library Manager Window, search \"flowsensor\" in the search form then select \"FlowSensor\".\n\nClick \"Install\" button.  \n\n#### Platform IO\nFor PlatformIO IDE, using the following command.\n\nOr at PIO Home -\u003e Library -\u003e Registry then search FlowSensor.\n\n### Manual Installation\nFor Arduino IDE, download zip file from the repository (Github page) by select Code dropdown at the top of repository, select Download ZIP\n\nFrom Arduino IDE, select menu Sketch -\u003e Include Library -\u003e Add .ZIP Library....\n\nChoose FlowSensor-Arduino-master.zip that previously downloaded.\n\n## 🔥 Sensor\n|  Sensor Type  |  Code   | Pulse/Liter |\n| ------------- | ------- | ----------: |\n| YF-S201       | YFS201  |         450 |\n| YF-S401       | YFS401  |        5880 |\n| YF-B1         | YFB1    |         660 |\n| YF-B1-S       | YFB1S   |        1077 |\n| OF10ZAT       | OF10ZAT |         400 |\n| OF10ZZT       | OF10ZZT |         400 |\n| OF05ZAT       | OF05ZAT |        2174 |\n| OF05ZZT       | OF05ZZT |        2174 |\n\n## ✨ Add New Sensor\nIf you want to add new sensor you can edit [FlowSensor_Type.h](https://github.com/hafidhh/FlowSensor-Arduino/blob/master/src/FlowSensor_Type.h) file in src and create pull request or you can use dynamic declaration.\n\n## 💻 Usages\nSee [all examples](https://github.com/hafidhh/FlowSensor-Arduino/blob/master/examples)\n\n### Initialization\nIf your sensor is not available in sensor list you can use dynamic declaration by use sensor pulse/liter in type, example 450 for YF-S201.\n\n```cpp\n#include \u003cFlowSensor.h\u003e\n\nuint16_t type = YFS201; // type : Sensor type or pulse/liter\n// uint16_t type = 450;\nuint8_t pin = D2; // pin : interrupt pin\n\nFlowSensor Sensor(type, pin);\n```\n\nif you want to change sensor pin and sensor type you can use setPin and setType.  \nif you change the pin with setPin() you have to do sensor.begin() again\n\n```cpp\nSensor.setPin(pin);\nSensor.setType(type);\n```\n\n\n### Sensor begin\nparam **`userFunc`**  \nparam **`pullup`**  \nif you have an external pull up you can set pull up to true\n```cpp\nvoid count()\n{\n    Sensor.count();\n}\n\nvoid setup()\n{\n    Sensor.begin(count());\n}\n```\n\n### Set Sensor Pin\nparam **`pin`**\n```cpp\nSensor.setPin(pin);\n```\n\n### Set Sensor Type\nparam **`type`**\n```cpp\nSensor.setType(type);\n```\n\n### Sensor Read\n```cpp\nSensor.read()\n```\n\n### Count Pulse\n```cpp\nSensor.count()\n```\n\n### Get Total Pulse\nreturn **`total pulse`**\n```cpp\nSensor.getPulse()\n```\n\n### Reset Pulse\nset pulse value to 0\n```cpp\nSensor.resetPulse()\n```\n\n### Get Flowrate (L/s)\nreturn **`Flowrate`** (L/s)\n```cpp\nSensor.getFlowRate_s()\n```\n\n### Get Flowrate (L/m)\nreturn **`Flowrate`** (L/m)\n```cpp\nSensor.getFlowRate_m() \n```\n\n### Get Flowrate (L/h)\nreturn **`Flowrate`** (L/h)\n```cpp\nSensor.getFlowRate_h() \n```\n\n### Get Total Volume (L)\nreturn **`Volume`** (L)\n```cpp\nSensor.getVolume()\n```  \n\n### Reset Volume (L)\nset volume value to 0\n```cpp\nSensor.resetVolume()\n```  \n\n## 🛡️ License\nThis project is licensed under the MIT License - see the [`LICENSE`](LICENSE.md) file for details.\n\n## 🙏 Support\nWe all need support and motivation. Please give this project a ⭐️ to encourage and show that you liked it. Don't forget to leave a star ⭐️ before you move away.\n\nIf you found the app helpful, consider supporting us with a coffee.\n\n\u003ca href=\"https://github.com/sponsors/hafidhh\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/sponsor-30363D?style=for-the-badge\u0026logo=GitHub-Sponsors\u0026logoColor=#EA4AAA\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://www.buymeacoffee.com/hafidh\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge\u0026logo=buy-me-a-coffee\u0026logoColor=black\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhafidhh%2Fflowsensor-arduino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhafidhh%2Fflowsensor-arduino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhafidhh%2Fflowsensor-arduino/lists"}