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
Programming an Arduino(Level 2) using loop statements 1.Conditional statements(if/else) These statements are executed when the condition which is specified in it becomes true And these statement's are used when when we need to perform a specific task after the condition becomes true ,we can write this statement if the void loop field like this if(condition) { (Task which need to be performed goes here) } else { (If the condition becomes false then this block of code will be executed) } Example of code if ( x > 120 ) digitalWrite (LEDpin, HIGH ); if (x > 120 ) digitalWrite (LEDpin, HIGH ); if (x > 120 ){ digitalWrite (LEDpin, HIGH ); } if (x > 120 ){ digitalWrite (LEDpin1, HIGH ); digitalWrite (LEDpin2, HIGH ); } 2.While loop(while) A while loop will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change t...
Arduino Color Sensing Tutorial – TCS230 TCS3200 Color Sensor In this Arduino Tutorial we will learn how to detect colors using Arduino and the TCS230 / TCS3200 Color Sensor. You can watch the following video or read the written tutorial below for more details. How TCS230 Color Sensor Works The TCS230 senses color light with the help of an 8 x 8 array of photodiodes. Then using a Current-to-Frequency Converter the readings from the photodiodes are converted into a square wave with a frequency directly proportional to the light intensity. Finally, using the Arduino Board we can read the square wave output and get the results for the color. If we take a closer look at the sensor we can see how it detects various colors. The photodiodes have three different color filters. Sixteen of them have red filters, another 16 have green filters, another 16 have blue filters and the other 16 photodiodes are clear with no filters. Each 16 photodiodes are connected i...
Nice :D Try to use (CTRL + T) in Arduino IDE when you write code. Your code will looks better ;)
ReplyDeleteOh Yeah, thanks bro ...😲😄😄
Delete