I want to pour 500ml of Water in jar with Arduino water flow controller?
The flow meter you specified, YF-S201 Hall Effect Water Flow Meter (datasheet) measures the water flow rate, producing signal output frequency in range 16Hz (at 120L/H) to 90.2Hz (at 720L/H). Datasheet claims "error range +/- 10)". Note that this only measures the rate of flow, it is not a valve and so does not control the flow.

Problem with using a flow rate sensor to measure total quantity of water, is that you must constantly integrate the flow rate over time to get the total volume. Any errors in rate measurement or integration time, will accumulate; so this is generally not an accurate approach. Cumulative errors are highly undesirable, because they are difficult to detect and compensate. You have to not only measure the output frequency, but also carefully control the time between measurements, because you are integrating over time. This will be even more of a problem if you are printing out messages to the serial port.

If the water supply is well regulated and always provides a steady flow, then you will open the valve for a specific time interval. But if the supply pressure is not well regulated, then you may accumulate integration errors and dispensing will not always be accurate.

If you care about dispensing precisely 500mL of water, a more practical solution is to use a weigh scale (load cell). First, measure the tare weight of the empty container, then dispense (using a control loop) until net increase in weight is 500g. With this setup, the dispenser accuracy is determined by the load cell repeatability error (0.1% for a good quality load cell, a couple % for a fair quality load cell) and the measurement accuracy of the ADC (depends on resolution and reference voltage stability). You could try using the Arduino's on-chip ADC which is only 10 bits, or for best accuracy use a real 24-bit weigh scale ADC. The load sensor's offset error is set to zero by measuring the tare weight of the empty jug, so you only need to be concerned about gain error at 500mL and repeatability of the load sensor. This approach does not have cumulative errors. 

You have not specified what kind of valve you will use to control the flow. If you use a solenoid value, the valve is only on-or-off, there may be some overshoot due to valve reaction time (10ms), so you will need to experiment and determine an "off threshold" before reaching 500g.

Since you have no way to compensate if the system overfills the jar, you will need to dampen the system response so that it slows down as it approaches the target level, without overfill. I'd therefore suggest using a proportional valve instead of a solenoid valve. Start with a fast flow rate when net weight &lt;400g and then switch to a slower rate as the jar reaches its target weight.