YFS401¶
Generic - Pulse counter NORMAL
Introduction¶
Just as the ESP may be used with specific pulse counters it may also be used with any generic pulse based unit as long as the pulses are not giving to high voltages. A generic 5V flow sensor that gives a pulse each complete revolution. You may have to measure what each revolution/pulse means in volume. The one used in this example is called YF-S401, a 5V unit, which is great to use for watering systems or in this case (pictured) to measure a drainage system.
- Specifications:
General, output as pulse
Min. working voltage: 4.5V
Max. working current: 15mA (5V)
Working voltage range: 5V-12V
Flow range detectable: approx. 0.3-6L/min
Wiring¶
ESP YFS401
GPIO (14) <--> Signal (yellow)
Power
5.0V <--> VCC (red)
GND <--> GND (black)
Setup¶
Danger
Only task number 1..4 is currently supported for the pulse plugin!
Task settings¶
Device: Name of plugin
Name: Name of the task (example name WaterMeter)
Enable: Should the task be enabled or not
Sensor¶
Device: Name of plugin
Name: Name of the task (example name WaterMeter)
Enable: Should the task be enabled or not
Sensor¶
GPIO <– Pulse: Pulse input is generally set to GPIO 14 (D5).
Debounce time: Debounce time is generally set to 100.
Counter type: In this example the type is set to Delta/Total/Time.
Mode type: Pulse input is generally set to Falling
LOW
= count when signal go from not low to low (0.8+V to 0.8-V)CHANGE
= count on signal being changed, low to high (0.8-V to 2.4+V) or high to low (2.4+V to 0.8-V)RISING
= count if signal is rising, from low to not low (0.8-V to 0.8+V)FALLING
= count if signal is falling, from high to not high (2.4+V to 2.4-V)
Warning
GPIO 16 (D0) is not compatible with pulse counters.
Data acquisition¶
Send to controller 1..3: Check which controller (if any) you want to publish to. All or no controller can be used.
Interval: How often should the task publish its value (5..15 seconds is normal).
Indicators (recommended settings)¶
Indicator |
Value Name |
Interval |
Decimals |
Extra information |
---|---|---|---|---|
Count |
mL |
5 |
2 |
Using the formula |
Total |
Total |
N/A |
1 |
Total value is the counted pulses since last reboot, for total in liters you could
use this formula |
Time |
Time |
N/A |
0 |
Time since last pulse was intercepted, in mSec.
.. note:: Only updated if counter type is set to |
Rules examples¶
On WaterMeter#mL Do
If [WaterMeter#mL]=0
Publish,%sysname%/WaterStream/status,Water stream empty
Else
Publish,%sysname%/WaterStream/status,Water is life!
EndIf
EndOn
.. Commands available
.. ~~~~~~~~~~~~~~~~~~
.. .. include:: P003_commands.repl
Where to buy¶
Store |
Link |
---|---|
AliExpress |
|
Banggood |
|
eBay |
$ = affiliate links which will give us some money to keep this project running, thank you for using those.