Skip to content

hjmhardsoft/FlowSensor-Arduino

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Water Flow Sensor Library Arduino

arduino-library-badge PlatformIO Registry GitHub release GitHub

Description

Arduino library for Flow Sensor, YF-S201

Volume Formula

$$Volume (L) = {Total Pulse \over Pulse1Liter}$$

Flowrate Formula

$$Q = {Frequency \over Pulse1Liter}60$$ $$Q = {Pulse/Time \over Pulse1Liter}60$$

Q = Flowrate (Liter/minute)

Sensor

Sensor Type Code
YF-S201 YFS201
YF-B1 YFB1
OF10ZAT OF10ZAT
OF10ZZT OF10ZZT
OF05ZAT OF05ZAT
OF05ZZT OF05ZZT

Usages

See all examples

initialization

#include <FlowSensor_Arduino.h>

uint8_t type = YFS201; // type : Sensor type
uint8_t pin = D2; // pin : interrupt pin

FlowSensor_Arduino Sensor(type, pin);

Sensor begin

param userFunc

void begin(void (*userFunc)(void))

Sensor Read

param calibration

void read(int calibration)

Count Pulse

void count()

Get Total Pulse

return total pulse

unsigned long getPulse()

Get Flowrate (L/s)

return Flowrate (L/s)

float getFlowRate_s()

Get Flowrate (L/m)

return Flowrate (L/m)

float getFlowRate_m() 

Get Total Volume (L)

return Volume (L)

float getVolume()

About

Water Flow Sensor Arduino Library, Flow Rate, Volume, YF-S201

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%