Home Creators Posts Import Register Favorites Logout

Content

Here's a new tutorial for an electronic puzzle suitable for an escape room, using an Arduino and a MIDI keyboard. Players must press the correct sequence of notes to match a certain melody stored on the Arduino. For each correct note they play, an LED is illuminated on a Neopixel strip. When the whole melody has been played and all the LEDs have been lit, a maglock is released. If players press a wrong note, the LEDs flash red and the player must start again from the beginning.

A nice way to theme this puzzle would be to select a suitable replacement sound effect for each note played - you could send the MIDI output to a synthesiser module or sampler to create the sound of a church organ, an 80s synthesiser, or just play arbitrary WAV/MP3 sound effects, for example. If you want to make the player have to spell a word rather than play a song, here's a list of some interesting words that can be spelled using only the letters of the musical notes from A-G!:

Badge, Cabbage, Cage, Decade, Dead, Face, Edge, Facade, Deaf, Baggage...

 Timings: 

00:00 - 02:24 Introduction and Demonstration

02:25 - 08:14 Component Explanation

08:25 - 14:23 Wiring

14:24 - 41:44 Arduino Code

41:45 - 43:40 Wrap-up

For wiring diagram, list of components used, and to download the Arduino code please see https://www.patreon.com/posts/21024440

Please let me know if you have any questions, comments, or suggestions below!

Files

Play It (Once), Sam! Arduino MIDI ER Puzzle

This video tutorial explains how to create an electronic puzzle in which players must play a specific melody on a MIDI keyboard in order to unlock an electric maglock, as might be used in an escape room. Timings: 00:00 - 02:24 Introduction and Demonstration 02:25 - 08:14 Component Explanation 08:15 - 14:23 Wiring 14:24 - 41:44 Arduino Code 41:45 - 43:40 Wrap-up For wiring diagram, list of components used, and to download the Arduino code please see https://www.patreon.com/posts/21024440

Comments

Russell Hardman

I couldn’t get a midi shield so I used a tutorial at ‘notes and volts’ to make one. I added in the buzzer and Alastair’s code and plugged in the wii controller and sound! So happy, thanks Alastair.

Javier Palomares

Hi there, it's possible to use any midi keyboard?

Ken

Hi Alastair, would this also be possible with a keyboard that send its midi signal over USB? Can I just hook it up to the USB port of the Arduino, and power the Arduino with the adapter input? How does that impact the code, if at all?

manwai che

I've got it connected but the mag lock is not locked, it's super weak, tried flipping between high or low but still don't work, but I got some error codes, would you mind taking a look and let me know your thoughts?

manwai che

PlayItOnceSam:82:24: error: 'handleNoteOn' was not declared in this scope MIDI.setHandleNoteOn(handleNoteOn); error: 'handleNoteOff' was not declared in this scope MIDI.setHandleNoteOff(handleNoteOff);119:17: error: 'onSolve' was not declared in this scope onSolve();138:13: error: 'onReset' was not declared in this scopeexit status 1 'handleNoteOn' was not declared in this scope onReset();

thomas rose

Alastair, My project is complete and working awesome thank you! My led strip has 50 lights. I'm having a difficult time programming more than one light per note being pushed. Could you help out? I want to light 5 per note. Also, I used a normal keyboard and I can make the sound come out of the piano as if I'm playing it. My favorite puzzle so far because I had to learn piano as well as coding

Lori Alden

Fantastic puzzle. Note that the wiring diagram has a slight error: the white wire should go to the A- and the green wire to the A+. Also, for some reason, the puzzle wouldn't work with an Arduino Nano. When I swapped in an Arduino Uno, though, it worked like a charm.