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.
- 1/4″ plywood or 1/8″ acrylic Cut 4 pieces 3″×6″ and 2 pieces 3″×3″, then trim them to fit together. You’ll screw or bolt these into square dowels or plastic angles along the interior edges.
- ¾” square dowels or 1″ plastic angles, 4′ total length
- Screws or bolts, ½” #6 flat-head (60)
- DC motor, 6V–12V, approx. 1″ diameter, 250–1,000 rpm
- Pulley or hub to fit your motor, from a source such as RobotShop, robotshop.com
- Bolt, 5/8″ #2, with 2 washers and 2 nuts secured with LocTite so that they don’t work loose
- Galvanized wire, heavy gauge, 1″ length
- Piezo beeper or buzzer, 6VDC–12VDC If the specification lists an audio frequency, the beeper generates its own sound, which is what you want.
- Loudspeaker, 2″–3″ diameter, 8Ω impedance or higher
- Mercury switches (6) Cheap on eBay and hard to find elsewhere, as they are environmentally incorrect (don’t throw them in the trash!). Or substitute a tilt sensor such as Adafruit #173; it will cost more, and I don’t think it’s quite as reliable, but you have the option.
- Scrap wood and sheet metal, small pieces A steel food can lid will work fine.
- Texas Instruments 555 timer chips (5) The 7555 is not recommended, as its output may be insufficiently robust.
- Relays, DPDT or SPDT, nonlatching (3) coil rated for 4VDC or 4.5VDC, to switch at least 500mA
- Diodes, 1N4001 (6)
- Resistors: 47Ω (1), 10kΩ (5), 68kΩ (1), 100kΩ (1), 150kΩ (1), 330kΩ (2), 680kΩ (1), and 1MΩ (1)
- Capacitors: 0.01µF (1), 1µF (3), 10µF (5), and 100µF (1)
- Battery carrier for 4 alkaline C cells or optional 12V lithium battery pack and 2-amp fast-blowing fuse with holder
- Vibration sensor I used the “slow” variant, Adafruit #1767; the “medium” and “fast” types are easier to trigger.
- Throttle spring from any auto parts store
- Perf board to solder a vibration-resistant version of the circuit
- Hookup wire
SOLVING THE MYSTERY
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.
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.
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.
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.
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.
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.
Because the motor draws significant power when it vibrates, AA batteries were inadequate. I used four C cells in a plastic carrier.
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.
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.
Other sensors on breakout boards are shown below. Each of them cost only $4 when I found them online.
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.