Currently, I am in the process of making a kegerator. I used a full size fridge/freezer. It depressed me to see the freezer sitting empty while the fridge had a whole keg so I decided to add liquor taps on the freezer. This is when I decided I wanted the taps to dispense just a single shot per opening. Here is where the arduino comes in. I want to control some form of valve with the arduino to control the amount of liquid that is poured.
Unfortunately, I am simply and EE student with little knowledge of mechanical parts. I know almost nothing about valves and which ones would be appropriate to work with. Further, i have no idea how they work or how I could attach an arduino up to one! This is why I turned to sprinkler valves. They are cheap and very common so I figured it'd be a good starting place.
MY question is, does anyone know if a sprinkler valve will work in this situation? If not, any ideas of valves I could use (that wouldn't be too expensive, im a student, remember?). If so, what would be the best way to hook up the arduino? I figure I could use it as basically a digital switch, but even that I'm not 100% sure I would know how to go about it, I'm relatively new to arduinos still (looking at about 4-5 weeks of practice with it).
Any ideas or suggestions would be greatly appreciated! Thanks a bunch
I think they require a pressurized "source" in order to open.
Correct.
I think you probably want a solenoid valve. These are commonly used in dishwashers, washing machines, refrigerators, etc to control water flow. They're a (typically, in the US) 120VAC coil that operates a valve, much like a relay is a coil that operates a switch.
I guess my biggest question now is, how do I use the arduino to control the valve? Is there a good way of basically making the arduino a timed switch or something? Like, after I figure out how much liquid comes out in a specific time, I can figure out how long I want the valve open to dispense approx. 1 shot. That part I'm confident I can cover, but its the physical hooking up of the devices that confuses me. Obviously the valve needs 12V, would I run the arduino in series with the power or something? That kind of worries me that it could damage the board or something. Any ideas here?
I've gotten a few of these IRLZ34N/44N MOSFETS (they call 'em hexfets) for this kind of work. That, and a cheap diode, and I finally got solenoids working well from an Arduino. (Thanks to many others' help around here.) This is an old sketch, VDD should be labeled +5V, your power for your digital logic stuff, and VMM should be labeled +12V.
I uses gravity controlled valves for my project. The ebay store doesn't seem to have gravity controlled ones available right now, but give him a shout and he'd probably get you some. He was very helpful and helped me pick our decent cheap valves that would be suitable for alcohol dispensing.
If hes doesn't have any gravity controlled ones left and you decide you want to go the gravity controlled route, gimme a shout. I still have 2 valves that were unused.
Do you still have any of your plans from the bartender bot? Since Im pretty new to this its basically all conceptual and I'm not perfectly confident that I'll be able to pull it off. But, that acts as great motivation for me to complete this, haha.
I had no idea gravity valves existed until you said something, but this makes sense to be the proper device to use. I was basically planning on having the liquor bottles upside down in the freezer, feeding into the arduino controlled valve and out the door, thus it seems to me a gravity valve is perfect here. Especially for the times when the liquor is running low.
Unfortunately, I emailed the eBay seller and he wont have the gravity valves for another 6 weeks atleast. So if you don't have any plans for them, I'd love to work out a deal for them! Also, does this set-up make sense to you or should is there a better way to go about it?
Yeah thats the setup I basicly had, Bottles upside down into valves. Valves through pipe into vend area (essentially small area where you could fit a glass).
When I was controlling it I didn't use an Arduino, I used an old win 98 computer. I wanted to be able to have a recipe database that dispensed various amount of liquids depending on he recipe selected. the computer connected to a relay board through the parallel port and the board was connected to the valves. I wrote my program in VB6 and it worked pretty well. Unfortunately I never got down to making a frame and eventually the project was pushed back cause the costs were getting out of hand.
I'll check up on the 2 valves tonight. I don't remember whether they were 5 volts or 12 volts. PM me your email address and I'll email you all the details. You can have them for the cost I bought them at if you want
Thanks to Darudude, I have some valves on the way.
My question for now is this:
I would like to hook it up so that when I hit a pushbutton, it opens the valve for a certain time (I will measure the flow on the valve to get one shot). Would the best way to do this be to control the digital out to the valve with the push button? Also, what would be the best way to keep it open for a duration of time with just the single push of the button (I dont wanna have to hold it down). Could I just use a delay method, or would that not work well with a button push?
i kind of did something like this. The idea way would be to have some sort of flow sensor, but didn't really find what I was looking for when I was searching. I came up with some sort of calibration method to circumvent this.
To calibrate I clicked a button to start the flow and clicked again to stop it. I had a program running to count the amount of milliseconds passed. I didn't use the Arduino but you should be able to do this using the millis function.
After you finish calibrating you can use the time calculated to pour the fluid for that amount of time.
Here is some pseudo code (Haven't tested it).
digitalWrite(valve, LOW);
time=1000;//calibrated time
if (button ==pressed)
{
current = millis(); //current time
while (millis()-current<time)
{
digitalWrite(valve, HIGH);
}
ditalWrite(valve,LOW);
}
Dispensing gravity fed liquid by opening and closing a solenoid valve on a calibrated but fixed time interval may not give the accuracy needed and would have to be tested with both a full bottle of booze and a nearly empty bottle.
The reason is that the actual amount of material flowed depends on the pressure difference between the source and output plumbing through the fixed orifice size of the on/off valve. Higher liquid in the inlet bottle has a higher 'head' pressure then a less full bottle, more pressure = more material flowed in a given fixed time interval. It might still work but testing should be done to see the variation in output quantity for the possible extremes of bottle level.
If this is not accurate enough to prevent spillage or 'short shots', then another method needs to be considered such as measuring the weight of the bottle and closing the valve when the weight decreases by the amount = to a shot. Or some kind of positive displacement flow meter which are not cheap.
What would be a good way of measuring the weight and controlling the time based on that?
Well it would involve having the bottles rest on load cells. Load cells output a voltage proportional to the amount of weight on them. A program would just have to read the weight before opening the valve, then open and keep reading the weight until the difference is equal to a shot glass full (or whatever size is to be dispensed) then close the valve. This would utilize the analog input capablities of the Arduino.
well if you are not too worried about accuracy, I don't know if you need to go as far as getting and interfacing a weight sensor. Test it without the weight sensors cause the accuracy might be fine. Remember, cause of the height restrictions on the tank for the gravity valve, the bottle can only be so high. If you are not happy look into the sensors. Look into strain gauges, they are cheaper than load cells.
I was thinking it might be simpler to go with your bottle with a standard liquor shot dispenser (like the ones you push upwards with the glass underneath), and then use some kind of cam or other mechanical device to operate the dispenser when you need it?