Build a DIY robotic vegetable chopper

Build Chop-Bot: A DIY Robotic Vegetable Chopper with Arduino | Kids Robotics Project
Robotics project for kids

Build Chop-Bot: a robotic vegetable chopper that chops safely, all by itself

Chop-Bot is a DIY automatic vegetable chopper built with an Arduino. Place a piece of vegetable inside the enclosed chamber, close the safety lid, and press start — a motor-driven blade chops it up, then a servo-controlled tray door opens so the chopped pieces slide out into a bowl.

2–3 hrsbuild time
Beginnerskill level
Adult helprequired for blade + wiring
SAFETY LID TRAY DOOR MOTOR
The big idea

How Chop-Bot thinks, in 4 simple steps

Chop-Bot never chops unless it's safe to. Here's the routine it follows every single time.

1. Place & close lid

You put a vegetable piece inside and close the safety lid, which locks the chamber shut.

2. Press start

The Arduino checks the lid is closed, then arms the motor to begin.

3. Chop (timed)

The motor spins the blade for a fixed, safe time, then stops automatically.

4. Collect

Once the blade has fully stopped, the tray door servo opens so the pieces slide into a bowl.

Shopping list (for your robot!)

What you'll need

Most parts are common in beginner electronics kits. The blade and motor housing should always be assembled by an adult.

PartWhat it doesQty
Arduino UnoThe "brain" that runs the timing and safety logic1
Small DC gear motor + plastic chopping blade adult assemblesChops the vegetable inside the enclosed chamber1
Relay module (or motor driver board)Lets the Arduino safely switch the motor on/off1
Magnetic reed switch (lid sensor) safety partTells the Arduino whether the safety lid is closed1
Push buttonStarts a chopping cycle1
SG90 micro servo motorOpens and closes the bottom tray door1
BuzzerBeeps before chopping starts and when it's done1
Red + green LEDsRed = lid open / not safe, Green = ready to chop2
Clear plastic or acrylic enclosure box see-throughKeeps the chopping chamber fully sealed during use1
Jumper wires + breadboardWiring everything together1 set
9V power supply (for motor) + USB power (for Arduino)Powers the motor and the controller separately1 each
Wiring time

Circuit diagram

The lid's reed switch wires directly into the safety check in the code — the relay is only ever allowed to close when that switch says the lid is shut.

Arduino Uno Digital I/O pins Relay → Motor Signal on D8 Lid Reed Switch Signal on D2 (safety input) Start Button Signal on D3 Tray Door Servo Signal on D9 LEDs + Buzzer D4, D5, D6
Power (5V) Ground (GND) Signal (digital pin)

Never bypass the lid switch

Power the motor from a separate supply through the relay — never straight from the Arduino — and keep the reed switch wired directly into the safety check so the blade physically cannot spin with the lid open.

Let's build!

Step-by-step build instructions

Adults handle every step involving the blade or mains-adjacent wiring; kids can help design, wire the low-voltage sensors, and write the code.

Adult step: mount the motor and blade

Fix the small DC motor inside the base of the clear enclosure box with the plastic chopping blade attached to its shaft, centered inside the chamber.

This step should be fully done by an adult, with the motor unpowered.

Build the hinged safety lid

Attach a hinged lid on top of the chamber. Glue a small magnet to the lid and mount the reed switch on the frame so it lines up when the lid is fully closed.

Add the tray door at the bottom

Cut a small trapdoor at the bottom of the chamber and attach it to the servo arm, so it can swing open to release chopped pieces into a bowl below.

Adult step: wire the relay and motor power

Connect the motor to its own 9V supply through the relay module, and connect the relay's signal pins to the Arduino as shown in the circuit diagram.

Keep the motor's power circuit separate from the Arduino's own power.

Wire the sensors, button, servo, and buzzer

Connect the reed switch, start button, servo, LEDs, and buzzer to the Arduino following the circuit diagram above.

Install the Arduino software

Open the Arduino IDE, install the built-in Servo library if it isn't already available, and connect your Arduino by USB.

Upload the code

Copy the sketch below into the Arduino IDE, select your board and port, and click Upload.

Test with the lid open first — no vegetable, no power to the motor

With an adult present, confirm the red LED lights when the lid is open and the button does nothing. Only after that check passes should you close the lid and try a real test chop.

Never reach into the chamber, even after the motor has stopped.
Now for the fun part

The code that brings Chop-Bot to life

This Arduino sketch puts the safety check first: the motor relay can only turn on when the lid switch confirms the chamber is closed.

chop_bot.ino
// chop_bot.ino — Chop-Bot's brain 🥕🤖
// Safety rule: the motor relay only closes when the lid is shut.
#include <Servo.h>

const int LID_SWITCH_PIN = 2;   // reed switch: LOW = lid closed
const int START_BUTTON_PIN = 3;
const int RED_LED_PIN   = 4;
const int GREEN_LED_PIN = 5;
const int BUZZER_PIN    = 6;
const int MOTOR_RELAY_PIN = 8;
const int TRAY_SERVO_PIN  = 9;

const unsigned long CHOP_TIME_MS = 4000;   // how long the blade spins
const unsigned long TRAY_OPEN_MS = 3000;   // how long the tray stays open

Servo trayDoor;

void setup() {
  pinMode(LID_SWITCH_PIN, INPUT_PULLUP);
  pinMode(START_BUTTON_PIN, INPUT_PULLUP);
  pinMode(RED_LED_PIN, OUTPUT);
  pinMode(GREEN_LED_PIN, OUTPUT);
  pinMode(BUZZER_PIN, OUTPUT);
  pinMode(MOTOR_RELAY_PIN, OUTPUT);

  digitalWrite(MOTOR_RELAY_PIN, LOW);  // motor OFF by default — always start safe
  trayDoor.attach(TRAY_SERVO_PIN);
  trayDoor.write(0);                  // tray door closed

  Serial.begin(9600);
  Serial.println("Chop-Bot ready. Close the lid to arm the motor.");
}

bool isLidClosed() {
  return digitalRead(LID_SWITCH_PIN) == LOW;
}

void updateStatusLight() {
  bool safe = isLidClosed();
  digitalWrite(GREEN_LED_PIN, safe ? HIGH : LOW);
  digitalWrite(RED_LED_PIN, safe ? LOW : HIGH);
}

void runChopCycle() {
  // Double-check safety right before spinning the blade.
  if (!isLidClosed()) {
    Serial.println("Lid not closed — chop cancelled.");
    return;
  }

  Serial.println("Chopping...");
  tone(BUZZER_PIN, 1000, 200);
  delay(300);

  unsigned long start = millis();
  digitalWrite(MOTOR_RELAY_PIN, HIGH);   // motor ON

  while (millis() - start < CHOP_TIME_MS) {
    // Safety override: if the lid is somehow opened mid-chop, stop instantly.
    if (!isLidClosed()) {
      break;
    }
  }

  digitalWrite(MOTOR_RELAY_PIN, LOW);    // motor OFF
  delay(500);                          // let the blade fully stop spinning

  Serial.println("Chop complete. Opening tray...");
  tone(BUZZER_PIN, 1500, 300);
  trayDoor.write(90);                   // open tray door
  delay(TRAY_OPEN_MS);
  trayDoor.write(0);                    // close tray door

  Serial.println("Ready for the next piece!");
}

void loop() {
  updateStatusLight();

  bool buttonPressed = digitalRead(START_BUTTON_PIN) == LOW;
  if (buttonPressed && isLidClosed()) {
    runChopCycle();
  }

  delay(50);
}

Level-up idea

Add an ultrasonic sensor to automatically detect when a vegetable piece is placed in the chamber, so the green "ready" light only turns on when both the lid is closed and something is inside.

Almost there

Test it safely, step by step

Always test with an adult present. Work through this checklist in order — don't skip ahead to a real chop.

  • With the lid open and no vegetable inside, confirm the red LED is on and the button does nothing.
  • Close the empty lid and confirm the green LED turns on and the buzzer beeps when you press start.
  • Watch a full empty test cycle: motor runs for 4 seconds, stops, then the tray door opens and closes.
  • Only after an empty cycle works perfectly, add a small, soft vegetable piece (like a cooked potato chunk) for a real test, supervised by an adult.
  • Confirm opening the lid mid-cycle immediately stops the motor, every single time.
Questions?

Frequently asked questions

Is it safe for kids to build this project?

Kids can design the enclosure, wire the low-voltage sensors, and write the code — but mounting the blade, wiring the motor's power circuit, and every powered test run should be done by an adult. Treat the blade and motor exactly like a kitchen appliance.

Why use a relay instead of powering the motor straight from the Arduino?

An Arduino pin can't safely supply enough current for a motor, and separating the motor's power supply through a relay keeps the higher-current circuit isolated from the Arduino's sensitive electronics.

What if the lid switch fails?

That's exactly why the code checks the lid switch twice — once before starting and continuously during the chop — and why the enclosure should never be modified to bypass the switch. If the switch seems unreliable, stop using the chopper and have an adult inspect it before any further testing.

Can I use a metal kitchen blade instead of a plastic one?

For a school or home robotics project, a small plastic or blunt-edged chopping blade is much safer to build and test with. A sharp metal blade adds real injury risk and isn't necessary to learn the robotics concepts here.

Can this replace a real kitchen chopper?

No — this is an educational robotics project built for learning, not a replacement for a properly certified kitchen appliance. Use it for demonstrations and small test pieces under supervision, not for everyday food prep.

Chop-Bot 🥕🤖

A beginner-friendly Arduino robotics project that teaches kids how sensors, safety interlocks, and motors work together — built safety-first from the ground up.

Keep exploring

Try adding an ultrasonic sensor for auto-detection, a second blade speed setting, or an LCD screen that counts how many pieces have been chopped!

Comments