What's New:

Thursday 18 May 2017

Arduino-Based Door Lock System


Authors: Adetunji Yinka Clement, Anumbor Ogor

Introduction 

The rate at which theft is growing nowadays is highly alarming. As theft is increasing, security is becoming a major concern, hence the need for embedded security systems such as the presentation in this article. 

In this project, a door lock system with a 4x4 keypad, dc motor and Arduino uno is presented. From the keypad, a password is typed and the door will be opened only if the password is correct. Two indicator  LEDs; a red led and a green led is interfaced with the Arduino, the green LED comes ON if the password is correctly entered and red led is turned ON if wrong password is entered.

Here is a video demonstration of the project:


Components Required for the Project

Arduino uno
4x4 keypad matrix
DC motor
Npn transistor
A hacked CD ROM Drive
Green LED
Red LED
330Ω resistor x2


Door Lock System Decomposition

Arduino uno: This serves as the micro-controller controlling other components. It is interfaced with the other components and an Arduino C++ code is written an uploaded on it to control and drive other components.

4x4 keypad matrix: It is interfaced with the Arduino and allows us to enter password to unlock our door. Such keypad can be seen in basic calculators, mobile phones, etc.

DC motor: Receives signal from the Arduino and once correct password is entered the slot of the CD ROM drive opens.

Green LED: Animated green led which comes ON when password is entered correctly.

 
Red LED: Animated red led which comes ON if password is wrongly entered.


Schematic 
Full schematic




Circuit Connection and Operation

Firstly, the 4x4 keypad is connected to the Arduino uno. The keypad has four row pins and four column pins. The column pins 1,2,3,4 is connected to pins 6,5,4,3,2 respectively on the Arduino, and the row pins A, B, C, D is connected to pins 9,8,7,6 respectively on the Arduino.
 
Next, the base of an NPN transistor is connected to a 1k resistor and connected to pin 11 on the Arduino. The emitter of the transistor is to one terminal of the dc motor and the other terminal to the ground. The Connector of the transistor is then connected to a voltage source. 

Lastly, the anode terminal of the red LED is connected to a 330ohms resistor and connected to pin 12 on the Arduino, also the anode terminal of the green LED is connected to a 330ohms resistor and connected to the pin 13 on the Arduino. The cathode terminals of the two LEDs are connected together and connected to ground.

Whenever the password is entered correctly the green LED turned ON indicating that the door is opened. If wrong password is entered, the red LED is ON indicating that the door is still locked.


Program Flow



Door Lock Program Flow

The whole project was first simulated on the ISIS Proteus circuit simulator which was done in non-real-time digital simulation. The written Arduino C++ code was compiled successfully on the Arduino IDE software and then uploaded to the Arduino UNO board.

When the circuit starts, the red LED comes ON indicating that the door is locked as the motor reading is still at 0.00.



Red LED on: Door is locked


Since the password has been set to 123, the situation remains the same until the correct password is entered. Once the correct password is entered, the red LED goes OFF, the motor now rolls indicating the door has now been opened and the green LED comes ON indicating that the password is correct and the door is opened.


Green LED on; Door opens


Conclusion

The door lock system was simulated on ISIS Proteus IDE and implemented on a bread board. A hacked CD ROM drive was used in place of a door and simulation was done non-real time. The system is applicable in real life if implemented with a real door 

The project was limited as it could only be implemented with a hacked laptop cd rom and not on real door due to insufficient resources. Also a dc gearhead motor was used instead of a servo motor because servo motors are very expensive. 

Future improvements will use an actual door with bigger gearhead DC motors and will handle the different complexities that may arise as a result.


Download Source Code


Please do well to leave your comments or questions  below, share with friends, like, etc.  and we will really appreciate.

You can also connect with us on the following platforms:

facebook.com/herculestechnology
twitter.com/herculestechs 
Youtube: search for "Hercules Technology NG"



5 comments:

  1. I really appreciate the work you have done, you have explained everything in such an amazing and simple way.
    click for info

    ReplyDelete
  2. 12. Really it was an awesome article very interesting to read. You have provided an nice article.
    Thanks for sharing

    Try this

    ReplyDelete
  3. Congratulation .i am so glad this channel is growing so well ,great to see a channel get the recognition they deserve .can’t wait to see where this channel goes from here
    click here

    ReplyDelete
  4. I have read your blog it’s very attractive and impressive. I like it your blog.
    Click for this

    ReplyDelete