Automatic Door Locking and Unlocking System With Arduino.
Components Required:-
1.Arduino MEGA
2.Keypad 4*4
3.Infrared Module (*2)
4.LCD Display 16*2
5.Power Supply(it can be between 5v to 12v max)
(I have used 12v adapter for arduino and a 5v adapter for servo motor)
6.breadboard(optional)
7.box for Fitting the lcd and keypad
8.jumper wires
**(I have used an external power supply for servo motor because, arduino is not capable for supplying large current greater the 600mA and their are two many thing attached to arduino here which is continuously taking current through it, so it may happen that servo motor stop working due reduction in current)
**(This has happened with me,the arduino keep on going reboot again and again)
Working of the lock:-
Password for this is 1234.
First if the door is closed and we enter the password 1234,it will print "Access Granted" on LCD and the door will open using the servo motor,I have connected a Aluminium Wire with the servo motor to the inner door lock. Now after opening the door it will print "Door is OPEN" ,(this happens due to the ir module placed on the top right of the door,after opening it gives a low signal to arduino).
Now if you just shut the door the ir module give a high signal to arduino(Wall Comes in front of it),and then again servo motor function and closes the door.
If someone wants to come out from inside,he just have to place his hand in front of the second ir module,it gives a low signal to arduino and again the servo motor functions,and opens the door.
Servo motor Attached to inner lock
Second ir Module Attached to Arduino(for Opening door from inside)
Plastic box is the 5v power supply for Servo motor (Arduino is not capable for supplying lagre current greater the 600mA )
Arduino Sketch for this lock:--
/* This code is writen by Sameer verma
For More Projects log on to www.arduinoexpert.blogspot.com
video for the working's --
*/
// This code is weitten for Educational purposes only
#include <Keypad.h>
#include<LiquidCrystal.h>
#include<EEPROM.h>
#include <Servo.h>
Servo servo1;
LiquidCrystal lcd(22,23,24,25,26,27); // pins of the LCD. (RS, E, D4, D5, D6, D7)
char password[4];
char pass[4],pass1[4];
int i=0;
#define ira 28
#define irb 29
char customKey=0;
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
char hexaKeys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[ROWS] = {7, 6, 5, 4}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {3, 2, 8, 9}; //connect to the column pinouts of the keypad
Arduino Basic Arduino is basically a micro-controller that is having the capability to control any type sensors,motors,receivers,controllers,modules,any thing. Arduino board is having a micro-controller chip (or IC) installed in it ,which is responsible for sending and receiving different types of signals.The board is also having a small ROM and RAM in it. so for controlling any sensor,motor, or any module ,You first need to write code in C language in the Arduino(IDE) application which can be downloaded from the web. The Arduino board works in the Binary language that is 0 or 1,HIGH or LOW, TRUE or FALSE.So after writing the code in Arduino application you need to connect the arduino board to PC ad then press the upload button ,then you will see in the application below writing compiling ,which means that before uploading the code ,Application converts the C language written code to Mac...
Programming an Arduino The arduino board can be programmed with using the arduino(IDE) software,and the programming in that software is done in C language,which is very easy to understand.Now let's get started Suppose,you want to glow an LED for a fixed time interval or blinking then first you need to specify the pin to which the led is connected by creating a variable name and attach it to that pin like this int LED=13; here any pin and any variable name can be selected and int is the initialize for that variable. Now you need to declare the variable or PIN as an OUTPUT ,in the void setup field like this void setup() { pinMode(LED,OUTPUT); } now,you have declared the variable as output,this means that arduino will only send signals to that pin and will not receive any that from that pin. now you need to write the loop statement in the void loop field, A ll the statement or functions written in the v...
Nice :D Try to use (CTRL + T) in Arduino IDE when you write code. Your code will looks better ;)
ReplyDeleteOh Yeah, thanks bro ...😲😄😄
Delete