Some months ago I came up with an idea, which was to build a rocket ship simulator for my friends kids and make it cloneable for each of their families. We are all programers, but no hardware guys.
Some planning and I realized I know nothing about hardware, halting a great idea. The arduino I bought sat and went nowhere.Then someone joked I should build an automated bar. After a little research, I found two amazing projects, the Inebriator and bar2d2, but got stumped on approaching hardware and development didn't start. Motors, voltages, and some fundamentals were needed.
Then I stumbled onto http://learn.robotgeek.com/projects/70-shotbot-project.html and lightbulbs went off! Their project was simple, but it showed how to control pumps via logic. From there I thought I could control it from a raspberry pi with a nice interface.
I ordered a boatload of parts, and then on a whim bought some LEDs.
Before proceeding, take the time to read the tutorials on this site:
Seeing the guides, it is easy to understand why I leaned so heavily on this product set, info was in one place. That got me from 0 to 60 in a couple days.
I also found Jeremy Blum's
Exploring Arduino: Tools and Techniques for Engineering Wizardry extremely helpful
Customizing or building on a smaller scale
The beauty of the barmanager library I created is that it allows you to scale up or down the pump number very easily. If you want to start with 4 pumps, go ahead! The customization section of this instructable will walk you through how to change this from the default build of 12 pumps.
Step 1: Be Safe
As with anything alcohol related, you bare the responsibility for your own actions and the actions of your guests.
- Grab car keys, safe serve, and be responsible.
- Don't drink and drive, make sure your guests don't, and make sure you don't over serve. Consider adding rfid and monitor your guests drinking!
- The author(s) of this article take no responsibility , certainly assumes none, and offer this information to inspire inventors only.
Step 2: The Hardware List
I'm not employed by, associated with, or endorsing any vendor or products. With that said, the RobotGeek products enabled a quick build to happen with no electronics experience.
Links to products are found here http://learn.robotgeek.com/projects/70-shotbot-project.html
These are the products I used to construct each part of the Drinkinator.
Pump Electronics - aka Drinkzilla
- 12 pumps (no powercord)
- 12 drink spouts
- 2 large workbenches ( you don't need these)
- Sensor cables
- 2 dc squid cables
- 2 6v power cables
- Arduino mount
- 1 white funnel (bpa free!)
- The pump kits came with silicone tubing but I bought a tube pack so I can replace them later, as they wear down.
- Power bar
Interface - Drinkinator
- Raspberry pi 2
- 16mb sdhc card
- Raspberry official touchscreen
- Power adapter 5v
- Usb cable
- Logitec Wireless keyboard/mouse. I use this for programming the pi and hide it while the Drinkinator is in use.
Lightshow - Lightzilla
- Neopixel ring -16 size
- Neopixel jewel - 7size
- 20 or 22 gauge wiring(smaller wire was better for neopixels)
- I used an arduino mega that was gathering dust, but that is overkill. Use a nano!
I used 2x2" wood posts and used compressed particle board for bottom, middle and cover
- 3" wood screws
- white primer
- black paint
- wire guides
- Glass ash tray
- Silicone sealant
- Left over wood from posts and horizontal pieces
- Wood glue
- small nails to affix workbench to frame (optional)
- Wire stripper
- Table and Saw
Step 3: Software List
- Jessie Debian OS
- Arduino IDE 1.0.6! Geekduino requires this.
- Adafruit neopixel library - which I bastardized it's light example to control jewel and ring independently but connected.
Development - Arduino/geekduino programs
- I started with my netbook/windows to program the arduino and test the pumps in the arduino IDE.
Development - Pi
- When I started the interface for the raspberry pi, I literally used nano on the pi to create the interface.
Download the software packages found here
NOT AVAILABLE AT THIS TIME - I have concerns that a business might be using my code and making money off this. I might release sections of code to help up and coming inventors, but not a full product to help deter those companies.
Step 4: Breaking It Down
Compared to other instructables, this is a small project, but if this is your first, it is a big undertaking.
Break it into problems
- geekduino, pumps, and programming. Get the Drinkzilla program up and running. Use the serial monitor in the IDE to send test commands. Once electronics work , build a frame/case.
- Build a case.
- Pi, touchscreen - get it running
- Kivy - get the demo program running
- Kivy - get the Drinkinator program running.
- Integration test (with water!)
- Once everything works, tackle the neopixel project. We deliberately used a second arduino to keep this simple. We did start to add serial hooks, but in the end decided to make it standalone and just run patterns all night
- Beta test
- Storage and cleaning
A note about this step's Image
We drew out everything to start, had a solid design, but we were flexible enough to simplify and adapt as we learned new things. While the final outcome wasn't the exact design, it was pretty darn close! In fact we had build the framework to support the utilities shown in the above diagram, now we just need to build fancy interfaces to do the work, but that wasn't necessary, so we didn't try to do it since text editing the resource files is trivial for now. In other words, don't take on too much, and keep it simple until you have all the pieces working!
Step 5: Pump Assembly and Geekduino Control
So your shipment has arrived, but then you have a big shocker, you have to assemble the pumps!
Go to the documentation and read the guide. It is very graphical
- Page: http://www.robotgeek.com/robotgeek-pumping-station#desc3
- Guide: http://learn.robotgeek.com/getting-started/58-robotgeek-pumping-station.html
- Build all the pumps
- Build all the spouts
- Put the pumps /spouts on a workbenchboard like in shotbot video.
- Put in tubing
- Label the pumps 0-11
- Using the Drinkzilla file as a guide, plug each pump into the appropriate pin. Note analog pin 0-7 corresponds to digital 14-21, as per http://learn.robotgeek.com/2-uncategorised/183-getting-started-with-robotgeek-wiring.html.
- Plug the squid cables into each pump and plug the power cables into the squids.
- Attach geekduino to sensor shield
- Using arduino IDE upload the drinkzilla sketch to the geekduino
Step 6: Testing Pump Hardware
- Put pump/spout/workbench on a box, similar to shotbot video. In my case I did a quick rig that took about an hour to build. What I learned was the pump and spout must be above liquid source!!!
- Get a large drink container , fill it with water, taking care to put input tubes from pump into it. Under the spouts, put another large container to catch the output.
Testing just the pump
- Press red button on top of each pump and prime the tubes. If it fails you may have made a mistake in wiring or input tube.
Testing pump with geekduino
To test, plug geekduino into your computer and upload the Drinkzilla code.
In the Arduino IDE serial monitor (the button on the top right of the screen), try these commands, but make sure to change the dropdown to NEWLINE in the serial monitor.
to test pump 0-4 send
pump 5-9 Send
pump 10-11 Send
If a pump fails, check wiring, then check you used right pins. If a pump runs for no reason, it is the same cause. I chose the pins I did because they are not reserved for other things by the geekduino.
A note about this step's gallery
Prototyping is an important part of development. In this case I went "all in" with the hardware and when I built a case I was lucky I tested it early before spending significant amounts of time developing it. The first rig I had was very compact and you can see I had the source and the destination cups below the pump. I thought the pumps were leaky because liquid still flowed even when the pumps weren't running. Then I rewatched that robot geek video and realized the spouts had to be at same height. As a result, I moved on to Mark II and had a bigger, but way more awesome rig with more room to do cooler stuff. Even better, I didn't take too much of a hit weight wise.
Step 7: Case Assembly
After integration the pumps, tackle building the case.
Make sure spouts are same level as the pumps. In my case the liquor bottles are placed in the area below the pumps.
My case is light and transports very easily
Step 8: Preparing the Raspberry Pi2 and Touchscreen
Not being a linux guy, this was painful. Debian is like taking a trip back to windows 3.1.
Some important points
- Setup Jessie to boot to command line. This solves the ctrl-c not working in kivy. Launching a kivy app from within the os gui's cli/terminal doesn't work. It must be a boot to command line!
- Ctrl -c to exit a kivy app
Videos of setup
Pi - https://youtu.be/xQ5f65VZEPY
Part 2 - https://youtu.be/AouPnWxBNek
Part 3 - https://youtu.be/2TWPYCQd1BQ
The Drinkinator code must be placed in a folder on the Pi, and ran via python "python main.py". If you just want to test the interface and don't have the hardware ready yet, just use "python main.py debug". It disables the serial hooks and enables more robust log lines.
Step 9: Setting Up the Drinkinator Program on the Raspberry Pi
The entire Drinkinator folder code must be placed in a folder on the Pi, and ran via python "python main.py".
If you just want to test interface and don't have the hardware ready yet, just use "python main.py debug". It disables the serial hooks and enables more robust log lines.
Step 10: Integration Testing
Using the same test rig you used to test the Geekduino, run a usb cable to the Geekduino from the raspberry pi.
Run "python main.py"
If it fails, your usb port might be different. Correct the line
You can figure out the proper port name by following the troubleshooting steps here
- Pick a size
- Pick a drink
- Click 'Serve'
The line to the right of the recipes is a scrollbar. There are 21 recipes at the time of this writing.
Step 11: Drinktray Light Show
Wire the neopixel jewel and ring as pictured.
We actually took one of the sensor wires and repurposed it so we didn't have to solder it to the Arduino. We liked the idea that pieces are modular and easily removed.
Install the Lightzilla program in this second Arduino and test the program. It takes a few seconds but it should start running infinite patterns.
We took a board and used a drill attachment to make a big round hole about 1/4" larger than the neopixel ring.
We cut a second board the same size and glued it below the board with the hole. This gave us a space for the neopixel to sit. We then primed and painted everything.
We then drilled a large hole in the middle of this resting place and threaded the neopixel wire through it to an Arduino sitting on the underside of the tray. We then used super adhesive tabs to secure the ash tray to the wood then used silicone around the tray to seal it! This Arduino will have its own power cord to power the board and neopixels. Since there is only two neopixels there should be a sufficient amount of power without needing a separate power for the neopixels.
Step 12: Setup for Real Use
Look at inventory.txt
Place the appropriate liquors in the appropriately numbered bottles. Place bottles under the pumps. I actually wrote the numbers on the underside by the tubes to make it easy. Similarly I had a printed version of inventory.txt in case I needed to do refills.
I placed juices in a side tupperware filled with ice to keep them chilled. See the virtual walkaround to see what it should look like:
- Plug in geekduino (power)
- Prime pumps (see note below)
- Attach geekduino to Pi via usb
- Start drinkinator program
- Start serving!
Priming the Pumps
This is a fun activity. Basically you use the manual pump buttons and free pour several shots. If you know your recipes, it can take as little as four shots to prime everything!
In my case I use the following to create four shots manually to prime the pumps
- Polar bear
- Blue lagoon
- Walk on the beach (passion)
- Little piece of heaven (?)
Step 13: Customizing
In Drinkinator's main.py code on pi, update drinksize amounts to correspond to your glass sizes. Eventually I will create a "glasssize.txt" to make this easy. The current glass sizes are essentially:
- Glass=2oz shotglass
- Tall=3oz shotglass
- Glass =tumbler glass
I believe 3000=1oz and you will want to calculate to about 80% of that.
Inventory and Recipes
The bar manager library was a simple / quick program that does three key things:
- Inventory.txt says what liquids are on what pump. When barmanager loads the recipes it creates a menu consisting of all recipes that have ingredients found in inventory.txt. This menu is used to generate the buttons on the touchscreen.
- The bar manager loads recipes specified in drinkindex.txt. The actual recipes are found in the recipe folder. To add a recipe, create a text file in same format as the others, then create a reference in the drinkindex.txt
- If you have a good recipe, convert amounts to percentages of the recipe. The bar manager will convert it to amounts when it has to look at size if glass it has to fill.
The beauty of the barmanager library is that it allows you to scale up or down the pump number very easily.
Changing number of Pumps
Inventory.txt indicates the number of pumps and what ingredients are on what pump. Adding or removing these lines tells the PI what's available. You then need to update drinkzilla program to recognize (or remove) what pin numbers your new/removed pumps are on. Once this is done, just restart the Drinkinator program/upload the new arduino program and the barmanager will figure out everything.
A note about customization
I fully intend to build in utilities into the kivy program to manage these so the text files are never modified manually.
Step 14: Maintenance
So at the time of writing this, I couldn't find any manufacturer recommendations for this. Please give feedback if you have some good ideas!
My thinking in this is that liquor and sugary liquids like rum, blue caracao will stain and cause blockage.
My solution is to first remove liquor bottles. Then empty the tubes as much as possible by serving 3 or 4 shots. In my case I served polar bear, piece of heaven, butterscotch, blue lagoon and this pretty much emptied all the tubes. In some cases I had to use the red manual button to finish the job. No wasted alcohol, just strong last shots :)
Then, placing a drink container with hot water, I ran each pump for 30 seconds, draining the output to the sink using funnel and a large tube.
- Remove funnel, remove tubes, wash all.
- Run pumps with a cloth under each pump to drain remaining liquid.
- Seal tubes and funnel in bag until next use when finally dry.
Step 15: Drinks and Ingredients Notes
Canadians get peppermint schnapps, creme de menthe and creme de cocoa in clear liquids. They look/taste different then 'AfterEights' and actually should be served very cool by shaking with ice, hence the "polar bear" name.
Looking back I noticed some recipes may have been overwritten. I plan on going and fixing them. I will likely make a customdrinkindex.txt so updates don't overwrite any user added recipes. That should be done by end of year.
Step 16: Visual Touches for Fun
Step 17: Taking the Drinkinator to the Next Level
Check out the Music Light Effects I've added to the Drinkinator:
- Instructable: https://www.instructables.com/id/Drinkinator-Musica...
Drinkinator V2.5 Visual - See other videos on youtube channel for the different music modes