Project tutorial
Arduino Robot Arm Mixologist

Arduino Robot Arm Mixologist © CC0

Mix some drinks with a robot arm! People love robotic bartenders!

  • 2,794 views
  • 0 comments
  • 11 respects

Components and supplies

Apps and online services

About this project

"But wait," you say, "I thought RobotGeek already published a project using a robot arm to deliver drinks!" To which we say, "Yes, but not like this." The last project could dish out one drink to multiple people. This project mixes the perfect beverage with style and class. We split this up into two separate projects because this one is a bit more advanced than the last. Welcome to the Robot Arm Mixologist. This project utilizes a RobotGeek Snapper Arm with a Pumping Station to mix liquids from multiple containers.

We will be using a Demo code to show off how to make alterations to the code generated by the Arm Link Software. We will use this to program the arm's movements.

Step 1: Assembly

Follow the guides for each of the components:

Snapper Arm Assembly Guide

Pumping Station Assembly Guide

RobotGeek LCD Assembly Guide

Instead of attaching the gripper to the end of the snapper, we will be making a spout system and running the silicone tubing up the arm, from the pump to the spout. Pictured is a way to make the input end. You can achieve a similar effect with a large straw.

Raise the Snapper arm up on the 100mm Standoffs to clear the tops of the containers you're pulling from.

Attach the LCD, pushbutton, and joystick where they can be easily reached, and out of the path of the arm.

Step 2: Wiring

Make sure that the 6V power supply is running the pump, and the 7V power supply is plugged into the Arduino. The Power pins on the Sensor Shield should be set to VIN to supply the full 7V power to the servos in the Snapper Arm.

Step 3: Demo Code Part 1: Installing and Testing

The Demo Code can be found here:

https://github.com/robotgeek/SnapperArm

Unzip and find the Demo under:

SnapperArm -> Demos -> SnapperArmPlayBackMixologist

Load the sketch onto your board, and play with it a bit. If everything works as expected, your wiring and build are correct. If you are happy with this configuration, you can call it a day here, and start partying with your robot arm mixologist, but if you would like to know how to program the movements and add/change drinks, continue on! There is much to learn!

Step 4: Software Set Up

In order to make our own sequences, we're going to need to set up the Arm Link software. This isn't hard, but it is involved, so make sure to follow along carefully.

Download the Snapper Arm Sketches

  • Unzip to your Arduino Sketches folder. You will need to know where this is later.
  • Download the ArmLinkLibrary and Extract the ArmLink folder to your Arduino libraries folder.
  • Open the Arduino IDE, and open File -> Examples -> ArmLink -> SnapperArmLinkSerial
  • Uncomment one of the following lines: //#define GRIPPER_TYPE ROBOT_GEEK_9G_GRIPPER #define GRIPPER_TYPE ROBOT_GEEK_PARALLEL_GRIPPER It doesn't matter which, because we will not be using a gripper for this project
  • Make sure your Robot Bartender is plugged into your PC via USB, and upload the firmware.

Setting up Processing

  • Download and extract Processing 3 for your operating system
  • Open Tools -> Add Tool... and in the window that pops up, click on the Libraries tab.
  • Search the library for G4P and install it.
  • Search the library for Video , and install the Video Library authored by the Processing Foundation
  • Make sure your Robot Bartender is plugged into your PC via USB and open ARMLink.pde . Processing 3 should open to a window with the InterbotiX Arm Link code.
  • Press the Triangle button in the top left corner of the window. This will run the Arm Link Software.
  • Select the COM port your Bartender is on and click Connect.

Step 5: Making the armSequence File

  • Once you are connected to your Bartender, the Arm Link software will display the Control Panel, Sequence Panel, I/O Panel, and Mode Panel below the Setup Panel.
  • Click on Cylindrical in the Mode Panel. This mode gives us easy to understand control with good reach. The Control Panel will change.
  • Tick the Save Digital Outputs box.
  • Click on New Pose . This will let us save each position we set the arm to.
  • Tick the Auto Update box at the bottom of the control panel. This will move the arm as we adjust the sliders in real time.
  • Once the arm is in a position you'd like it to be in, you can click the Save Pose button to save it to the active sequence.
  • For each pose you want, hit new pose, adjust the sliders to move the arm to the position you want, and hit Save Pose . If you want to turn the pump on, tick box 13 in the Digital Output section of the I/O Panel. Mind the Pause (Ms) section of the control panel. This will be the amount of time your pump will stay on. Be sure that if you would like the pump to turn off before moving that the next pose you create has box 13 unchecked.
  • Once you have all the poses you want, click the Save to File button in the Sequence Panel.
  • Navigate to the SnapperArm -> SnapperArmPlayback folder that you downloaded earlier, and click Open to save.

Step 6: Demo Code Part 2: Altering automatically generated files

With SnapperArmPlaybackMixologist.ino loaded in the Arduino IDE, it should also load GlobalArm.h , Kinematics.h , and armSequence.h . We will be taking a look at armSequence.h .

To begin with, each of the movements here were from 4 separate armSequence files generated by Arm Link. For the Mixologist, we combined these files into a single armSequence file by adding each void playSequence, and changed a few things in the generated code.

volatile int playState1 = 0; // 0 = stopped 1 = playing
volatile int playState2 = 0; // 0 = stopped 1 = playing
volatile int playState3 = 0; // 0 = stopped 1 = playing
volatile int playState4 = 0; // 0 = stopped 1 = playing

We keep one of the headers, and add a volatile int playState for each of the ArmLink generated sequences.

void playSequence1()

We separated every playState and playSequence() by adding a number, so we can call upon them as needed in the main code. Pay attention, there are many instances of playState throughout each sequence, and all of them must be changed for this to work when you make your own movement set.

If you'd like to make custom sequences for different sized containers, or to add more arm sequence positions, pay attention to the layout in the default armSequence.h, make your own armSequence.h in ArmLink, and manually add it to the armSequence.h for the mixologist using the tips we've pointed out here. It's not hard, it's just involved, so try to keep it organized.

Step 7: Demo Code Part 3: Adding and Changing Drinks

Take a look at SnapperArmPlaybackMixologist.ino . There is an array containing all the drinks that can be served with the arm. If you were to replace the colored water with other beverages to be mixed, that would certainly warrant renaming these.

String drinkLine[12] = {"Select Drink:",
                        "Red", 
                        "Green",
                        "Blue",
                        "Yellow",
                        "Red and Green",
                        "Red and Blue",
                        "Red and Yellow",
                        "Green and Blue",
                        "Green and Yellow",
                        "Blue and Yellow",
                        "Please Wait..."
                        };

Keeping "Select Drink:" and "Please Wait..." intact, changing the names here will change them on the screen. Be aware that the LCD is only capable of displaying up to 16 characters per line, so anything over that will not be displayed.

You can also tell the arm which reservoirs to pull from later in the code by having it call upon a different playSequence():

 else if (drinkSelectCounter == 7)
      {
        digitalWrite(LED1, HIGH);
        digitalWrite(LED4, HIGH);
        playSequence1();
        playSequence4();
        digitalWrite(LED1, LOW);
        digitalWrite(LED4, LOW);
      }

This snippet of code lines up with the "Red and Yellow" drinkLine. If, for instance, you wanted it to instead serve Red, Green, and Blue, you would change the name in the drinkLine to something such as "Red Green Blue":

String drinkLine[12] = {"Select Drink:",
                        "Red", 
                        "Green",
                        "Blue",
                        "Yellow",
                        "Red and Green",
                        "Red and Blue",
                        "Red Green Blue",
                        "Green and Blue",
                        "Green and Yellow",
                        "Blue and Yellow",
                        "Please Wait..."
                        };

Then, later in the code, we would add the appropriate playSequences and write to the LEDs corresponding to the drinks we were serving, like so:

 else if (drinkSelectCounter == 7)
      {
        digitalWrite(LED1, HIGH);
        digitalWrite(LED2, HIGH);
        digitalWrite(LED3, HIGH);
        playSequence1();
        playSequence2();
        playSequence3();
        digitalWrite(LED1, LOW);
        digitalWrite(LED2, LOW);
        digitalWrite(LED3, LOW);
      }

and

 else if (drinkSelectCounter == 7)
  {
    digitalWrite(LED1, HIGH);
    digitalWrite(LED2, HIGH);
    digitalWrite(LED3, HIGH);
    digitalWrite(LED4, LOW);
  }

This is just an example of what you can do. Dream something up, and try it out!

Step 8: You're done!

Heck, you've got yourself a robotic arm that serves mixed drinks. Be proud. Throw a party! Everyone loves watching a robot arm mix their drinks (it's true, people stand around mesmerized watching this thing every time I turn it on at the office). There are still I/O ports open on this bad boy, so it's not out of the question to add things like Neopixel rings, buzzers, or even input sensors that aren't a simple button to activate sequences. Mess around with it and see what you come up with, and show us what you've got!

Code

Code snippet #8Plain text
String drinkLine[12] = {"Select Drink:",
                        "Red", 
                        "Green",
                        "Blue",
                        "Yellow",
                        "Red and Green",
                        "Red and Blue",
                        "Red and Yellow",
                        "Green and Blue",
                        "Green and Yellow",
                        "Blue and Yellow",
                        "Please Wait..."
                        };
Code snippet #9Plain text
      else if (drinkSelectCounter == 7)
      {
        digitalWrite(LED1, HIGH);
        digitalWrite(LED4, HIGH);
        playSequence1();
        playSequence4();
        digitalWrite(LED1, LOW);
        digitalWrite(LED4, LOW);
      }
Code snippet #10Plain text
String drinkLine[12] = {"Select Drink:",
                        "Red", 
                        "Green",
                        "Blue",
                        "Yellow",
                        "Red and Green",
                        "Red and Blue",
                        "Red Green Blue",
                        "Green and Blue",
                        "Green and Yellow",
                        "Blue and Yellow",
                        "Please Wait..."
                        };
Code snippet #11Plain text
      else if (drinkSelectCounter == 7)
      {
        digitalWrite(LED1, HIGH);
        digitalWrite(LED2, HIGH);
        digitalWrite(LED3, HIGH);
        playSequence1();
        playSequence2();
        playSequence3();
        digitalWrite(LED1, LOW);
        digitalWrite(LED2, LOW);
        digitalWrite(LED3, LOW);
      }
Code snippet #12Plain text
  else if (drinkSelectCounter == 7)
  {
    digitalWrite(LED1, HIGH);
    digitalWrite(LED2, HIGH);
    digitalWrite(LED3, HIGH);
    digitalWrite(LED4, LOW);
  }
Github
https://github.com/robotgeek/SnapperArm
Github
https://github.com/Interbotix/ArmLinkLibrary
Github
https://github.com/Interbotix/ArmLinkSoftware

Schematics

Schematics
Wiring diagram
Pub76khwwom2t2jsazao

Comments

Similar projects you might like

Arduino Robot Arm Bartender

Project tutorial by Team RobotGeek Projects Team

  • 3,616 views
  • 1 comment
  • 13 respects

MeArm Robot Arm - Your Robot - V1.0

Project tutorial by Benjamin Gray

  • 19,303 views
  • 3 comments
  • 34 respects

Gesture Controlled Trainable Arduino Robot Arm via Bluetooth

Project tutorial by KureBas Robotics

  • 11,563 views
  • 41 comments
  • 98 respects

Control Arduino Robot Arm with Android App

Project tutorial by Slant Concepts

  • 9,002 views
  • 7 comments
  • 26 respects

LittleArm: Arduino Robot Arm

Project showcase by Slant Concepts

  • 15,632 views
  • 1 comment
  • 71 respects
Add projectSign up / Login