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!
🧂 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!
Arduino Uno
The brain that controls all four spice-dispensing servos.
SG90 Micro Servo Motors
One per spice box, tilting it to dispense.
Push Buttons
One button per spice — press to dispense that spice.
Small Spice Jars or Boxes
With a small pour-hole cut or drilled in the lid.
Small Buzzer (optional)
Beeps to confirm a dispense.
Wooden or Cardboard Rack
Mounts the four servo-and-jar assemblies in a row.
Breadboard
For connecting everything without soldering.
4x AA Battery Pack
Powers all four servos once unplugged from USB.
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.
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!
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.
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!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.
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!
Add the buzzer
Mount the buzzer somewhere central — it will beep once each time a spice is successfully dispensed.
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.
// 🌶️🤖 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 arrays — spiceServos[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.

Comments
Post a Comment