Can you arrange for gravity to help? Then the Arduino just needs some means to stop the flow.
Yes, I can, i was originally going to have the tube go down from a desk to a container like a water jug or pop bottle but now i might but mount a container inside on the top of the drink dispenser could I use some kind of electric valve? (if those exist)
You might take a look at the various ways that the many "bar bot" projects handle this. They now seem to have settled on the use of "bar optics" as the best solution, activated by some form of linear actuator. The bar optic does metering as well as dispensing.
In soda fountains, a bottle of compressed gas provides the force to move the liquid (as well as carbonate it) and so it only needs a valve to control the flow.
I was looking for something that could be turned on and off with a relay so that my RFID reader would read the chip in the bottom of the cup and then dispense the right amount, would there be a way to use this to do that?
If food safety is a concern, what container holds the source liquid? You really have two options. One is a sealed container with compressed air forcing the liquid out, Or a container that is vented so gravity can force the liquid out. In both cases, some type of replaceable or cleanable valve would control the liquid flowing out of the container.
You will never be able to clean the plastic tubing in a peristaltic pump. You can only sterilize, which may have a bad effect on the tube.
like I said replying to the first person, I could use gravity to help. what kind of valve could I use that could be activated by a relay?