Arduino-Driven 6-Shooter Drink Mixing Station – Build Your Own Cocktail Automator
Components and supplies
RobotGeek Geekduino
×
1
RobotGeek Sensor Shield
×
1
RobotGeek Duino Mount
×
1
RobotGeek Mega Workbench
×
1
RobotGeek 4 Line I2C LCD Control Panel
×
1
RobotGeek Drink Station
×
1
RobotGeek NeoPixel Ring - 16 x WS2812 5050 RGB LED
×
1
RobotGeek 12V DC Liquid Pump
×
1
RobotGeek Solenoid Valve
×
7
RobotGeek Relay
×
8
RobotGeek 12V/10A Power Supply
×
1
RobotGeek 6V/2A Power Supply
×
1
RobotGeek DC Power Squid
×
2
RobotGeek Silicone Tubing
×
1
RobotGeek 3-Pin Coupler
×
1
RobotGeek Standoff Variety Pack
×
1
RobotGeek 3-Pin Sensor Cable
×
1
Check Valve
×
1
6 Outlet Splitter Distributor Valve
×
1
Arduino UNO
OPTION: In place of the Geekduino, you can use any standard Arduino UNO/Duemilanove board.
×
1
Apps and online services
Arduino IDE
About this project
Introduction
Want to mix drinks with a push of a button? The 6-Shooter can mix and match combinations of 6 different drinks with a single pump! Just select your drink from the list, push the button, and off it goes pouring your drink and giving you a light show, no less! In this tutorial we'll be making something similar to the Somabar. Note that this is a fairly expensive project, but it really blows minds at parties. Want to make your own? Let's get started!
Step 1: Wiring
This looks like some pretty intense wiring, and it is a bit of a mess, but it's really just the same process repeated several times over.
To hook up your Solenoid Valves to Relays:
Get your Relay, Solenoid Valve, DC Female Jack Pigtail, and a wire nut ready
Attach a wire from the Solenoid Valve to the center terminal on your Relay
Attach your Ground wire from the DC Jack to NO or Normally Open on your Relay
Attach the other lead from your Solenoid Valve to the Voltage wire from the DC Jack, either by using a wire nut or soldering the connection. We used wire nuts because we're fans of quick and dirty, but you'll get a better electrical connection by soldering.
The same process as listed above applies to the pump, minding that the Negative (Black, Ground) lead goes to the center terminal on the Relay, and the Positive (Red, Voltage) lead goes to the DC Jack's Voltage wire.
Build your LCD Control Panel and RobotGeek Drink Station before wiring.
Attach your components to the Sensor Shield:
Step 2: Assembly
Arrange your components so that the wires are not stressed and the electronics are clear of liquid danger. Another consideration is keeping the wire mess contained between the two workbench plates. Check out the pictures for inspiration on arranging your components, and check out the wonderful diagram (ten thousand hours in MS Paint) to make sure you're running your liquid lines with the proper orientation to function with the pump.
Step 3: Programming and Testing
You'll need to grab the RobotGeek Libraries and Tools. Included are all the libraries used for the 6-Shooter, and the demonstration code to get you running. Put it in your Arduino folder, open the IDE, and load up:
// Selections
String selectionLine[14] = {
" ", //buffer line. Leave here or experience terror.
"1. Red ",
"2. Green ",
"3. Blue ",
"4. Yellow ",
"5. White ",
"6. Black ",
"7. Red & Yellow ",
"8. Green & Blue ",
"9. Black & White ",
"10. Black & Yellow ",
" ", //buffer line. Leave here or experience terror.
" ", //buffer line. Leave here or experience terror.
"End of List " //buffer line. Leave here or experience terror.
};
This is the list of drinks. These names will show up on the LCD screen, and can be scrolled through to be selected. You can change this to accurately reflect the drinks and mixtures available.
int PUMP_TIME = 2500; //Time for pumping station to run in milliseconds
This is the default pump running time. You can change this to deliver larger shots by default.
LiquidCrystal_I2C lcd(0x27, 20, 4); //I2C 4 Row 20 Col LCD Screen at 0x27
//LiquidCrystal_I2C lcd(0x3F, 20, 4); //I2C 4 Row 20 Col LCD Screen at 0x3F
This is where we call the screen. Some screens are addressed differently than others, so if the screen doesn't display the list when you load up the sketch, change the address here.
if ( debounce[2].fell() )
{
switch (drinkSelectCounter)
{
case 1: // Red
lcd.setCursor(0, 0);
lcd.print(promptLine[2]);
colorWipe(strip.Color(255, 0, 0), 50); // Red
digitalWrite(PUMP_RELAY_PIN, HIGH); // Turn on the pump
digitalWrite(SELECTED_RELAY_PIN[0], HIGH); // Open Solenoid valve 1
delay(PUMP_TIME); // Run for the set amount of time
digitalWrite(SELECTED_RELAY_PIN[0], LOW); // Close Solenoid valve 1
digitalWrite(CLEAN_RELAY_PIN, HIGH); // Open Solenoid valve 7
delay(PUMP_TIME); // Run for the set amount of time
digitalWrite(CLEAN_RELAY_PIN, LOW); // Close Solenoid valve 7
digitalWrite(PUMP_RELAY_PIN, LOW); // Turn off the pump
break;
This is the call for the drink, and the operations for the first drink on the list. You can add or change each case as you see fit for the drink you want to mix. Each case is a line of actions, starting with changing the prompt on the screen, followed by turning on the lights, followed by the sequence of opening the proper valve and running the pump. You should only run the pump if at least one valve is open.
Upload the code to your microcontroller and give it a whirl! We suggest testing it with some water first, just in case something in your build is funky. Make sure to test every valve individually before testing mixtures. Once you are satisfied with the operation, start planning a party!
Step 4: Party down!
Now you have an automated bartender! Your guests will flip when they get a perfectly crafted drink from a robot with the push of a button! What can you do from this point? What about adding Bluetooth functionality and making an app for your guests to select their drinks from their phone (MIT App Inventor is a great tool for this)? How about adding a robot arm to deliver the drinks to multiple glasses and really knock their socks off? Maybe you could find a way to put this bad boy on a rover and have a drink serving droid rolling around your house? As always, we'd love to hear what you come up with!
Code
Code snippet #2
Code snippet #5
Code snippet #2Plain text
// Selections
String selectionLine[14] = {
" ", //buffer line. Leave here or experience terror.
"1. Red ",
"2. Green ",
"3. Blue ",
"4. Yellow ",
"5. White ",
"6. Black ",
"7. Red & Yellow ",
"8. Green & Blue ",
"9. Black & White ",
"10. Black & Yellow ",
" ", //buffer line. Leave here or experience terror.
" ", //buffer line. Leave here or experience terror.
"End of List " //buffer line. Leave here or experience terror.
};
Code snippet #5Plain text
if ( debounce[2].fell() )
{
switch (drinkSelectCounter)
{
case 1: // Red
lcd.setCursor(0, 0);
lcd.print(promptLine[2]);
colorWipe(strip.Color(255, 0, 0), 50); // Red
digitalWrite(PUMP_RELAY_PIN, HIGH); // Turn on the pump
digitalWrite(SELECTED_RELAY_PIN[0], HIGH); // Open Solenoid valve 1
delay(PUMP_TIME); // Run for the set amount of time
digitalWrite(SELECTED_RELAY_PIN[0], LOW); // Close Solenoid valve 1
digitalWrite(CLEAN_RELAY_PIN, HIGH); // Open Solenoid valve 7
delay(PUMP_TIME); // Run for the set amount of time
digitalWrite(CLEAN_RELAY_PIN, LOW); // Close Solenoid valve 7
digitalWrite(PUMP_RELAY_PIN, LOW); // Turn off the pump
break;