square wave signal flow rate sensor

All I am trying to do is to keep track of the gallons that flow over a given time and read out the current gallons per minute used and the total gallons used to a LCD screen.