Replace the old algorithm for figuring out the flow rate with a new one based on taking the median interval between pulses to figure out the pulse per second rate and using that to infer the flow rate.
New algorithm is:
sample pulses for half a second at a time and count the first (up to) 20 pulses you see
that meet a minimum length and minimum delay criteria designed to ward off fake jitter pulses.
find the median pulse interval of all the intervals you see. Use the median so that the result
is insensitive to high outliers
convert that median interval to a median pulse per second rate
average the median rates from each sampling period and report that once per minute
The flow rate is sampled once per 16 seconds now in order to keep the power consumption (on/off ratio)
about the same as before, though a little higher. (.1/4 vs .5/16)
Replace the old algorithm for figuring out the flow rate with a new one based on taking the median interval between pulses to figure out the pulse per second rate and using that to infer the flow rate.
New algorithm is:
The flow rate is sampled once per 16 seconds now in order to keep the power consumption (on/off ratio) about the same as before, though a little higher. (.1/4 vs .5/16)