Introduction: Drink Dispenser

This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com)

This project demonstrates how to make a drink dispenser that will dispense 3 types of drinks with 3 different liquids. For example, I gave my drink dispenser the option to make a vodka soda, vodka juice, or vodka juice soda. The code I used to program allows the user to change the types of drink titles and also how long the pumps will be on for each drink type.

Supplies

3 x Peristaltic Pumps

Silicon Tubing

2 Motor Controllers (L298N)

Arduino Nano

LCD Display

Rotary Encoder

Bread Board

Wiring

12 Volt Wall Charger

Step 1: Frame

There are 3 main parts of the frame.

The top part, which is like the nozzle, where the pumps will be attached and where the tubing will be fed through.

The bottom part, which is a box that all the electrical wiring will be placed in and also the resting spot for the cup.

The stands, which will hold the top part above the bottom part.

The control panel, which will hold the LCD display and rotary encoder in place.

Of course, you can design your drink dispenser however you'd like. I found my way very simple, but I would eventually like to 3D print the entire frame when I get the chance.

For the top part and control panel, I actually 3D printed. Please see the picture.

For the stands, I used PVC pipe. I used this material for the stands because they were really easy to cut, so I could get the exact measurements of how high I want the top part to be above the cup when it is placed.

For the bottom part, I used a rectangular box with a lid. This housed all the electrical wiring in it. I drilled a hole in the side of it where the power supply cord, wiring for the LCD display, and rotary encoder will come out.

Lastly, the tubing needs to be connected to the inputs and outputs of each peristaltic pump. The input ends of the tubings can be placed in any container of liquid. The output end of the tubings needs to be fed through the top frame which dispenses liquid above the cup.

Step 2: Wiring

The wiring is pretty simple. The 2 motor controllers, LCD display, and rotary encoder are all hooked up to the Arduino Nano. And the pumps are hooked up to the motor controllers. I supplied the 12 volts to the Arduino Nano as well.

You can see the exact wiring placement in the picture.

In my project, you can see that there is also a weight sensor. You can ignore that. I am planning on using it once I program a more advanced code.

Step 3: Code

For my coding I used Arduino.

To explain the main functionality of the code, I first defined all my inputs for the motors. The main one I used was in1, 1n3, and in5, which were motors 1, 2, and 3.

I then created a loop that will detect the screen changed on the LCD. I gave the LCD, 3 different screens that will show the user the types of drinks to choose from. I also used the digitalWrite code to detect the clicks on the rotary encoder.

The main loop contained 3 different parts that control the motors for the specific drink being called. I used the if and else code to detect when the rotary encoder is clicked and when it is not. If the rotary encoder is clicked it will call the motors to turn on with a delay added. The delay is added to determine how the how long the pump will run for its liquid.

You can change the titles for the drinks and also the delays to customize the desired drinks.