Need help with flow sensor

This is a 4 year old topic and much has changed in that time.
In addition, you’ve not shared any code that explains anything about how you attempted to achieve this…

My guess is that you haven’t included any pinMode statements in your code, and/or referenced the physical pins of your board incorrectly.

I’d suggest that you share your code (correctly formatted with triple backticks at the beginning and end).

Pete.