OpenSprinkler Forums Hardware Questions OpenSprinkler 3 wire Flow Sensor Reply To: 3 wire Flow Sensor



I am finally getting around to installing my water meter. Going through the maths and firmware for determining the best divider to use from my sensor, I have hit a bit of an issue. In this thread @Ray states the maximum rate of pulse accepted is 200 pulses/sec, however, looking through the firmware the debounce period seems to be 50ms which would only allow 20 pulses/sec?

The only practical issue I can imagine is that this sensor can send very high frequency pulses which may exceed the maximum frequency the firmware accepts (200 pulses per second).

ulong curr = millis();
if(curr-os.flowcount_time_ms < 50) return;  // debounce threshold: 50ms
os.flowcount_time_ms = curr;

For my application this isn’t a huge issue since my flow meter far exceeds the max rate so will need a divider anyway. If I divide by 270 rather than 27 I should end up with a single pulse per liter giving a maximum rate of 2 pulses/sec at full flow of 120 l/min. Or perhaps divide by 135 to give max of 4 pulses/dec.