
Intermediate4/7/2026- Author: IoTSpark Maker
ESP32 + Water Flow Sensor YF-S201: Measuring Water Flow — Ready-to-Run Sample Code
The YF-S201 is a paddle-wheel water flow sensor — water flowing through spins an internal paddle wheel, and a built-in Hall sensor generates an electrical pulse every time the paddle wheel passes a fixed point.
yf-s201luu-luong-nuocxung
4 steps3 components
The YF-S201 is a paddle-wheel water flow sensor — water flowing through spins an internal paddle wheel, and a built-in Hall sensor generates an electrical pulse every time the paddle wheel passes a fixed point. Pulse frequency is proportional to flow speed — counting pulses over an interval lets you calculate the flow rate (L/min) and the total volume of water that has passed through. This is the final lesson in the series, combining the pulse-counting + interrupt techniques learned in the Rotary Encoder and Hall Effect lessons.