Build a Robot Barista That Mixes Your Own Coffee Drink! ☕
Meet Beanie — a friendly Arduino robot that uses servo motors to add ingredients and stir them up, just like a real barista! Follow our easy step-by-step guide, circuit diagram, and code to build your very own.
👋 Say hi to Beanie, your robot barista!
What Is a Robot Barista, Anyway?
A robot barista is a machine that can pour, add, and mix ingredients — just like a person making a drink! In this project, we'll use an Arduino (a small computer brain) and servo motors (motors that can move to exact angles) to build a mini robot that tips ingredient cups and stirs them together automatically.
This is a great first robotics project because it teaches you three big ideas used in real robots everywhere: sensing, deciding, and moving.
What You'll Need
Gather these parts before you start. Most are cheap and easy to find in any beginner Arduino kit!
Arduino Uno
The brain that controls everything.
SG90 Micro Servo Motors
Two tip ingredient cups, one stirs.
Breadboard
For connecting wires without soldering.
Push Button
Press it to start the mixing routine.
USB Cable
Connects Arduino to your computer.
4x AA Battery Pack
Powers the servos once it's unplugged.
Jumper Wires
Male-to-male and male-to-female.
Small Cups + Popsicle Stick
Ingredient holders and a stirrer arm.
The Circuit Diagram
Here's how everything connects. Don't worry — servos only need 3 wires each!
Step-by-Step Build Instructions
Ask an adult to help with the button wiring and battery pack. Ready? Let's build Beanie!
Set up your breadboard
Place your breadboard next to the Arduino. Connect the Arduino's 5V pin to the breadboard's red power rail, and GND to the blue ground rail.
Wire the three servos
Each servo has 3 wires: red (power), brown/black (ground), and orange/yellow (signal). Connect red to the power rail, brown to the ground rail, and orange to pins 9, 10, and 11.
💡 Tip: Label your servos "A," "B," and "Stir" with tape so you don't mix them up!Add the push button
Connect one leg of the button to pin 2, and the other leg to GND. This button will tell Beanie when to start mixing.
Build the ingredient tippers
Tape a small cup to the horn (the little arm) of Servo 1 and Servo 2. When the servo turns, the cup should tip forward and pour into Beanie's mixing cup below.
Attach the stirrer
Glue a popsicle stick to Servo 3's horn, positioned so the tip dips into the mixing cup. This servo will rock back and forth to stir!
Upload the code and test
Plug in your Arduino, upload the code below, then switch to battery power. Press the button and watch Beanie pour and stir!
The Arduino Code
Copy this code into the Arduino IDE, then click Upload. It waits for the button, then pours both cups and stirs.
// 🤖☕ Beanie the Robot Barista — Arduino Servo Coffee Mixer // Uses 3 servos: two for pouring ingredients, one for stirring #include <Servo.h> Servo cupA; // pours ingredient A Servo cupB; // pours ingredient B Servo stirrer; // stirs the drink const int buttonPin = 2; void setup() { cupA.attach(9); cupB.attach(10); stirrer.attach(11); pinMode(buttonPin, INPUT_PULLUP); // start all servos in their resting position cupA.write(0); cupB.write(0); stirrer.write(90); } void loop() { if (digitalRead(buttonPin) == LOW) { // button pressed pourIngredient(cupA); delay(500); pourIngredient(cupB); delay(500); stirDrink(); delay(1000); } } // Tips a cup forward to pour, then returns it void pourIngredient(Servo &cup) { cup.write(120); // tip forward delay(800); cup.write(0); // back to resting } // Rocks the stirrer back and forth 6 times void stirDrink() { for (int i = 0; i < 6; i++) { stirrer.write(60); delay(300); stirrer.write(120); delay(300); } stirrer.write(90); // return to center }
How Does Beanie Actually Work?
Here are the big robotics ideas hiding inside this project:
Servo Motors
A servo is a motor that can rotate to an exact angle, like 0° or 120°, instead of just spinning forever. That's how Beanie tips cups precisely.
The Arduino "Brain"
The Arduino reads your code line by line and sends tiny electrical signals to tell each servo exactly when and how far to move.
Input & Output
The button is an input (Beanie senses it). The servos are outputs (Beanie acts). Almost every robot uses this input → decide → output pattern.
Functions & Loops
The pourIngredient() function is reused twice so we don't repeat code — and the for loop makes stirring happen automatically, six times in a row.
🧑🔬 Safety First!
- Always build with an adult, especially when using scissors, glue guns, or batteries.
- Use only play ingredients like water, sprinkles, or dry cocoa mix — this is a craft robot, not a food-safe appliance!
- Never let a servo strain against something stuck — unplug power if a motor gets jammed.
- Keep small parts away from little siblings and pets.
Frequently Asked Questions
Do I need to know how to code already?
Nope! You can copy the code exactly as shown. As you get comfortable, try changing the numbers (like the delay times or angles) to see what happens — that's the best way to learn!
Can I add more ingredients?
Yes! Just add another servo (like on pin 12), a new cup, and a new line in the code copying the pourIngredient() pattern.
Why do we use a battery pack instead of the USB cable?
Servos can pull more power than a laptop's USB port likes to give, especially when a few move at once. A battery pack keeps things running smoothly and lets Beanie be portable.
What age group is this project good for?
This project works great for curious kids around age 8 and up, working together with a parent, teacher, or older sibling for the wiring and gluing steps.

Comments
Post a Comment