Before you watch this project... see my others:
I am building kits of all the parts used on the Drinkmotizer. Private message me here at element14 or Twitter if you are interested.
Thank you for the support and furthering development on the bot.
“Make me a drink, Drinkmo.”
On every engineer’s senior design short list is/was a drink mixing robot. One of the few projects that’s fun at parties. You want the Drinkmotizer at your party… You need the Drinkmotizer at your party… At some point, dexterity for drink mixing is lost at a gathering. Drinkmo is your designated, sober, mixologist. Your enabler. Your friend.
I know what you are thinking, “hey, there are other drink mixing bots out there, what makes this one different?” This one doesn’t break the bank. It’s DIY, Open, expandable. Artistically speaking, It isn’t just a nozzle that sprays alcohol at objects, it uses the actual bottle, and gravity.
The concept is based on a CNC lathe I built. My goal was to make something a bit faster, slightly less precise, and upgradeable. Drinkmo is all that. In the video I show six bottle stations and one chaser spout. That particular setup, being four feet long, can have up to sixteen bottles and still have the chaser spot. Technically, I could build a Drinkmo that is twenty feet long having 80 bottles on it! I thought that would be cool to see at a bar somewhere.
Here were my requirements of
- Use the original drink bottles
- Be expandable
- Single button interface
- Be inexpensive (relatively to the other bot options)
Project by sections
- Motor control
There is a stepper motor driving the Drinkmotizer table via a drive belt. With CNC applications, directly coupling a stepper motor to the drive shaft is never a good idea. Most stepper motors are not designed to handle lateral forces. Although this is only driving a small platform and a cup, there still is resistance.
The Arduino receives the serial drink protocol (Recipe) from the Raspberry Pi and controls the motor routine based on the recipe. We are using the Centipede shield to expand the I/O of the Arduino Uno. The Centipede Shield uses the Wire I2C interface on analog pins 4 and 5 of the Uno to provide 64 general purpose I/O pins. The program starts off with importing the libraries. The Centipede shield comes with a library that is imported along with Wire.h library in order to communicate with I2C devices. The SoftwareSerial.h Library is imported to allow serial communication from the Pi. We then setup all the variables and subroutines.
The main program runs in a loop waiting to receive serial data from the Pi based on the protocol setup. The Arduino receives the values separated by commas. We use the Serial.parseInt() function to place each comma separated value into an array. We then parse out the array and assign individual variables. Once these variables are assigned, we check the values of these variables and move the motor accordingly to each drink module position. The positions are fixed and have a set number of steps in order to move the motor until the cup is directly under the pour spout. The program will check the number of shots in the recipe and dispense the first shot then wait about 4 seconds for the drink module chamber to refill and pour the second shot before moving on to the rest of the recipe. The program also checks whether or not there is any more drink modules left to pour when executing the recipe. When no more drinks are left to pour, the program considers the drink complete and returns to the first position (home). The number of steps are added when the platform passes under the drink dispensers. When the program considers the drink complete, it takes the total number of steps added at its current position and moves the motor, that many steps, in the opposite direction. The platform returns to the exact place when it started the drink.
The protocol includes pour durations for the chasers based on the recipe received. The chasers are poured last, after the liquor. The protocol value for the chaser is a time in milliseconds. This variable is passed directly into the delay for the solenoid that allows the chaser to flow. Once the drink has returned to home, the loop starts over waiting for drink data from the Pi.
The Motor has an acceleration and deceleration routine which is used to achieve top speed and come to a gradual rest instead of abruptly stopping the motor. Starting the motor at top speed will cause it to stutter when under the load of the lead screw. A gradual start makes for smooth operation and achieving top speed without problems.
Tkinter is a built in GUI library for python. Although not the prettiest themed GUI, It’s easy to use. Especially for our application using the raspberry pi for running the GUI which is as simple as running the python script in IDLE which comes with Raspbian OS.
I decided to use a grid view for drink selections. Each drink would be displayed with a picture of the drink with the name then a short list of the ingredients following. Last would be a button to activate the machine to start making the drink. I decided to make the button big for the touch screen so it was easier for the user to click the button on the first try. I embedded the picture and Drink name into the button which flowed well with having a big button. The tkinter library only accepts .gif, .pgm, or .ppm picture formats. After finding the picture I wanted to use I resized the image and converted it to a .gif. I saved the picture into the project folder alongside the .py file. When running the script the code looks for the image file in the same folder as the .py file.
The script starts with importing the necessary libraries. The Tkinter Library is imported along with the Pyserial library for serial communication. The serial port is then set up telling the Pi to use the USB port as the serial port at 9600 baud. Next we set up the GUI’s attributes. We assign the GUI as dgui. i.e. dgui = Tk(). The GUI is displayed as fullscreen and the geometry is set to the 7” screen resolution. The text/label fonts are set to be used elsewhere in the program. The program has a cut out canvas frame placed inside the main window to display the grid of drink selection buttons.
The buttons are embedded with an image and text of the drink described. To achieve this we created a Tkinter button and assigned it a variable. We used Tkinter’s PhotoImage Class Function to import the .gif picture as a variable as well. Once the image is assigned as a variable we can configure the button to have the variable be the button’s image. A text label of the drink name is then packed under the image inside of the button. The ingredients list text is then placed under the button.
When the button is pressed is calls the appropriate function to start the progress bar and open the serial port to the Arduino. Before sending the drink information to the Arduino, we set the serial port DTR to level 0 or False. This is to ensure proper serial communication with the Arduino via USB cable. Setting the DTR to 0 or False prevents the Arduino from resetting its communication on the USB port. Without setting the DTR we had intermittent connections.
The Raspberry Pi sends the Arduino the Recipe/Instructions to make the drink selected. It does this by sending our custom protocol. Which are just 9 values separated by commas. The Arduino parses out the values and assigns them variables.
For this iteration of the Drinkmotizer, I am using 10 relays off of a SainSmart relay board. Six for the drink module actuators and four for the chaser station.
Each bottle module uses a 12VDC car door lock actuator. When activated, the draw spikes to 12V @ 5A. So, depending if I want a full shot or a partial, I activate the relay time accordingly.
The chaser station operates differently. The chaser bottles are pressurized by a paintball gun tank. What stops the chaser fluids from spraying everywhere are four solenoid valves. Then one valve is actuated, it opens, allowing the pressure to push fluid through the solenoid. For the record, the solenoid is designed for fluids.
- The bottle modules started out quite differently. Originally, a cheaper metering bottle actuator was used, but they would easily break and were difficult to actuate. After several different types of bottle actuators were tested out, the ones used in the final Drinkmo were the clear winners.
- A lot of I/O was needed. The only expansion shield with enough pins was the Centipede board by Macetech. At the time of building the Drinkmotizer, the Centipede board was sold out. Honestly, nothing else was a viable option. Luckily, the people at Macetech were able to find a couple for me. Overnight shipping, and the day was saved.
- Some bottle spouts were too small for the bottle modules. Supreme force was the only solution.
- The whole system had to reset often. It turned out to be a faulty USB hub. Eventually, no hub was used at all, and there were no issues.
Schematic and Design
(SEE THE PDF ATTACHED TO THIS POST FOR HIGHER RESOLUTION!)
What is not pictured is provisions for hall effect sensors... But, they would be on the Centipede board.
|1||$35||$35||element14||43W5302||Raspberry Pi Model B|
|1||$17.99||$17.99||element14||97W1422||PRE PROGRAMMED, MICROSD, 8GB, RASPBERRY PI|
|1||$49.95||$49.95||element14||56T0249||BREADBOARD, SOLDERLESS, 400 TIE POINTS|
|2||$25.00||$50.00||Macetech||MTCEN001||Centepede Arduino IO breakout board http://macetech.com|
|1||$48.60||$48.60||Amazon||4x DC 12V 1/4 Inch Electric Solenoid Valve|
|1||$67.50||$67.50||Amazon||5 x 1PCS 12V DC 1/8" 2way 2position Electric Solenoid Valve Water Air Gas N/C Gas Water Air 2W025-06 BSP Normal Closed|
|1||$45.12||$45.12||Amazon||2x Oggi Professional 4-Bottle Revolving Liquor Dispenser|
|1||$50.35||$50.35||Amazon||5x Install Essentials 524T 2 Wire Standard Door Lock Actuator Kit|
|1||$11.00||$11.00||Amazon||Install Essentials 524T 2 Wire Standard Door Lock Actuator Kit|
|1||$18.49||$18.49||Amazon||Nema 23 (57 series) stepping motor mount|
|1||$174.00||$174.00||Amazon||Lilliput 7" 619AT 1080P Camera Touch Screen Monitor VGA/AV/HDMI/DVI Input|
|1||$101.08||$101.08||Amazon||7 of Wood Upside Down Dispenser - Lighted Dispenser Units - 30 ML|
|4||$7.76||$31.04||Mcmaster||47065T178||Aluminum Inch T-Slotted Framing System, 90 Degree Plate, Single, 5-Hole, for 1-1/2" Extrusion|
|4||$4.06||$16.24||Mcmaster||47065T224||Aluminum Inch T-Slotted Framing System, 90 Degree Bracket, Single, 2-Hole, for 1-1/2" Extrusion|
|1||$5.00||$5.00||Mcmaster||5905K21||Steel Needle-Roller Bearing, Open for 1/4" Shaft Diameter, 7/16" OD, 5/16" Width|
|2||$2.76||$5.52||Mcmaster||6655K33||Steel Thrust Ball Bearing, Stainless Steel Washers, for 1/4" Shaft Diameter, 9/16" OD|
|1||$4.00||$4.00||Mcmaster||1257K113||Miniature 303 Stainless Steel Drive Shaft, 1/4" OD, 3" Length|
|2||$7.48||$14.96||Mcmaster||57105K13||Acetal Pulley for XL-Series Timing-Belt, for 1/4" & 3/8" Belt Width, 1.00" OD, 12 Teeth|
|1||$2.95||$2.95||Mcmaster||1679K27||Trapezoidal Tooth Urethane Timing Belt, .200" Pitch, Trade Size 160XL, 16" Outer Circle, 1/4" W|
|3||$30.33||$90.99||Mcmaster||47065T103||Aluminum Inch T-Slotted Framing System, Four-Slot Single, 1-1/2" Solid Extrusion, 4' Length|
|4||$4.06||$16.24||Mcmaster||47065T224||Aluminum Inch T-Slotted Framing System, 90 Degree Bracket, Single, 2-Hole, for 1-1/2" Extrusion|
|1||$56.56||$56.56||Mcmaster||99030A716||1018 Carbon Steel Precision Acme Threaded Rod, 1/2"-8 Size, 1/4" Travel/Turn, 6' L, Right-Hand Thread, 2 Starts|
|2||$4.51||$9.02||Mcmaster||47065T145||Standard Type 302 Stainless Steel End-Feed Fastener for 1-1/2", Aluminum Inch T-Slotted Framing System, Packs of 4|
|1||$5.89||$5.89||Mcmaster||8947A137||118 Degree Point High-Speed-Steel Short-Length Drill Bit, Bright Finish, 7/16", 3-7/16" L Overall|
|4||$7.90||$31.60||Mcmaster||8702K487||Impact-Resistant UHMW Polyethylene Rectangle Bar, 3/8" Thick, 3" Width, Black|
|1||$13.33||$13.33||Mcmaster||98089A336||Metric 18-8 Stainless Steel Shim, 0.5MM Thick, 8MM ID, 14MM OD, Packs of 50|
|1||$4.76||$4.76||Mcmaster||91292A202||Type 18-8 Stainless Steel Socket Head Cap Screw, M6 Thread, 70MM Length, 1MM Pitch, packs of 10|
|1||$11.23||$11.23||Mcmaster||3846K1||Multipurpose Gauge, Steel Case, 1-1/2" Dial, 1/8 NPT Bottom, 0-15 PSI|
|1||$8.73||$8.73||Mcmaster||91828A251||Metric 18-8 Stainless Steel Hex Nut, M6 Size, 1MM Pitch, 10MM Width, 5MM Height, packs of 100|
|8||$2.23||$17.84||Mcmaster||5779K104||Push-to-Connect Tube Fitting for Air, Straight Adapter for 5/32" Tube OD X 1/8 NPT Male|
|1||$18.00||$18.00||ebay||2pcs SK20 Size 20mm CNC Linear Rail Shaft Guide Support|
|1||$34.95||$34.95||ebay||PBB20MM x 4 (four) 20mm Linear Bearings Pillow Block Bearing CNC Bushing SC20UU|
|1||$133.15||$133.15||ebay||Standard Type 302 Stainless Steel End-Feed Fastener for 1-1/2", Aluminum Inch T-Slotted Framing System, Packs of 4|
|1||$11.50||$11.50||ebay||Clippard MAR-1 regulator|
Other uses of the system
- I suppose any sort of liquids could be dispensed. Soup-motizer, juice-motizer, paint-motizer… fill in the blank –motizer.
When I have more time and money
- Going to attach the stepper motor without using a drive belt. I only used the belt to avoid having too much sticking out the side. But, I think shaft coupling would be safer. No place to catch your hand.
- Getting the touchscreen working properly. Raspian does not work with the screen, despite the vendor stating otherwise. Works great with XBMC.
- I plan on designing and manufacturing my own bottle modules. I want to meter smaller amounts of liquid. I want the modules to be “hot-swappable.” Of course, more compact and cheaper.
- Another option I am considering is changing out the leadscrew for a magnetic drive system. No visible spinning leadscrews is what I want to avoid. You know, the ones that crush fingers? With a magnetic system, we should habe quicker movement and easier adjustments.
- Originally, I wanted sensors along the line to detect bottle stations. I did not have to add them. However, it absolutely necessary. Especially when more bottles are added or removed on a whim.
- Bottle detectors. I want to detect if a bottle is in a station. Also reading the label/barcode could detect what it is too. That should take any thinking out of the mix. Keep in mind, those who use this are probably drunk.
- I want the cup platform/table to also shake/stir the beverage too. I have a few ideas on this one…
Oddities and observations
- Drinkmo made some powerful beverages. With the ease of beverage creation, one could easily develop a problem.