You are on page 1of 4

PAKTURK MAARIF INTERNATIONAL SCHOOLS AND COLLEGES ISLAMABAD

BOYS CAMPUS, ISLAMABAD

IT’S COUNTRY FOR ME (ANSWERS)

Keypad Door Lock with Changeable Code

Control a solenoid/relay or whatever your locking system, and change the passcode by the
keypad only, no program re-upload.

Topics involved:
 door lock
 home automation
 safe lock
 security

Parts required:
 Arduino UNO × 1
 4x4 Keypad Matrix × 1
 Generic push button × 1
 LCD i²c × 1
 Linear solenoid lock × 1
 IRF510N MOSFET × 1
 1 Channel Relay × 1
 Breadboard, 170 Pin x 1
 10 Pc. Jumper Wire Kit, 5 cm Long x 1
 12v. Power Supply x 1

About Project:
I’m making a door lock project based on a Arduino board, keypad, LCD i²c screen, and I’ll use
for the lock a solenoid and a relay, you can check my tutorial about the finger print door lock
where I used a lock that uses a dc motor, so it depends on your lock system you’ll have to
choose a wiring, codes and adapt them.

Algorithm flowchart:
To make things easy to understand here’s the flowchart, it’s not completely detailed but it’s an
overview of the code.

Note: You can use the relay to control any electric lock up to 250VAC, you can use it also to
control the Solenoid.

The codes are exactly the same the only thing is that you switch between (LOW and HIGH) to
open the lock.

Just remember first time you must upload the code and change the passcode then
uncomment some lines (read the code to find them (they’re in setup)) and reupload the code
so it can read the passcode from the EEPROM.IT’S DONE ONLY ONCE.
Also you can change the code length, first I made it four digits, you can change it from the
default code, as I used in the code the "size of (code)" instead of "4". You can't change a 4
digits code to a 6 digits passcode, first change the initial passcode from the code source.

Schematics:

 Mosfet + Solenoid wiring


 Relay wiring

You might also like