The hall-effect flow sensor is the cheap, inline part that turns water moving through a pipe into a number you can read. Inside is a little pinwheel with a magnet; as water flows it spins, and a hall sensor counts each turn as an electrical pulse. Count the pulses and you have the volume; measure how fast they come and you have the rate. For a few dollars it is the do-it-yourself way to meter an irrigation line, catch a leak, or confirm a pump actually pumped.
What it is.
A small body with a threaded inlet and outlet that you plumb into the line, and three wires: power, ground, and a signal pin. The common one is the YF-S201 family, in half-inch, three-quarter-inch, and one-inch sizes. The signal is a stream of pulses straight to a microcontroller, with no analog reading to fuss over: you just count edges on an interrupt pin.
How it counts water.
Each rotation of the pinwheel passes the magnet by the hall sensor, which snaps out one pulse. So the number of pulses is proportional to the volume that has passed, and the frequency of pulses is proportional to the flow rate. In code, an interrupt counts pulses: divide the running count by the sensor’s pulses-per-liter to get total liters, and measure pulses-per-second to get the current rate. One simple signal carries both.
The K-factor, and calibrating.
Each sensor has a K-factor, its pulses per liter (often quoted around 450 for a YF-S201), and that is the number you divide by. Here is the important part: the datasheet K-factor is approximate and varies with the sensor, the plumbing, and the flow rate, so taking it on faith can be off by ten percent or more. Calibrate it yourself: run a known volume through into a measured jug or bucket, count the pulses, and divide to get your own pulses-per-liter. Two minutes of calibration turns a rough guess into a trustworthy meter, which matters if the number drives an irrigation decision.
Plastic vs brass.
Two bodies for two situations. The plastic sensor is the cheapest and fine for low-pressure irrigation and indoor lines. The brass version costs more but handles higher pressure, hot water, and outdoor and buried use far better, and it simply lasts longer on a line that matters. For a permanent install on a main line or anywhere it will see pressure and weather, the brass body is worth it; for a quick low-pressure drip line, plastic does the job.
Key facts.
Where it fits, and where it doesn’t.
Where it fits
- Metering an irrigation zone or a drip line.
- Leak detection: flow when the line should be off.
- Confirming a dosing or transfer pump moved liquid.
- Totalizing water use over a day or a season.
Where it doesn’t
- Gritty or unfiltered water; it jams the rotor.
- Flows below its minimum; the rotor will not spin.
- Pipes you cannot cut; use a clamp-on meter.
- Chemicals, unless the body is rated for them.
Resources & where to buy.
Adafruit flow meter (plastic) Adafruit flow meter (brass) Water flow overview The Software Library
Frequently asked questions.
How does a hall-effect flow sensor work?
Water flowing through it spins a small pinwheel with a magnet, and a hall sensor snaps out one pulse per turn. The number of pulses is proportional to the volume that has passed, and the frequency of pulses is proportional to the flow rate. A microcontroller counts the pulses on an interrupt pin and converts them to liters and liters-per-minute.
What is the K-factor and do I need to calibrate?
The K-factor is the sensor’s pulses per liter, the number you divide the pulse count by, often quoted around 450 for a YF-S201. The datasheet value is approximate and varies with the sensor and plumbing, so it can be off by ten percent or more. Calibrate by running a known volume into a measured container, counting the pulses, and computing your own pulses-per-liter. It takes two minutes and makes the meter trustworthy.
Should I get a plastic or brass flow sensor?
Plastic is cheapest and fine for low-pressure irrigation and indoor lines. Brass costs more but handles higher pressure, hot water, and outdoor or buried use, and lasts longer on a line that matters. For a permanent install that sees pressure and weather, choose brass; for a quick low-pressure drip line, plastic is enough.
Will a hall-effect flow sensor work on well or pond water?
Only with care. Its moving pinwheel can be jammed or worn by grit, sand, and debris, which well and pond water carry. Put a filter upstream, use it on clean or treated lines, and check it occasionally. If the water is genuinely dirty and cannot be filtered, a non-invasive clamp-on ultrasonic meter, with nothing in the flow, is the more durable choice.