Skip to main content

ARDUINO KEYPAD LOCK SECURITY SYSTEM WITH SERVO MOTOR

                   ARDUINO KEYPAD LOCK SECURITY SYSTEM WITH SERVO MOTOR


ARDUINO:


         Arduino is Basic system which is used for the controlling various system that does lots of work.The arduino develope in 2003,the arduino is basically a microcontroling unit the code return in the form 8 bit ,32 bit which is return in the language of C and C++`The RAM in arduino is SRAM.


KEYPAD LOCK:


        
             A Keypad Lock is the microcontrolled Security System in which it can be controlled which is contolled by the keypad which is 4*4 matrix and we could be secured with that.Here is the simple project with that we can do the keypad security system.


WIRING DIAGRAM:




PROCEDURE:


           Connect the keypad 4*4 matrix to the arduino as shown in the wiring diagram.Then as the same connect the buzzer,leds,servo as shown in the wiring diagram.Then upload the code from below,copy the code and paste in the arduino and just compile it and upload it.The circuit works.


SOURCE CODE:

//NBSL Commercial
#include <Password.h> //http://playground.arduino.cc/uploads/Code/Password.zip
#include <Keypad.h> //http://www.arduino.cc/playground/uploads/Code/Keypad.zip 
#include <Servo.h> //tells to use servo library


Servo myservo; //declares servo
Password password = Password( "1234" ); //password to unlock, can be changed

const byte ROWS = 4; // Four rows
const byte COLS = 4; // columns
// Define the Keymap
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte rowPins[ROWS] = { 9, 8, 7, 6 };// Connect keypad COL0, COL1 and COL2 to these Arduino pins.
byte colPins[COLS] = { 5, 4, 3 };


// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){
  Serial.begin(9600);
  Serial.write(254);
  Serial.write(0x01);
  delay(200);
  pinMode(11, OUTPUT);  //green light
  pinMode(12, OUTPUT);  //red light
  pinMode(1, OUTPUT);   //buzzer
  myservo.attach(13); //servo on digital pin 9 //servo
  keypad.addEventListener(keypadEvent); //add an event listener for this keypad
  }

void loop(){
  keypad.getKey();
  myservo.write(0);
  }
  void keypadEvent(KeypadEvent eKey){
  switch (keypad.getState()){
  case PRESSED:
 
  Serial.print("Enter:");
  Serial.println(eKey);
  delay(10);
 
  Serial.write(254);
 
  switch (eKey){
    case '*': checkPassword(); delay(1); break;
   
    case '#': password.reset(); delay(1); break;
   
     default: password.append(eKey); delay(1);
}
}
}
void checkPassword(){
 
if (password.evaluate()){ 
   
    Serial.println("Accepted");
    Serial.write(254);delay(10);
    myservo.write(150); //deg
   
        digitalWrite(11, HIGH);
    delay(5000);
    digitalWrite(11, LOW);
   
   
}else{
    Serial.println("Denied");
    Serial.write(254);delay(10);
    myservo.write(0);
    digitalWrite(12, HIGH);
    delay(500);
    digitalWrite(12, LOW);
     digitalWrite (1, HIGH);
   delay (500);
   digitalWrite (1, LOW);
  delay (500);
 digitalWrite (1, HIGH);
   delay (500);
   digitalWrite (1, LOW);
     delay (500);
 digitalWrite (1, HIGH);
   delay (500);
   digitalWrite (1, LOW);


   
}
}


CHECK HOW IT WORKS:





                                                    POWERED BY

                                                             NBSL



















































































 


               


Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete

Post a Comment

Popular posts from this blog

SOIL MOISTURE SENSOR USING ARDUINO WITH CONNECTION AND CODE

SOIL MOISTURE SENSOR USING ARDUINO WITH CONNECTION AND CODE Soil moisture sensor is the sensing element which determine the volumetric amount of water in the soil .The sensor sense the amount of water by passing an minute voltage at its terminal .Then when the water presence is detected it send an minute voltage to the amplifying circuit and it is further amplified and send to the Arduino. Components Required:                       1) Arduino                       2) Soil Moisture sensor                       3) Led                       4) Connecting wires...

India Space Research

INDIAN SPACE RESEARCH                                      The Technology is developing day by day and new innovations are coming out day by day. Many things are runs with help of satellites for example TV receiver, Weather Forecasting, Global positioning systems(GPS), Defense purposes. Thus Aerospace development is very important for an country. INDIA , places 5 th place in space developments. The ISRO is the Indian organization of space research Developments. What is ISRO? ISRO expands as Indian Space Research Organization, which is the Indian space Development organization. ISRO Ranks 5 th place in space research. Who founded ISRO?  Indian Space Research Organization (ISRO) was founded by Jawaharlal Nehru, who is the First Prime Minister of INDIA and Scientist Vikram Sarabhai, who is known as the father of space programs in the year 1962 as Indian National Com...

How does ant walk in straight line

How does ant walk in straight line? Normally, Ants live as big colony and it is organized. When the ant found food it takes a small piece of food and returns to its colony, while returning from the food area to its colony ant releases chemical called pheromones with the help of pheromones  other ants in their colony goes to the food area and brings the food to their colony. The pheromones evaporates at certain time of interval so other ants which carry food also releases pheromones it helps in reaching of other ants from colony to reach food. Every each set of ant consists of unique set of pheromones so it helps to find other colony and its does not allow other colony ant to enter in their colony and even it attacks them. How does old book smell good? Smell of book is basically by the paper and ink and the paper is primarily made up of wood and the wood is made up of cellulose and lignin . Over years, the book is exposed to heat, light, moisture and it bega...