The Mystery Box sits on the table, doing nothing. The fun begins when someone picks it up, turns it over, or shakes it. The box screams in protest and starts vibrating as if something inside it is trying to get out. Put it down and leave it alone, and the box returns to its original inscrutable state — until someone else tries to mess with it.


Evidently the box detects motion. You can use an accelerometer for this purpose, but I chose something older, cheaper, and simpler: a mercury switch. This consists of a blob of mercury in a glass capsul. When the capsule is tilted, the mercury rolls down and makes a connection between two interior contacts. If you glue the capsule to the inside of the Mystery Box, you have a simple tilt sensor.

A blob of liquid mercury makes a connection between two contacts (left) or leaves them exposed (right) depending on the angle of the glass capsule.

The figure below shows how the switch can trigger some action for a fixed interval. The switch applies power to a relay, and the relay powers a 555 timer while also running a motor that creates vibration. The trigger pin of the timer is connected to a resistor-capacitor combination (an RC network) that provides a brief low pulse when power is switched on. (To learn more about timers and RC networks, you might like to read my book Make: Electronics.)

The output from the 555 connects back to the relay coil, so that the timer keeps the relay contacts closed even when the mercury switch reverts to its “off” status. At the end of the cycle, the timer stops powering the relay, the relay switches off the timer, and the circuit goes back to consuming no power at all. You can leave the box lying around for days or months without it running down its batteries.

The two diodes in the schematic prevent the 6VDC input from fighting with the output of the timer, which has a lower voltage. The diodes themselves impose a voltage drop, so I suggest using a 4.5VDC or 4VDC relay.


The box will start making noise every time someone picks it up and turns it 90° or more along any horizontal axis. I wanted it to behave less predictably, so I combined three mercury switches by gluing them into the faces of a 1″ cube. Then I wired them in series so that all of them must close to start the timer.

Three mercury switches, wired in series, embedded in a 1″ cube at 90° angles to each other.

This still seemed a bit too predictable, so I decided that the circuit should pause for a couple of seconds before making noise, and should then become unresponsive for a couple more seconds at the end of its cycle. Here is how three timers and relays can achieve this.

Below is the actual schematic. The extra diodes across the relay coils and the motor are to prevent back-EMF that may disturb the timers. I also added a 10µF capacitor between the power supply of the first timer and ground, to protect it from voltage spikes caused by the switches.

To make the Mystery Box shake or jump, I used a DC motor that vibrates because it has a nylon pulley with a bolt inserted off-center. Then I added a pivoting length of heavy-gauge galvanized wire that bangs into a piece of stainless steel to create a hammering sound.

The DC motor is clamped between two ¾” square dowels.

I also wanted the box to protest if someone simply jolts it, so I added a vibration sensor and a beeper. The sensor looks like a small capacitor, but if you slice it open, you find a pin in the center of a coil of wire.

A vibration sensor (left) is cut open (right) to show the tiny rod and spring inside.

When the coil vibrates, it touches the pin. To increase its sensitivity I mounted it inside a throttle return spring that I found in an auto parts store. I stretched the spring so that it would flex more freely.

If a vibration sensor is inserted in a throttle return spring, suitably stretched, it will become more sensitive.

The output of a vibration sensor is very brief, so it triggers another timer which sends a 1-second pulse to a beeper. See the additional schematic for this module.

By driving it from point A in the main schematic, I bypassed the pause so that the box will protest if it is jolted whenever the electronics are active.

Lastly I wanted the box to play some random musical notes if it is tilted by varying amounts, so I added one more timer, running asynchronously at an audio frequency determined by three more mercury switches. The schematic for this module is below. It is powered from point B in the main schematic, so that it will start out of sync with the motor.

Circuit module to create a variety of audio tones using three mercury switches.

Because the motor draws significant power when it vibrates, AA batteries were inadequate. I used four C cells in a plastic carrier.

Battery carrier with four C cells.

Here is the box under construction. I used screws and bolts to hold it together, because glue tends to come unglued if an object is likely to be banged or shaken vigorously.

Mystery Box under construction. Each wooden cube has its lowest corner sanded flat, so it can be screwed to the base of the box.

If you’re willing to take more time, a wooden box with an antique look might increase the air of mystery, like something out of an Edgar Allan Poe story. I leave that to you.


Sensors are cheap, especially from hobby sources such as Electronic Goldmine, All Electronics, SparkFun, or Adafruit. To make the box respond in additional ways you could add an electret microphone, a phototransistor, or perhaps a rotational encoder that is moved by a sinker weight of the type sold for fishing.

A fishing sinker weight will turn a rotational encoder if the encoder is shaken or inverted.

Other sensors on breakout boards are shown below. Each of them cost only $4 when I found them online.

Low-cost sensor breakout boards — tilt sensor (left), bump sensor (center), and touch sensor (right).

If you’re willing to spend an extra $20 you can substitute a 12V lithium battery pack for the C cells. This can be recharged through an external socket, so that the box never has to be opened. The extra power will allow you to use a bigger motor to make your mystery box really jump — along with anyone who ventures to touch it. You’ll need to substitute 12VDC relays, but the other components can remain unchanged. Since lithium batteries can start a fire if they’re overloaded, please include a 2-amp fast-blowing fuse.