Piano puzzle

This is a simple digital piano, which will open a hidden compartment when the correct music is played.

It has 8 keys on the front that control 8 digital switches. When the correct sequence is entered, a spring-loaded door on the back pops up.

The keys are shaped like bones to fit the overall pirate theme of the puzzles. They can be glued in place or removable. In this case the keys were not glued, and part of the puzzle was to figure out how to insert one of them in the box before playing the music.

The 8 switches are attached to the base with pieces of toothpicks and are connected to the main board via a ribbon cable.

The main board is an Arduino Mega. It is powered externally via USB. It uses a relay to control an electromagnet, connected to a 9V battery. A separate battery is used because the magnet is too large load for the Arduino outputs.

Make it

Here are the essential parts you will need for the device
* Arduino Mega: https://www.amazon.com/gp/product/B01H4ZDYCE
Possibly a simple Arduino Uno can be used. You need one input for each key, one output for the buzzer, and one output for the relay

* Microswitches: https://www.amazon.com/gp/product/B073TYWX86

* Passive buzzer: https://www.amazon.com/gp/product/B01NCOXB2Q

* 5V relay: https://www.amazon.com/gp/product/B00O9WPAJ6

* Electromagnet: https://www.amazon.com/gp/product/B013DR655A
I used one rated at 4.5V, and I connect it with a 9V battery to increase the power. It is turned on for only 100ms, which appears to be safe

Additional materials:

* Dupont connectors, ribbon cables and crimping tool for them
* M3 screws and plastic standoffs for mounting the Arduino board
* M2 screws for the electromagnet
* Power connector for the 9V battery
* A small spring
* A 3.3mm dowel for the door axis

Download source code and SVG designs: piano_puzzle.zip

Notes

  • The programmed melody is the “Yo-ho-ho” song, but you can change it to anything you want. After the first 17 notes are played by the user, the rest of the melody plays on its own and unlocks the door.
  • The design assumes 3mm plywood. When cutting, make sure the keys are cut in the direction of the plywood sheet that bends (the plywood is much more rigid in the other direction).
  • The SVG file has areas with different colors, which are intended to be etched with different laser power levels to create angled surfaces.
  • The object you want to put in the hidden compartment may get tangled with the spring and jam the door. I had to create 2 small paper pouches to keep the loot away from the latch.
  • Even though the relay isolates the electromagnet from the main circuit, there is still some interference, which causes the Arduino to reset when the door is unlocked. I don’t know what exactly is causing it, or how to fix it. Possibly some extra filter electronics need to be added – a diode or something.

Leave a Reply