I have a mechanical water flowmeter with reed switch output and I connect it to my low power, battery powered device to count pulses.
The reed switch is connected to my device via a 15 m long cable and it shorts the pulled up input (1M) of a comparator with hysteresis in my device - detection works okay.
The problem is that once in a year the flowmeter needs to be disconnected and inspected - while the long cable combined with large impedance, humid and electrically noisy environment causes the comparator to trigger and count a lot of false pulses. Even touching the cables triggers counting. Changing the pull up value to 47k works great, but also increases the battery current a lot when the switch is shorted.
Currently the device is powered from 3 V coin battery, the comparator window is set between 1.4 to 1.7 V. I thought about moving the window into a lower voltage range, ie. 0.2 - 0.5 V - is it a good idea? Maybe there's a better solution? Battery life is the top key priority.
I'll only add that it's not my design, I'm just trying to fix someone's work.