Measure liquid amount from the pump

I forgot to mention the output liquid goes to different containers, jars or soil so I am unable to measure the liquid on the output outlet but in between tubing/piping.

Flow meter had huge error because it sometimes spins just by pushing air and when stops it also rotates not pushing the liquid properly. Maybe some kind of 'in-between' container with weight sensor that closes valve when certain weight is met and pumps out the whole liquid content out of itself....