
Plagued by lost keys, copied keys, forgotten keys? In just two hours, build a medium-complexity Arduino locker under ₹1200 that opens only with your code.
Locks guard our homes, workplaces, churches, and schools, but keys may get lost, copied, or forgotten. Why not replace the key with a secret code that lives only in your head (and in a program)?
This Arduino UNO-based locker reads a 4×4 matrix keypad, displays instructions and status on a 16×2 LCD with an I²C module, and drives an SG-90 servo motor that acts as the lock. The user types the password, and the LCD shows each digit as an asterisk (*). Upon pressing the submit key (#), the Arduino compares the entry with the preset password stored in the program. If matched, the servo rotates to the unlocking position and the LCD displays ‘Access Granted.’ Else, the servo stays quiet, the locker stays locked, and the LCD displays ‘Wrong Password.’
The entire system runs from a single 5V USB supply and costs just under ₹1200 to build. Fig. 1 shows the author’s prototype, while Fig. 2 presents the block diagram of the project.


Optionally, access can be limited to 2-5 wrong attempts within a set period, after which the system enters a temporary lockout. This is not part of the basic code or flowchart.
| Bill of materials | ||||
| Reference | Component | Value/Type | Quantity | Price (₹) |
| MOD1 | Microcontroller | Arduino UNO | 1 | 500 |
| MOD2 | Matrix keypad | 4×4 | 1 | 100 |
| S1 | Servo motor | SG-90 | 1 | 180 |
| LCD1 | LCD with I²C module | 16×2 | 1 | 200 |
| – | Power supply (USB adaptor) | 5V | 1 | 100 |
| – | Miscellaneous | Connecting wires, breadboard, resistors, capacitors, buttons, connectors | As required | 100 |
| – | Enclosure | Optional (for mounting the lock) | 1 | – |
| Total | 1180 | |||
What will you learn?
- How to program an Arduino UNO using the Arduino IDE and interface different components with it.
- How a 4×4 matrix keypad works and how to use it to take password input.
- How to interface a 16×2 LCD with an I²C module to display instructions and system status.
- How to control the angular position of a servo motor and use it as a locking and unlocking mechanism.
- How to build a password-based authentication system that compares user input with a predefined password using conditional statements.
- How to draw a block diagram and flowchart to represent a simple electronic security system.
How it works
The circuit
The circuit (Fig. 3) is built around an Arduino UNO, a 4×4 keypad, a 16×2 I²C LCD, and an SG-90 servo motor, all sharing a common +5V and GND line. The LCD uses four wires: VCC to the Arduino 5V pin, GND to GND, SDA to A4, and SCL to A5. The servo’s signal (SIG) pin goes to digital pin D10 (PWM), its V+ to 5V, and its ground to the common GND.





