Build a Robot Barista! Fun Arduino Servo Coffee Mixer project

Build a Robot Barista! Fun Arduino Servo Coffee Mixer Project for Kids
🤖 ROBOTICS FOR KIDS · LEVEL: BEGINNER

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.

⏱️ 2–3 hours 🎂 Ages 8+ (with an adult) 🧰 Beginner friendly

👋 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!

x1

Arduino Uno

The brain that controls everything.

x3

SG90 Micro Servo Motors

Two tip ingredient cups, one stirs.

x1

Breadboard

For connecting wires without soldering.

x1

Push Button

Press it to start the mixing routine.

x1

USB Cable

Connects Arduino to your computer.

x1

4x AA Battery Pack

Powers the servos once it's unplugged.

~10

Jumper Wires

Male-to-male and male-to-female.

x2

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!

Arduino Uno UNO Pin 9 Pin 10 Pin 11 Pin 2 (button) 5V GND Servo 1 — Cup A Servo 2 — Cup B Servo 3 — Stirrer Push Button Start Button
Signal wires → digital pins 9, 10, 11 Button → digital pin 2 Orange dashed = 5V power Brown dashed = Ground (GND)
🛠️

Step-by-Step Build Instructions

Ask an adult to help with the button wiring and battery pack. Ready? Let's build Beanie!

1

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.

2

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!
3

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.

4

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.

5

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!

6

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.

robot_barista.ino
// 🤖☕ 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.

🎉 That's it — you just built a real, working robot! Snap a photo of your barista bot and share what drink it "made" for you.

⬆️ Back to Materials List

Comments

Product Cards
Buddy Bot eBook
⭐ New 2026 Release
Build Your
Own Robot!
3D design, wiring &
Arduino coding.
Young inventors love it!
🖨️
3D Print
All parts
Wire it
Circuit guide
💻
Code it
Arduino IDE
🤖
Watch it
Walk & react
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Website Offer
₹499 300
🌍 International: $5 USD
One-time · Instant digital delivery
🔒 Secured by Razorpay · Your data is safe
📄 Download Free Sample Copy
🔒 Secured by Razorpay · Your data is safe
🍓
Raspberry Pi Pico Mastery
21 Projects
⚡ Launch Price — 80% OFF
Learn Pico
Build 21 Projects!
MicroPython · Wokwi
IoT · Certificate
Perfect for beginners!
🖥️
Wokwi
No hardware
🐍
MicroPy
From zero
🔨
21 Projects
IoT + sensors
📄
Certificate
Verified cert
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Launch Offer
₹999 200 80% OFF
🌍 International: $5 USD
One-time · Lifetime access · No subscription
🔒 Secured by Razorpay · UPI · Cards · NetBanking
🎉

You're in!

Payment successful! Your Buddy Bot eBook is ready. Time to build!

📖 Access Your eBook Now
🎉

Enrolled!

Payment successful! Lifetime access to all 21 Pico Projects is yours!

🍓 Go to My Course