Introduction: Drink Machine

This drink machine was made with the intention to facilitate the ways we pour our drinks.

Step 1: MATERIALS

  • 1x SG Big Servo
  • 1x SG90 Micro Servo
  • 1x Arduino Uno
  • 4x Small Screws
  • 1x Paint Stick
  • 1x Drill
  • 1x Drinking
  • Straw 1x
  • Tin Sheet
  • 1x Wooden Dowel 3 ft Copper Pipe
  • 1x Copper T Joint 6x Wires
  • 1x Elastic Band
  • 1x Straw
  • 1x Cup Wood Electrical Tape

Step 2: Creating the Rotating Platform

Necessary Materials: -

  • 1x Tin Sheet
  • 1x Wooden Dowel
  • Tape -
  • 1x Screw
  • 1x Cup
  • 1x Paint Stick
  • Hot Glue
  1. Cut the tin sheet to the desired shape and tape the edges to avoid cuts.
  2. Hot glue the paint stick to the bottom of the tin sheet to provide some extra rigidity.
  3. Pre-Drill a hole in the middle of the tin sheet and attach the wooden dowel with a screw (Note: You may need to attach extra weights to counterbalance the weight of the dispensed liquid)
  4. Cut the bottom off of a cup to hold your drinking glass and hot glue to one side of the tin sheet.

Step 3: Creating the Bottle Stand and Arduino Enclosure


Necessary Materials: -

  • 3 ft Copper Pipe
  • 1x Copper T Joint
  • Wood
  • Hot Glue
  • Drill
  1. To protect the arduino from spill damage, use the wood to create an enclosure, drill a hole in the top of the enclosure for the support.
  2. Cut the copper pipe to the desired height to hold the bottle.
  3. Using the bottle of choice, create a holder made of wood and drill two holes, one to attach to the copper pipe, and one to wrap around the neck of the bottle.
  4. Attach the holder to the copper pipe atop the copper T-Joint using hot glue.

Step 4: Creating the Bottle Pour Spout

  • 1x Plastic bottle.
  • 1x small piece of plastic
  • 1x bendable straw
  • 1x small arduino connector
  • 1x cable holder
  • Hot Glue
  • Drill
  1. Use the hot glue gun to attach the arduino connector to one of the side of the small piece of plastic. (As shown in Picture 1).
  2. Use the hot glue gun to attach the cable holder to the other side of the small piece of plastic. ( As shown in Picture 1).
  3. Make a hole through the cap of the water bottle roughly the same diameter of the plastic straw.
  4. Use the hot glue gun to attach the plastic straw to the bottle cap. Use the hot glue gun to seal the straw in order to maintain the desired liquid once its tipped upside down.

Step 5: Set Up Arduino

  • 1x Elego UNO R3
  • 6x male to male cable
  • Arduino R3 Proto Shield Kit
  • 1x firewire cable
  1. Connect the Protoshield to the arduino.
  2. Connect the big servo to the digital input ~10(as shown in the graph)
  3. Connect the small servo to the digital input ~9 ( As shown in the graph)
  4. Connect the grounds on both
  5. Use the 5v receiver to connect the Servos.( if you are using more than two servos please look into obtaining an AdaFruit extender.
  6. If the protoshield is used, you will be able to connect the required two 5V without much hassles.

Step 6: The Code

#include

Servo smallServo; // create servo object to control a servo

Servo bigServo;

int pos = 0; // variable to store the servo position

int pos2=0;

void setup() {

smallServo.attach(9);// attaches the servo on pin 9 to the servo object

bigServo.attach(10); // attaches the big servo to pin 9

}

void loop() {

smallServo.write(0); // inits servo to zero positino

bigServo.write(0); // init servos to zero positino delay(1000);

for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees

bigServo.write(pos); // tell servo to go to position in variable 'pos'

delay(10); // waits 10ms for the servo to reach the position

}

delay(1000);

for ( pos2 = 0; pos2 <= 165; pos2 += 1) { // goes from 0 degrees to 180 degrees

// in steps of 1 degree

smallServo.write(pos2); // tell servo to go to position in variable 'pos'

delay(5); // waits 15ms for the servo to reach the position

}

delay(20000); // THIS DELAYS CONTROLS HOW LONG THE STRAW POURS LIQUID

for (pos2 = 165; pos2 >= 0; pos2 -= 1) { // goes from 180 degrees to 0 degrees

smallServo.write(pos2); // tell servo to go to position in variable 'pos'

delay(5); // waits 5ms for the servo to reach the position

}

for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees

bigServo.write(pos); // tell servo to go to position in variable 'pos'

delay(15); // waits 15ms for the servo to reach the position

}

bigServo.detach(); // REMOVES THE SERVO TO PREVENT CONTINOUS MOVEMENTS.

smallServo.detach();

}

Step 7: Put Elements Together

  1. Please be aware that liquids can possibly damage your electronics. Be cautious when running the machine with liquids.
  2. Attach the big servo to the rotating tray.
  3. Attach the small servo to the copper tube and run the source code provided(Note: Don't use liquids during this run). This will allow you to be able to calibrate the straw and to make sure both the tray and the straw are running in synch.
  4. If satisfied with the movement of the rotating tray and the straw. Proceed to test it with water.
  5. Seal the Arduino inside the box.
  6. Enjoy your drink.