If you're planning on 'pressing 500ml', what sort of hardware is going to be used? Will this be on a keypad or something of that nature? How will the water be stored, how will it be released? If this is a 'homework assignment', what types of hardware / electronics components are available to you?
I would think the simplest solution would be to arrange the hardware so that the rate at which water can leave is a constant, and control the time for which the system is 'open' and can pass the water using a timer; though you'd need a fast way of fully opening the nozzle / unblocking the hole, or whatever will allow the water to pass, so that you don't have varying flow rates as the state is being changed.