123A456B789C*0#DARDUINOPINS 2–9SERVO · PIN 1090°LEDS4 × 4 MATRIX
FIG. 01Schematic of the system, drawn from the project’s documented parts, pins and code.

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

  1. Code input

    A keypad lets the user type a passcode, and the Arduino reads each key press.

  2. Lock logic

    The Arduino compares the entered code with the stored one and decides whether to unlock.

  3. Physical lock

    On a correct code, the Arduino moves the locking mechanism so the door opens, then relocks it.

03How I built it

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.