3D Locker
A real-life locker built with an Arduino and a keypad that opens only when the correct code is entered.
01Problem and solution
Problem
A small space such as a school locker or storage box needs to stay secure, opening only for someone who knows the code.
Solution
A physical locker with a keypad. An Arduino reads the code, checks it against the stored one and drives the locking mechanism.
02How it works
Code input
A keypad lets the user type a passcode, and the Arduino reads each key press.
Lock logic
The Arduino compares the entered code with the stored one and decides whether to unlock.
Physical lock
On a correct code, the Arduino moves the locking mechanism so the door opens, then relocks it.
03How I built it
Read the keypad
Wired the 4×4 keypad to Arduino pins 2 to 9 and started from the Keypad library’s example sketch, printing each key press to the serial monitor.
First code check
Gave keys number values and added them up as they were pressed. A green or red LED flashed to show whether the code was right.
Make the order matter
Adding values meant the right keys worked in either order, so the second version stores the exact keys pressed and compares them with the passcode.
Fix a pin clash
The first version had an LED on pin 2, which the keypad also used. I moved the LEDs to pins 11 and 13.
Add the lock
Added a servo on pin 10 that turns 90° to unlock, waits two seconds, then turns back to relock. A wrong code lights the other LED and resets the input.
Build the locker
Wired and mounted the keypad, Arduino and servo into a working physical locker.
04Engineering areas
Embedded systems
Arduino C++ scans the keypad, checks the code, and drives the lock.
Hardware build
The keypad, Arduino, and locking mechanism are wired and mounted into a working physical locker.
05Outcome
- A working automated security system: a physical locker that opens only with the correct code.
06Real-world use
Everyday use
Shows how a low-cost microcontroller and a keypad can secure a small space such as a school locker or storage box.