This article outlines a DIY project to transform an ordinary cookie box into a "runaway" security device that rolls away from approaching objects and sounds an alarm when lifted. The project combines electronics, specifically Arduino-based circuitry with sensors and a servo motor, with creative crafting using Legos and various decorative materials to build a mobile, character-filled monster box.
Parts used in the Runaway Cookie Box:
- Empty cookie box
- Four wheels
- Legos (axles, gears, basic pieces)
- Hot glue
- Electrical tape
- Popsicle sticks
- Colorful straws
- Googly eyes
- Arduino
- Hacked servo
- Tilt sensor
- Distance sensor
- Speaker
- Resistors (100K and 100 ohm)
- Breadboard
- Wire
- Wire strippers
- Soldering iron
- Solder
Eat too many cookies? These are some guidelines for how you can add a few security features to an ordinary box of cookies – or at least have a fun toy.
The runaway cookie box will roll away when objects approach it and sound an alarm when it is picked up.
What you need for the craft side of things:
-empty cookie box
-wheels (4)
-Legos (axles, gears, basic)
-hot glue
-electrical tape
-popsicle sticks, colorful straws, googly eyes, or whatever you want to give your box some character
Step 1: The Circuitry
During this step, you’ll set up all the circuitry required for the project.
First, connect the Arduino’s 5V power and ground pins to the bus strips of the breadboard.
Second, connect the tilt sensor to the breadboard. Connect the wires on one side to the power strip and the wires on the other side to a 100K& resistor going to ground as well as to digital ins on the Arduino (in this case I used 3 and 4).
Third, connect the three distance sensor wires: red to power, black to ground, and yellow to an analog in on the Arduino (in this case, I used A0).
Fourth, connect one of the speaker’s wires to ground and the other to a 100& resistor connected to a PWM digital in on the Arduino (in this case, I used 5).
Last, connect one of the hacked servo’s wires to ground and the other to another digital in (in this case I used 9).
Step 2: The Box
During this step, you’ll construct your moving cookie box monster that will hold all the circuitry from the last step.
For ease in assembling the project, you can cut a rectangular hole on the bottom of each side.
Hot glue the sides of the breadboard to the space just above this hole.
Hot glue the head of your hacked servo directly to a Lego wheel.
Now construct a Lego chassis for the box with a regular front axle and only one wheel connected in the back. One of the rear wheels is, as you may have noticed, currently attached to your servo. Tape down your Arduino and your servo so that the fourth wheel is oriented in the right direction.
Now you can hot glue your distance sensor to the top back of the box so that your box will spy its enemies coming from behind. You can let the speaker simply rest on top of the breadboard.
Last, attach whatever crafty materials you want! As you can see with my project, I gave it popsicle antenna eyes with a colorful straw mohawk.
-Arduino
-hacked servo
-tilt sensor
-distance sensor
-speaker
-resistors (2x100K&, 1×100&)
-breadboard
-wire
-wire strippers
-soldering iron
-solder [This project was done for Olin College’s Computing & Craft class, taught by Dr. Amon Millner.]
For more detail: How to make a runaway cookie box using Arduino
-
How does the runaway cookie box react when objects approach?
The box will roll away when objects approach it. -
What happens if someone picks up the box?
The box sounds an alarm when it is picked up. -
Which pins on the Arduino are used for the tilt sensor?
The tilt sensor wires connect to digital inputs 3 and 4 on the Arduino. -
Where should the distance sensor be attached on the box?
The distance sensor should be hot glued to the top back of the box. -
How is the speaker connected to the Arduino circuit?
One wire connects to ground and the other connects to a 100 ohm resistor linked to PWM digital input 5. -
What is the wheel configuration for the Lego chassis?
The chassis has a regular front axle with one wheel and only one wheel connected in the back. -
Can you customize the appearance of the cookie box?
Yes, you can attach popsicle sticks, colorful straws, googly eyes, or other crafty materials.

