DIY Mini Pizza Vending Machine

DIY Mini Pizza Vending Machine 🍕🤖 Arduino Servo Robotics Project for Kids
🍕 ROBOTICS FOR KIDS · LEVEL: BEGINNER

Build a Coin-Operated Mini Pizza Vending Machine!

Meet Sliceo — a friendly Arduino robot that opens its door, spins its pizza tray, and pops out a slice the moment you drop in a coin. Follow our easy step-by-step guide, circuit diagram, and code to build your own!

⏱️ 3–4 hours 🎂 Ages 9+ (with an adult) 🧰 4 servo motors
¢

🪙 Say hi to Sliceo, your pizza vending robot!

What Is a Pizza Vending Robot, Anyway?

A vending machine is a robot that waits for a signal (like a coin!) and then performs a series of automatic actions. In this project, our Arduino brain will detect a dropped coin, then command four servo motors to open a door, spin a pizza tray to the next slice, push the slice out, and close everything back up.

This project is a fantastic way to learn sequencing — teaching a robot to do several things, one after another, in exactly the right order.

🧰

What You'll Need

Gather these parts before you start building!

x1

Arduino Uno

The brain that runs the whole vending sequence.

x4

SG90 Micro Servo Motors

Door, tray rotation, slice pusher, and a coin gate.

x1

IR Break-Beam Sensor

Detects when a coin drops through the slot.

x1

Breadboard

For connecting everything without soldering.

x1

Small Cardboard Box

The vending machine's body/cabinet.

x1

Round Cardboard Disc

The rotating pizza tray, mounted on Servo 2.

x1

4x AA Battery Pack

Powers the servos once unplugged from USB.

~12

Jumper Wires

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

🔌

The Circuit Diagram

Here's how Sliceo's four servos and coin sensor connect to the Arduino.

Arduino Uno UNO Pin 9 — Door Pin 10 — Tray Pin 11 — Pusher Pin 6 — Coin Gate Pin 2 — IR Sensor 5V GND Servo 1 — Door Servo 2 — Tray Servo 3 — Pusher Servo 4 — Coin Gate IR Break-Beam Coin Sensor
Signal wires → digital pins 9, 10, 11, 6 IR sensor output → digital pin 2 Orange dashed = 5V power Brown dashed = Ground (GND)
🛠️

Step-by-Step Build Instructions

Ask an adult to help with cutting cardboard and wiring the sensor. Let's build Sliceo!

1

Build the cabinet

Cut a small window in the front of your cardboard box for the door, and cut a coin slot near the top that leads down to the IR sensor.

2

Mount the coin gate and sensor

Place Servo 4 just under the coin slot as a tiny gate that only opens once the coin is detected. Mount the IR break-beam sensor right below it, so the coin breaks the beam as it falls.

💡 Tip: Test the sensor alone first — open the Serial Monitor and check it prints "Coin detected!" when a coin passes.
3

Attach the door servo

Mount Servo 1 beside the window opening with a small cardboard flap glued to its horn. When it rotates, the flap should swing open like a real door.

4

Build the rotating pizza tray

Glue the round cardboard disc flat on top of Servo 2's horn, mounted inside the cabinet. Draw slice sections on the disc and place a paper pizza slice in each one.

5

Add the slice pusher

Mount Servo 3 behind the tray with a small arm on its horn. When it swings, the arm should nudge the front slice out through the open door.

6

Wire everything and test

Connect all four servos and the IR sensor as shown in the diagram. Upload the code, switch to battery power, drop in a coin, and watch the whole sequence run!

💻

The Arduino Code

Copy this into the Arduino IDE and click Upload. It waits for a coin, then runs the whole vending sequence automatically.

pizza_vending_machine.ino
// 🍕🤖 Sliceo the Pizza Vending Robot — Arduino Servo Project
// Uses 4 servos: coin gate, door, rotating tray, and slice pusher

#include <Servo.h>

Servo doorServo;     // opens/closes the front door
Servo trayServo;     // rotates the pizza tray
Servo pusherServo;   // pushes the slice out
Servo coinGate;      // lets the coin drop through

const int irSensorPin = 2;   // coin sensor input
int sliceCount = 0;           // tracks which slice is next

void setup() {
  doorServo.attach(9);
  trayServo.attach(10);
  pusherServo.attach(11);
  coinGate.attach(6);

  pinMode(irSensorPin, INPUT);

  // resting positions
  doorServo.write(0);
  pusherServo.write(0);
  coinGate.

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