Bartender Bot
Lo and behold, my latest project: The Bartender (bot). It displays cocktails that can be mixed based on the given input and utilizes a hardcoded database of over 117 cocktails. I wrote my own parser library which you can find here, as well as a separate library for the pumps and GUI control. The whole program totaled to just under 1000 lines of code, but could definitely be more efficient due to my lack of coding expertise. The frame was built from thin sheets of wood I cut out and painted black, and the miscellaneous parts (cupholder, funnel, touchscreen frame, etc.) were 3D printed.
During the R&D process, I found that the most common methods used when creating something similar were either to use peristaltic pumps or a conveyer belt that moved the cup under each required drink (see example). For the sake of simplicity, saving space, and personal aesthetic purposes I decided to go with the peristaltic pump model.
Supplies
- Wood sheets (60x60cm)
- 20mm wide wooden rod
- Jigsaw, power drill
- Black spray paint
- 12v LED strip
- 14x Peristaltic pumps
- Food grade tubing (make sure it's alcohol safe!)
- Arduino Mega
- SD card (a few GB is more than enough)
- TFT touchscreen display
- Plenty of jumper wires
- 14x TIP120 NPN transistors
- 14x 1k Ohm resistors
- 14x flyback diode (1N400X series does the trick)
- Power supply (TXLN 035-212)
- Breadboard/Perforated board
Research and Design
Every project starts with R&D! This is one of my favorite parts because it leaves the most room for creativity. As the project develops, you'll have fewer chances to make significant changes, so it makes sense to plan everything out first. The first image is the schematic I created for the circuit- you'll need to repeat the circuit for every peristaltic pump used. Because the pumps run on 12v and the GPIO output on the Mega is 5v, I had to use a transistor or relay to control the motors. I included a flyback diode as an extra protection measure, and a 1K ohm resistor on the GPIO output of the Mega. The rest of the slides show some of my early sketches and brainstorms for the model, circuit layout, and an early user flow diagram.
Assembling the Prototype
This is my first prototype that worked as a proof of concept as well as a body for holding everything in place while I tested the code. I made it out of an old box from Ikea that had been lying around and zip-tied all the parts to hold them in place. Don't waste energy making the prototype look fancy!
Implementing the Electronics
After making a basic bare-bones version of the code that tested the circuitry, I attached it to the prototype and hooked everything up. Unfortunately, I couldn't upload the videos on here that showcase testing the pumps and GUI, so I added a picture of my home lab instead. Please excuse the mess!
Setting Up the GUI & Finalizing the Code
Once my parser was finished, I started working on the GUI and user flow. This was quite the hurdle for me since I had zero experience making GUIs, and the libraries available to design them are a pain in the neck. I didn't want to use a GUI builder (or someone else's parser) because that would dumb down the learning process, so I made it from scratch. After learning the Adafruit_GFX library, using a bit of math, and a lot of testing, I finally made a working (yet buggy) user interface. Once the software part of this was in a working state, I implemented it with the prototype and was ready to build the final model.
Cut and Paint
After I had planned out the dimensions for the whole thing, I got to cutting and putting it all together. I double-checked that everything was sized correctly, and once I got the green light I went ahead and gave the whole thing a matte black paint job.
3D Printing
I needed a way to attach the pumps without being intrusive to the design while also allowing me to replace them if needed. For this, I bought a wooden rod, designed a part that lets the motor slide into place, and zip-tied each motor down. This gave me the opportunity to not only replace the pumps but also to change the amount I was using. I had also designed a cupholder, a funnel, and something that'll hold the touchscreen in place.
Attaching Everything
As everything finished printing, I could begin to put everything together. I started with an LED strip around the top to give the machine a nice aesthetic, and then added pumps that ran from the back to the front. After the pump holders were printed, I attached them to the rack and printed a part that'll hold them in place. I connected all the electronics to the breadboard which I had glued to the bottom as well as the power supply. The great thing about these pumps is that they're incredibly modular- you can replace just the tubing, the head, or the entire motor if needed.
Uploading the Code
Once everything was in place, I flushed out most of the bugs, uploaded the code, and had my first robot-made cocktail!