Hello, and welcome to my latest project! In this showcase I will be displaying the safe with an Arduino Uno! This project includes a 6 digit password (123142), that must be entered if you want to unlock the safe.
Buttons
There are 4 buttons to submit characters(1, 2, 3, or 4), an enter button, and a clear screen/lock button. When the safe is unlocked, it will remain unlocked until the button to lock it is pressed. Above are two pictures - the inside, and the outside. The Arduino reads if the button is being pressed or not, and if they are, it displays the corresponding number, and stores that value. When the enter button is pressed, the code that was typed is submitted, and it will unlock if it is correct. If the clear button is clicked, the values will be reset.
EXPANDED TECHNICAL DETAILS: String Concatenation and Verification
- The user presses a sequence of buttons, for example,
1, 2, 3, 4. - The Arduino uses a command like
enteredCode += keyPress;to stitch those individual characters into a single string. - When the user presses the 'Enter' button, the code checks
if (enteredCode == secretCode). - If correct, the safe unlocks. If wrong, the input can be cleared. More advanced systems might include a red LED flash and a buzzer. After several wrong attempts, the system could lock the user out for a set period using a command like
delay(300000).
The Servo
The locking mechanism is simple - a servo motor is mounted to the shoebox, and a slit is cut in the shoebox and the door flap. When in the locked position, the motor is turned in between the openings, making it not possible to open.
Above is a photo of the servo in the unlocked position. This allows the shoebox to open and close with ease. When it is turned 90° and the door is shut, it isn't possible to open. When the door is unlocked and you click the clear button, the safe returns to being locked.
EXPANDED TECHNICAL DETAILS: Crucial Hardware for a Robust System While this project uses a servo for a simple demonstration, a more secure physical system would require sturdier components:
- Arduino Uno/Nano as the controller.
- 12V Solenoid Cabinet Lock for a strong, electromagnetic lock.
- Relay Module & Heavy-Duty Power Supply to safely control the higher-voltage solenoid with the Arduino.
- A sturdy metal or thick wooden box for the enclosure.
Below is a YouTube demonstration, as well as an Instructable page demonstrating how to build it.
Instructable - http://www.instructables.com/id/Electronic-Safe-With-Arduino