Introduction: Arduino Password Unlock Door Security System

Picture of Arduino Password Unlock Door Security System

Hello! In this Instructables guide I will show you how to make your own password unlock door system by using the Arduino uno board. I made my own circuit by using the ATmega328 micro controller but this is an optional step. In this guide I will help you to make it easily on breadboard by using the Arduino uno board, and I will give you some extra tips on how you can make your own Arduino-based custom circuit.

By using this system you will be able to unlock a door for 5 seconds. After 5 seconds the electrical door opener will be automatically be locked. You can unlock it by typing the correct password and pressing the '*' button. If you want to change the current password, you can do it by pressing the 'A' button and if you want to skip or abord an operation you can do it by pressing the '#' button. It also has a buzzer for making various tones during operation.

Watch the operation video:

The electrical door opener that I used need 9 to 12V to operate. So for this system I used an 12V power adapter. As current passes through it, the electric lock remains open. Otherwise it remains closed.

This device was made only for educational and presentational purpose reasons, it can't be used in real life. If you want to use it on your home's door make sure that it's enough safe , for example use a metal box and put the power cables "inside the wall".

Let's get started!

Step 1: What You Will Need

Picture of What You Will Need

For this project you will need:

  • Arduino uno board
  • High contrast LCD display 16x2
  • Keypad 4x4
  • 10~20k potentiometer
  • NPN transistor NP2222A
  • 2 pins screw driver circuit
  • Electric door opener (12V)
  • Power source 9 to 12V (max!)

(ONLY) If you want to make your own custom - Arduino based - circuit you willalso need:

  • DIP socket for atmega328
  • LM7805 Voltage regulator (5V output)
  • 16Mhz crystal osc
  • 2x 22pF ceramic, 2x 0.22uF electrolytic capacitors
  • 1x 10K resistor
  • DC power jack
  • pcb prototyping board

And one box to fit them all!

Tools:

  • Something to cur the plastic box
  • Hot glue gun
  • Drill for opening holes on the box

Step 2: The Circuit

Picture of The Circuit

The connections are pretty easy, watch the above image with the breadboard circuit schematic.

Some notes:

High contrast LCD:

  • Pin1 - Vdd to GND
  • Pin2 - Vss to 5V
  • Pin3 - Vo (to middle pin of the potentiometer!)
  • Pin4 - RS to Arduino pin 8
  • Pin5 - RW to GND
  • Pin6 - EN to Arduino pin 7
  • Pin11 - D4 to Arduino pin 6
  • Pin12 - D5 to Arduino pin 5
  • Pin13 - D6 to Arduino pin 4
  • Pin14 - D7 to Arduino pin 3
  • Pin15 - Vee (to right or left pin of the potentiometer)

Keypad 4x4:

From left to the right pin:

  • Pin1 to Arduino pin A5
  • Pin2 to Arduino pin A4
  • Pin3 to Arduino pin A3
  • Pin4 to Arduino pin A2
  • Pin5 to Arduino pin 13
  • Pin6 to Arduino pin 12
  • Pin7 to Arduino pin 11
  • Pin8 to Arduino pin 10

NPN Transistor:

  • B Base pin to Arduino pin 9
  • C Collector pin to 1st pin of the screw driver terminal *
  • E Emitter to GND

The 2nd pin of the screw driver terminal will be connected with Arduino "Vin" pin and will give power to our electrical door opener (9V to 12V) .

Step 3: The Code

Picture of The Code

Here's the code, embedded using Codebender!

Try downloading the codebender plugin and clicking on the Run on Arduino button to program your Arduino with this sketch. And that's it, you've programmed your Arduino board! If you want to make any changes in the code below just click the "Edit" button.

Tip: If you want to change the time that door remain unlocked change the delay(time) at line 105.

Step 4: Make Your Own Custom Arduino - Based Circuit

Picture of Make Your Own Custom Arduino - Based Circuit

Now that you have successfully test your new project with the Arduino uno board, you can start making your own Arduino-based custom circuit! The procedure it's easy, but you will need some extras skills for making it.

So, I will try to give you some tips here to try it out by yourself:

  • 10K resistor must be connected between 1st (reset) pin and 7th (Vcc) of the Atmega328 micro controller.
  • 16MHz crystal oscillator must be connected at pins 9 and 10, labeled as XTAL1 and XTAL2
  • Connect to each pin of oscillator one 22pF capacitor. The other pin of capacitors goes to pin 8 (GND) of micro controller.
  • Remember to connect the second power line of the ATmega328 with your power source, pins 20-Vcc and 22-GND.
  • All other information for the Arduino pinout can be found at the second image above.
  • Use the LM7805 with two 0.22uF electrolytic capacitors (on input and output pins) to take 5V from your 12V power source. This is important! Do not provide more than 6V on your custom circuit!!! It will burn your Atmega micro controller and lcd circuit.

Step 5: Put It in a Box

Picture of Put It in a Box

Take your time and configure your box to fit your circuit. You can make it as big (or small) you want.

Step 6: Well Done!

Picture of Well Done!

That's it! You have successfully completed this guide and now you have your own Arduino door password unlock system!

You can find more Arduino tutorials and cool projects here.

I hope you liked this, let me know in the comments!

Comments

عمرج2 (author)2017-08-07

how can i store the updated password to eeprom? so that the system stores the updated password for next power up

عمرج2 (author)عمرج22017-11-05

plz tell me how can i store this password to eeprom

pkdsu007 (author)2016-11-02

hi. there it is a very nice project but i think there is a mistake in the drawing and in the comment where you described the LCD connections, i tried as you written and burned two voltage regulator in my UNO. it should be VSS to GND and VDD to 5V. other than that all is very nice thanks for it

Ardumotive_com (author)pkdsu0072016-11-02

You must have a different lcd than mines, always read the datasheet of your parts.

PeterM476 (author)Ardumotive_com2017-05-12

pkdsu007 is right actualy acording to your drawing in "Step 2: The Circuit" you connect VSS and VDD to ground, how that popped to voltage regulators i can't explain eighter...

MarkoM3 (author)2017-03-17

Hey, i made it but i have a problem. Blacklight on lcd is turned of. How to turn on backlight? Letters are visible but it is too dark.

KazeU (author)2016-10-29

Hi!

I´m trying to make a security system. Could you please explain me the role of the while loops in this code?

Thanks!

CaptainLlamas (author)2016-06-27

Cool! I had an idea like this a while ago but that used binary as the passcode (for some reason), but i could never figure out how to get the whole thing working. Thanks for the 'ible

MohamedE246 (author)2016-06-01

Nice project, Can we replace the Atmega328 to a Attiny85?
I'm starting with electronics.

Hi! No... it's too small with not enaugh pins.

rmartin18 (author)2016-05-31

Can you link to the door lock that you are using? Thanks!

Ardumotive_com (author)rmartin182016-05-31

Hi! Hi! I bought mine from a local store. (ebay link to something similar: http://www.ebay.com/itm/New-NO-Mode-Electric-Strike-Lock-for-Door-Security-Access-Control-system-use-/172023187089?hash=item280d618691:g:DngAAOSw1XdUVsGu)

HaT20 (author)2016-05-30

Password is not be changed pernament . When restart, password is still 2580. How to save pernament password. (Le Nguyen: nguyenseafood@hcm.vnn.vn)

Ardumotive_com (author)HaT202016-05-30

That's correct, because in real life the system will have always power. But, off course, in a a power failure the password will reseted to "8520". You can save your new password in EEPROM memory of atmega328 to avoid this, but I don't know how you can do this. I tried it with no success.

jsellers202 (author)2016-05-29

I was planning to do this exact thing this summer for an escape room club for my school. I've already purchased most of these items and was about to start the research to figure out the code, but here it is all typed for me. Thanks.

Great! You can post a photo of your final project here!

econjack (author)2016-05-29

Nice project. You can save a few dollars by using an Arduino Nano instead of the Uno. The Nano is considerably smaller and costs less than $4 on the internet. Also, the code could be simplified by using arrays and getting rid of the goto's. See the book: Beginning C for Arduino.

Ardumotive_com (author)econjack2016-05-29

Thanks for the tips

florinc (author)2016-05-29

Good stuff.

What box is that (and where did you source it from)?

Ardumotive_com (author)florinc2016-05-29

Thanks! It's just a small plastic project box, nothing special. I bought it from a local store.

ThomasVDD (author)2016-05-29

Very nice and well documented! Thanks fot sharing :)

Peter DavidE1 (author)2016-05-26

Muy intetesante

Gracias!

KNEXnCoding (author)2016-05-25

Very cool! I made something just like this except without the special keypad.

Great! :))))

AlexAndAmigos (author)2016-05-25

cool

Thanks! :)

About This Instructable

20,944views

510favorites

License:

More by Ardumotive_com:MIKE - Arduino Line Following Robot for Beginners "GRECO" - Arduino Object Avoiding Robotfor BeginnersArduino 3D Printed Digital Thermometer With DHT-22 Sensor
Add instructable to: