Introduction: Secret Knock Box - V 1.0
This project demonstrates a design of a simple circuit and a box that can be unlocked using a specific knock. The circuit consists of an Arduino uno, a microphone, two LEDs, and a servo motor. The box can be made with your own design and creativity, but if you have access to a laser cutting machine, you can use the design uploaded in this instructable to make your box using acrylic. The video shows how the box responds to the secret knock.
Developed in " http://fablabdhahran.org/ " FABLAB Dhahran.
Step 1: Making a Box - 2D Design
First of all, you have to start working on a design of a box, you can use " http://boxmaker.connectionlab.org/ " and insert your required dimensions in it. Make sure that the box has enough space to host the Arduino and the electronics. Minimum dimensions are 130 mm x 90 mm x 90 mm (W x B x H)mm. The attached file " SecretKnockBox - Design.pdf " has the exact dimensions used in our project, if you have access to a laser cutting machine, then you can use this file to cut your box on a piece of acrylic, then assemble it.
You can use a glue gun to stick the faces together, but for best results, it is advised to used Chloroform. Remember not to glue the top of the box, since you will have to use the 3D printed hinges in the next step. Keep in mind that the teeth-less part of the box is kept for the top face, where the opening mechanism will take place.
Step 2: Printing the Hinges - 3D Design
In this step, you are required to use a 3D printer so that you can print the hinges that will allow the mechanical motion of opening and closing the box. If you do not have a 3D printer then you can come up with another design for the box opening mechanism.
The file " Hinges.stl " attached has the design with ready with the appropriate dimension that will suit the box design in the earlier step. Remember that if you have designed your own box, you might have to tweak the dimensions of the hinges to match your box. You can use 8 x M3 threaded screws and nuts, four on each hinge.
Give a print order to the file in standard quality, then assemble the top face of the box to the hinges then to the box.
Step 3: Connecting Electronic Components - Electronics
This part of the project is where you add intelligence to the box, which is response to the knocks. To make this possible, you will need an Arduino UNO, a sound sensor, a servo motor, and two LEDs (Red & Blue). The Arduino UNO is the brain where the code will be stored and sensor data will be processed, and depending on that data, the Arduino takes a decision to either open the box or not, using the servo motor.
The connection of the electronic parts is shown in the picture below. The servo motor and the sound sensor both need 5V and GND for power. ( " + " & " - ") and an extra pin for data. The data pin of the servo is connected to the PWM pin #10, and the data pin of the sound sensor is connected to pin A0 (Analogue IN). The anodes of the red and blue LEDs are connected to pins 4 and 5, respectively.
The sound senor used in the circuit "https://sites.google.com/site/summerfuelrobots/ard..."
Step 4: Arduino Programming - Software
After the hardware is done, we have to give it orders to do what we want. You can upload the code attached to the Arduino UNO using the Arduino IDE software available for download at " http://www.arduino.org/downloads " for free.
The code has comments that explain certain commands and functions. You can modify the code if you want to alter any kind of feature in your project.
Note: If your microphone is not responding, try to change the variable threshold's value "const int threshold = 300;" to any greater value, not exceeding 1000. This will change the level of how much sound will your microphone respond to.