DIY Smart Spice Wall Arduino Servo

DIY Smart Spice Wall 🌶️🤖 Arduino Servo Spice Dispenser Project for Kids
🌶️ ROBOTICS FOR KIDS · LEVEL: BEGINNER

Build a Smart Spice Wall That Serves Up the Right Spice!

Meet Rackster — a wall-mounted Arduino rack that holds four spice boxes on servo motors. Press a button for the spice you need, and Rackster tilts that exact box to sprinkle out the perfect pinch!

⏱️ 2–3 hours 🎂 Ages 8+ (with an adult) 🧂 4 servo-powered spice boxes

🧂 Say hi to Rackster, your smart spice wall!

What Is a Smart Spice Wall, Anyway?

Ever fumbled through the spice cabinet mid-recipe, mixing up cumin and cinnamon? A smart spice wall solves that! Each spice box sits on its own servo motor. When you press the button for the spice you want, that one box tilts forward just enough to sprinkle out a pinch, then tips back to level — no spills, no mix-ups.

This project is a great way to learn how a microcontroller can control several independent motors, each responding only to its own button.

🧰

What You'll Need

Gather these parts before you start building your spice wall!

x1

Arduino Uno

The brain that controls all four spice-dispensing servos.

x4

SG90 Micro Servo Motors

One per spice box, tilting it to dispense.

x4

Push Buttons

One button per spice — press to dispense that spice.

x4

Small Spice Jars or Boxes

With a small pour-hole cut or drilled in the lid.

x1

Small Buzzer (optional)

Beeps to confirm a dispense.

x1

Wooden or Cardboard Rack

Mounts the four servo-and-jar assemblies in a row.

x1

Breadboard

For connecting everything without soldering.

x1

4x AA Battery Pack

Powers all four servos once unplugged from USB.

~16

Jumper Wires

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

🔌

The Circuit Diagram

Each button connects to its own servo through the Arduino — four matching pairs in total.

Arduino Uno UNO Pin 9 — Servo 1 (Spice A) Pin 10 — Servo 2 (Spice B) Pin 11 — Servo 3 (Spice C) Pin 6 — Servo 4 (Spice D) Pin 2 — Button 1 Pin 3 — Button 2 Pin 4 — Button 3 Pin 5 — Button 4 Pin 8 — Buzzer 5V GND Servo 1 — Spice A Servo 2 — Spice B Servo 3 — Spice C Servo 4 — Spice D 4x Push Buttons Buzzer
Servos → pins 9, 10, 11, 6 Buttons → pins 2, 3, 4, 5 Buzzer → pin 8 Orange dashed = 5V · Green dashed = GND
🛠️

Step-by-Step Build Instructions

Ask an adult to help cut pour-holes in the jar lids and mount the rack to the wall. Let's build Rackster!

1

Prepare the spice jars

Cut or drill a small pour-hole in the lid of each spice jar — just big enough for a light sprinkle to escape when tilted, not a full pour.

2

Mount each jar on a servo

Attach each jar to a servo horn using a small bracket or strong tape, so the servo can tilt the jar forward and back.

💡 Tip: Test the tilt angle with rice first — find the angle that gives a light sprinkle, not a dump!
3

Build the wall rack

Mount all four servo-and-jar assemblies in a row on your wooden or cardboard rack, spaced so each jar can tilt freely without bumping its neighbor.

4

Add the four buttons

Mount one push button below each jar so it's clear which button dispenses which spice. Label them if you like!

5

Add the buzzer

Mount the buzzer somewhere central — it will beep once each time a spice is successfully dispensed.

6

Wire everything and test

Connect all four servos and buttons exactly as shown in the circuit diagram, upload the code, switch to battery power, and press a button to watch that spice sprinkle out!

💻

The Arduino Code

Copy this code into the Arduino IDE, then click Upload. Each button independently controls its own spice-tilting servo.

smart_spice_wall.ino
// 🌶️🤖 Rackster the Smart Spice Wall — Arduino Multi-Servo Dispenser Project
// Each button tilts its own spice jar's servo to dispense a pinch

#include <Servo.h>

Servo spiceServos[4];
const int servoPins[4] = {9, 10, 11, 6};
const int buttonPins[4] = {2, 3, 4, 5};

const int restAngle     = 0;    // jar sitting level
const int dispenseAngle = 60;   // jar tilted to sprinkle
const int buzzerPin = 8;

void setup() {
  for (int i = 0; i < 4; i++) {
    spiceServos[i].attach(servoPins[i]);
    spiceServos[i].write(restAngle);
    pinMode(buttonPins[i], INPUT_PULLUP);
  }
  pinMode(buzzerPin, OUTPUT);
}

void loop() {
  for (int i = 0; i < 4; i++) {
    if (digitalRead(buttonPins[i]) == LOW) {  // this button was pressed
      dispenseSpice(i);
      delay(400);  // small pause to avoid double-triggering
    }
  }
}

// Tilts one spice jar forward, sprinkles, then returns it level
void dispenseSpice(int index) {
  spiceServos[index].write(dispenseAngle);
  delay(500);                       // hold tilted for a light sprinkle
  spiceServos[index].write(restAngle);
  tone(buzzerPin, 1400, 150);       // confirmation beep
}
🧠

How Does Rackster Actually Work?

Here are the big robotics ideas hiding inside this project:

📚

Arrays Keep Things Organized

Instead of writing separate code for each servo and button, we store them in arraysspiceServos[4] and buttonPins[4] — so one small loop can manage all four independently.

🔁

Scanning in a Loop

The loop() function checks all four buttons every single cycle, super fast, so it feels instant no matter which button you press.

🎯

One Function, Many Uses

Rather than writing four nearly-identical dispensing functions, dispenseSpice(index) takes a number and controls the matching servo — clean, reusable code.

⚖️

Tuning for the Right Amount

The dispenseAngle and hold time control exactly how much spice comes out — small changes here let you fine-tune a light sprinkle versus a bigger pour.

🧑‍🔬 Safety First!

  • Build with an adult, especially when cutting or drilling the jar lids.
  • Keep this project as a demo with dry spices like rice, salt, or cinnamon — always ask an adult before using it with food you plan to eat.
  • Wash hands and clean the dispensing area before and after handling real spices.
  • Keep small parts like servo horns and screws away from little siblings and pets.
  • Unplug the battery pack when you're finished using Rackster.

Frequently Asked Questions

Can I add more than four spices?

Yes! Just extend the servoPins and buttonPins arrays with more pin numbers and change the 4 in the loops to match how many spices you're adding (Arduino Uno supports several more digital pins).

How do I stop it from dispensing too much?

Lower the dispenseAngle value or shorten the delay(500) hold time inside dispenseSpice() — smaller angles and shorter holds mean a lighter sprinkle.

What if two buttons are pressed at the same time?

Since the code checks each button one at a time inside the loop, both will still dispense — just one very slightly after the other, so fast it's barely noticeable.

What age group is this project good for?

This project is great for curious kids around age 8 and up, working with a parent, teacher, or older sibling on the jar prep and wiring.

🎉 Delicious work — you just built a real automated spice dispenser! Press a button and watch Rackster serve up the perfect pinch.

⬆️ 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