Cocktail robotics is an engaging cross between engineering, art, and gastronomy that provides many entry points for making, craft, performance, and exploring hedonistic interfaces between technology and humanity.
Cocktail robots don’t need to serve alcohol, and they don’t need to be electronic. There are a lot of fun “cocktail robots” that dispense other drinks, and robots that dispense cocktails without a computer (see Benjamin Cowden’s “The Corpse Reviver”).
But the goal of the Hello Drinkbot project is to get people making more cocktail robots by providing a simple and affordable solution to the “hello world” problem of “How do I dispense cocktails under computer control?”
Hello Drinkbot aims to make it easier to get started, to lower the bar of entry so that more people can enjoy the rewards of this particular obsession. To paraphrase artificial intelligence pioneer Danny Hillis, we would like to provide a platform which tolerates the beginner’s skill and limited time, while rewarding more attention and creativity. This is “hello world,” so imperfections should perhaps be embraced!
This open source project includes plans and software to make a four-ingredient cocktail-dispensing (or Italian soda-dispensing) drinkbot, expandable to eight ingredients, as well as other resources and code you can use to customize, explore, and expand on the basic model.
I presented Hello Drinkbot as a hands-on activity at Maker Faire Bay Area 2019. The workshop was a lot of fun, and many lessons were learned. On the plus side, I think that all the robots went home able to dispense liquids. Yay!
Since then I’ve worked on tweaks, improvements, patches, and bug fixes. Hello Drinkbot is ready to start pouring for you.
Build Your Hello Drinkbot
If you have a better way to do any of this, please let me know. I made it up as I went along.
1. Assemble the case
If you’re building the laser-cut case, download the .dxf or .svg file and cut the case from 6mm (¼”) material. This is a stand-alone case with holes cut for 8 peristaltic pumps, Pi mounting screws, and tubing management. It has six parts: 2 sides, 1 back (with the cutouts for pumps and Pi screws), 1 front, 1 top, and 1 dispenser/tubing management shelf (Figure A).
You can glue the case together or use four M3×12mm screws and nuts to fasten it if you want to break it down later. For now you can leave the front off.
2. Mount the Pi
Insert four M2.5×12mm screws through the back for the Pi mounting (Figure B). Then screw four standoffs onto those screws (Figure C). Hand tight is fine.
Put the Raspberry Pi on those screws, and secure it with two M2.5 nuts on the side of the Pi with the GPIO header. Screw two more standoffs onto the standoffs on the other side of the board (Figure D).
Solder the headers onto the Adafruit motor hat, and then attach it onto the Pi’s GPIO headers. Use two M2.5 nuts to secure it (Figure E).
3. Mount the pumps
Put the pumps through the holes, and attach each one using two M3×12mm screws with nuts on the inside of the case (Figure F). Figure G shows the rear side of the bot.
4. Wire the pumps
A bit of trivial trickery allows us to double the number of pumps that our motor hat can control. The motor board has 4 full H-bridges which allow it to control four DC motors in forward or reverse. But we don’t normally need reverse, so we’re splitting each H-bridge into two half H-bridges, allowing us to control 8 motors. In the software we’ll move FORWARD to control motor 1, and BACKWARD to control motor 2.
Connect the black ground wire harness to each motor, either the top or bottom lug, just be consistent (Figure H). You can solder to the motors or use crimp connectors. Route the wires in a way that is pleasing to you, cable tie them if you would like. Clip them shorter to fit your desire for order.
On the Motor Hat, connect the black ground wire to either of the screw terminals labeled GND in the left group of screw terminals. Connect the first motor to the first pin of M1, and the second motor to the second pin of M1. The third motor to pin 1 of M2, and the fourth motor to pin 2 of M2. If you have 8 motors, continue that pattern on M3 and M4.
Figure I on the following page shows the wiring completed. Tidy enough for me.
5. Connect power
Connect the red wire of the 12-volt pigtail to + on the motor hat, and the black wire to – (Figure J). Route the power pigtail out the hose hole in the case back. For strain relief, cable-tie the pigtail to one of the standoffs on the Pi.
The insides are complete. Make sure your configured SD card is inserted (see “Set Up the Software” below to configure). Connect the 5V 2.5A Micro USB power supply to the Pi, and the 12V power supply to the 12V pigtail (Figure K).
6. Connect the dispenser
The dispenser board is mounted on front face of the case back (Figure L).
Connect lengths of silicone hoses to your pumps, and run them into the dispenser holes (Figure M). Once you’ve got everything working, you can zip-tie them together to keep them tidy.
Set Up the Software
Hello Drinkbot can be operated by my forked version of the open source Bartendro software that’s been kindly shared by Party Robotics. I’ve also written some utilities that let you control Hello Drinkbot directly via Python commands.
This project assumes you’ve got a working Raspberry Pi — to configure a brand-new Pi, follow the guide at raspberrypi.org/help.
1. Download the code
Check the project page at hellodrinkbot.com to download a new disk image (or to get instructions for installing the software on an existing Pi). This includes the Hello Drinkbot code from github.com/RichGibson/hellodrinkbot, the Python library for the Adafruit Motor Hat, my fork of the Bartendro code from github.com/RichGibson/bartendro, and an installation of Bruce Wilcox’s ChatScript.
To burn the disk image to your SD card, follow the instructions at raspberrypi.org/documentation/installation/installing-images. Then insert the card into the Pi’s microSD slot.
2. Access the Raspberry Pi
You can either connect a monitor, keyboard, and mouse to your Pi, or you can access it from another computer via SSH. Putty is an SSH client for Windows; on a Mac you can use Terminal.
If you connect to the Pi via wireless, you can SSH to the wlan0 interface. The username is pi, the password is raspberry. (Yes, leaving the default username and password is a security risk. You can change it if you want.) To connect, type the command:
You can also connect the Pi to your computer or hub via Ethernet cable. If you have a Mac, enable Internet Sharing (System Preferences → Internet Sharing). Your Pi will probably get the first address, 192.168.2.2. To connect, type:
The Pi is set up with Multicast Domain Name Service (mDNS), so you should also be able to connect to it as <hostname>.local. The hostname is set in /etc/hostname to hellodrinkbot. Type:
The SSID, the access point name, is set in /etc/hostapd/hostapd.conf.
3. Test from THE command line
Hello Drinkbot code includes utility programs demonstrating how to talk to the motor control hat from Python. Connect to your Pi, then type:
cd hellodrinkbot/software/utility python ./pumptest.py 2
This will test all the pumps, turning each on for 2 seconds, and then moving to the next. Your drinkbot is alive! Now you can start commanding it from your own Python programs, or you can get the party started with Bartendro.
4. Use Bartendro
Bartendro will offer you a menu of drinks that can be made with your chosen ingredients (Figure N). It also lets you dispense individual shots, customize ingredient amounts, add your favorite boozes, and create your own recipes.
Web interface: Associate with the “HelloDrinkbot” access point and then go to hellodrinkbot.local or 10.0.0.1 in your browser. You’ll see the Bartendro graphical interface in your browser, and you’re good to go.
RESTful interface: I tweaked Bartendro so that you can also make drinks by calling the RESTful interface from your own code. For example: http://hellodrinkbot.local/ws/drink/12?booze14=75&booze11=75
This way you can automate cocktails from any web page, award them as prizes in games, voice-command them from a smart speaker … use your imagination!
5. Customize Bartendro
To access the Bartendro admin pages, click on the Bartendro logo in the upper right corner of the screen. Default username is bartendro, password boozemeup. Here’s where you specify your Dispensers and customize your Booze list, Drinks recipes, and more. Exit admin by clicking on Menu on the upper left.
My fork of Bartendro has a new feature: the graphical Shots menu now shows pictures of the different boozes. You can update these images if you like. SSH to your robot, then type:
cd bartendro ui sqlite3 bartendro.db
Identify your booze:
select id, name, image from booze where name like ‘Vod%’; 1|Vodka| 55|Vodka, Blavad Black | 58|Vodka, Bacon Infused|
Then update the picture:
sqlite> update booze set image=’potato.jpg’ where id in (1,55,58);
Put the pictures in bartendro/ui/content/static/images/. (Really there should be a way to add pictures at the Booze admin screen. Patches welcome!)
6. Logs and debugging
You can look at the logs by SSH’ing into the Pi over any interface (10.0.0.1, 192.168.2.2, or hellodrinkbot.local). System logs are in /var/log and web and Bartendro logs are in /var/log/nginx.
The following commands may be useful:
tail -f /var/log/nginx/bartendro-error.log tail -f /var/log/nginx/bartendro-combined.log tail -f /var/log/nginx/access.log tail -f /var/log/nginx/error.log tail -f /var/log/syslog
Get Your Drinkbot On
I brought a Hello Drinkbot to an open house at Chimera Arts & Maker Space in Sebastopol, California (Figure O), and was able to serve a bunch of happy people Mudslides, White Russians, and Irish Russians (and variants on those). I used the modified Bartendro software, and aside from a little off-by one error (now fixed), everything worked great.
Soft Drinks Too
At another party recently, I loaded a Hello Drinkbot with various flavors of Torani syrup and set the shot size to 10ml. My grandson Finn took over bartending duties and enjoyed dispensing Italian sodas for people (Figure P).
The peristaltic pumps can’t dispense carbonated liquid, so people would put their own ice and carbonated water into their cups and hand them to Finn. He used the Shots menu in Bartendro. It shows a list of the loaded ingredients and lets you dispense shots individually from those ingredients.
Cleaning Your Bot
After I’m finished dispensing, I run water through all the pumps, and then I run some vodka through.
Your bot has a version of ChatScript installed — so you can talk to it like a real bartender. ChatScript is an open source chat engine written by Bruce Wilcox (brilligunderstanding.com). The Wikipedia page has a good description, and ChatScript’s official pages and Github repository (github.com/ChatScript/ChatScript) are filled with fascinating documentation and explorations into the issues involved with using natural language.
The article “How to build your first chatbot using ChatScript” has a nice introduction (). But here’s a shorter version. Connect to your Pi, then type:
cd Chatscript BINARIES/LinuxChatScript64 local
Enter your name when prompted, or any identifier. ChatScript maintains persistence with a user across sessions.
Interact with the bot. After a couple of questions, it will ask if you want a cocktail. If you say yes, it will pour a tiny cocktail!
There are multiple ways you can interface ChatScript with your bot. I scripted mine to chat in character as The Dude from The Big Lebowski, then pour me a White Russian.
Hello Drinkbot Resources:
Original project page: hellodrinkbot.com
Facebook group: facebook.com/groups/602734573508700