Water Flow Sensor

Try this code https://github.com/adafruit/Adafruit-Flow-Meter