Flow sensor for shower on R4 board

Please also post a schematic.

A schematic is key to describing any electronic circuit - even a simple one.

See: ' Schematics or circuit diagrams'

Do you have a link to specifications for the sensor?

How are you testing it - how do you get it to generate pulses?