"Knock, knock!" - Escape Room Puzzle (Patreon)
Content
This is a video tutorial requested by one of my lovely Patrons, which explains how to create a "knock, knock" ER puzzle, in which players need to tap out a particular rhythm (such as a secret doorknock) to activate a relay and unlock a maglock.
I've demonstrated two different variations of the puzzle - one uses a Piezo sensor (activated by vibration) as an input, and this would work well for knocks on a solid surface such as a door, wall, or table. The second version uses a microphone input instead, which can be used to detect *any* percussive noise. That gives more flexibliity as to how players can solve the puzzle, but you'll also need to exercise some caution to make sure that it doesn't get set off accidentally by other sounds banging around!
In both cases, the input knock pattern is normalised before comparison, which means that the correct input will always be accepted whatever tempo it is entered at. I've included some automatic calibration code which will adjust for the ambient noise level in the room, an input sensitivity adjustment, and also a variable error threshold that allows you to change the tolerance of incorrect timing.
I've tried to document the wiring diagram and code as thoroughly as I can, but please do ask if you have any questions! Links to download all the associated resources will be put up for $10 patrons shortly.