Introduction: 6-Shooter: Arduino Drink Mixing Station

About: The RobotGeek team is a 6-man operation that wants to make it even easier to use Arduino to make electronics and robots. Check out our instructables and robotgeek.com for all of our awesome kits.

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 instructable 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: Project Parts List

Step 2: 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:

  1. Get your Relay, Solenoid Valve, DC Female Jack Pigtail, and a wire nut ready
  2. Attach a wire from the Solenoid Valve to the center terminal on your Relay
  3. Attach your Ground wire from the DC Jack to NO or Normally Open on your Relay
  4. 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:
Component:Sensor Shield Port:
Pump RelayDIO-2
Air Line Solenoid RelayDIO-4
Neopixel RingDIO-6
Solenoid Valve Relay 1DIO-7
Solenoid Valve Relay 2DIO-8
Solenoid Valve Relay 3DIO-9
Solenoid Valve Relay 4DIO-10
Solenoid Valve Relay 5DIO-11
Solenoid Valve Relay 6DIO-12
RobotGeek 4-line LCDI2C
Up ButtonAIO-0 (as DIO-14)
Up ButtonAIO-1 (as DIO-15)
Up ButtonAIO-2 (as DIO-16)
Up ButtonAIO-3 (as DIO-17)

Step 3: Assembly

Arrange your components so that the wires are not stressed and the electronics are clear of liquid danger. Another consideration is keeping 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 mspaint) to make sure you're running your liquid lines with the proper orientation to function with the pump.

Step 4: 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:

File → Sketchbook → RobotGeekSketches → Demos → drinkStation

And let's take a look at the code.

// 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 5: 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!