The Blake Laboratory at Tufts University holds a certain magical function: it is also the Room of Requirement for the University! Of course, not just anyone can open the door to the Room of Requirement, unless they have certain privileges. While the door to Blake Lab can be normally opened with the ID card of a Mechanical Engineering student, opening the door to the Room of Requirement is accomplished by speaking the proper password.
Mounted on the door is an acrylic plate, upon which the instructions for entering the room are engraved. The link to the Tufts Marauders Map website is included, from which the password can be obtained. The password is the Unlocking Charm: Alohomora.
To open the door, the button must be pressed, and then the password must be clearly spoken and correctly pronounced. LED lights will indicate when the start button is recognized to be pressed, whether or not the password has been accepted, and if the door has been successfully unlocked. Check the video below to see this happen!
How does this really work? The core processors are two myRIO devices, working in tandem with some additional hardware. The first myRIO is mounted onto the front of the door, behind the acrylic plate, and provides the LED lights. The button that is pressed to activate the door-opening mechanism sends an input signal directly to the myRIO. To the left of the door is a microphone, that runs through the bottom of the door to a computer inside the room, which itself is running the LabVIEW VI programs that the myRIO devices are executing. When the user speaks the password, the microphone picks up the spoken word and the program processes it using the Google Speech Recognition API. This API returns the text that was translated by the API, and checks it for correctness. If the spoken password yields a text match, then a boolean shared variable is switched, and the door opens. The way this is mechanically accomplished can be seen in the video below:
To go into more detail regarding the door opening, as previously stated the voice-recognition API will generate a text string and if the string is a match for the required password, a boolean is switched. The second myRIO is constantly running a program that checks the state of the boolean shared variable. When the correct password is spoken, the program has the myRIO actuate a servomotor through a pulse width modulation command, causing it to turn the necessary angle to pull the door handle down via a string. There is then a five-second delay, wherein the servomotor turns back to its original position. After this, the boolean is switched back to its original state, and the program waits for the next time the correct password is spoken. The mechanism is shown in detail in the photo below:
The servomotor is a Tower Pro High Torque model with metal gears that was purchased specifically for this project. Tests that measured the required torque to open the door handle informed the motor selection. The servomotor was mounted onto an acrylic plate, and the plate was mounted onto the door by using three clamps that fit in the space between the door and the floor. The motor turns an arm which has a string attached, and the string was fixed to the door handle. To facilitate the servomotor’s effort, small weights were added onto the string, decreasing the load on the motor. The myRIO which controls the motor, the MakerBoard which provided an easy servo connection, and a battery pack were all mounted on the door. The myRIO communicated wirelessly with the computer, so the overall system was compact and free of extra wires that could get caught on an object.