Secret Clap Door Lock

A door lock which opens only when a particular pattern of claps are detected. An Arduino based system is created which hears the pattern of claps and compares it with the saved pattern. If both matches, the lock opens.

The pattern of claps is detected using a sound sensor module. It gives a LOW(False) when a clap is detected. I am using the time component to detect the pattern. The amount of time duration between two successive claps is measured and hence a pattern is formed. This pattern is then compared to the saved correct pattern.

Here I am using a LED instead of a lock for simplicity. A servo motor in the form of lock can be used. The LED glows when the pattern matches the correct pattern. If the incorrect pattern is detected, the LED remains dim and the program resets after 3 seconds and gets ready to take new pattern input.

Security is a major concern in our day to day life, and digital locks have become an important part of these security systems. This a simple example of the same.

Components :

  • Arduino Uno
  • Bread Board
  • Resistor (10K)
  • LED
  • Jumper Wires
  • Sound sensor module

Connections :

Code:

  
int motor_input1=11;
int motor_input2=10;
int motor_input3=5;
int motor_input4=6;
int L=2;
int R=3;

void setup() {
  pinMode(L,INPUT);
  pinMode(R,INPUT);
  Serial.begin(9600);
  pinMode(motor_input1,OUTPUT);
  pinMode(motor_input2,OUTPUT);
  pinMode(motor_input3,OUTPUT);
  pinMode(motor_input4,OUTPUT);
}

void loop() {
  if((digitalRead(R)==true)&&(digitalRead(L)==false)) {
    Serial.println("LEFT");
    analogWrite(motor_input1,200);
    analogWrite(motor_input2,0);
    analogWrite(motor_input3,200);
    analogWrite(motor_input4,0);
    delay(10);
  }
  else
  if((digitalRead(L)==true)&&(digitalRead(R)==false)) {
    Serial.println("RIGHT");
    analogWrite(motor_input3,0);
    analogWrite(motor_input4,200);
    analogWrite(motor_input1,0);
    analogWrite(motor_input2,200);
    delay(10);
  }
  else { 
    Serial.println("Straight");
    analogWrite(motor_input1,120);
    analogWrite(motor_input2,0);
    analogWrite(motor_input3,0);
    analogWrite(motor_input4,120);
    delay(10);
  }
  
}
  

Comments

  1. Hi! I am currently making a project just like yours (the deadline is on Wednesday) but the difference is my door lock would open and close with a clap. To be honest, I don't have any ideas about how will this work. May I ask if what are the changes in connections and components if I include closing the door lock. Thank you so much.

    ReplyDelete
    Replies
    1. And also, how do I replace the LED with a door lock? Thank you for your time.

      Delete
  2. Thanks for sharing such informative Blog. Composite doors are increasingly popular and provide an attractive alternative to front doors for houses and flats. Composite doors are made up of PVC, glass-reinforced plastic, wood and insulating foam that provides good weather resistance. Of course a high quality and reliable door lock must be used on your composite door to ensure your safety and security. “Locksmith York” is here to provide a range of locks. Visit our Site. composite door locks

    ReplyDelete
  3. Your blog is really attractive. I enjoyed seeing all the pictures and reading all the information. If you are searching for Cabinet Door Locks North Reading guide, then please consider us.

    ReplyDelete
  4. Thank for sharing such Informative Article. Composite doors are increasingly popular and provide an attractive alternative to front doors for houses and flats. Composite doors are made up of PVC, glass-reinforced plastic, wood and insulating foam that provides good weather resistance. Contact us if need any help. People will gets benefits. If you needs more info please visit our site.
    Composite Door Locks

    ReplyDelete
  5. Good information Thank you so much for sharing such updates. upvc door lock York

    ReplyDelete
  6. Thank you so much for sharing such updates. Visit: York locksmith

    ReplyDelete
  7. Great information.Thanks for sharing your information! Locksmith Clifton Great information.Thanks for sharing your information! Locksmith Clifton

    ReplyDelete
  8. Thanks for sharing this great information with us. Locksmiths Leeds

    ReplyDelete
  9. Thanks for sharing your information. This is very useful blog. uPVC door lock repair

    ReplyDelete
  10. Nice article. Thanks for sharing such a great information. Door lock repair Leeds

    ReplyDelete
  11. Thanks for sharing such a great information.This is very useful blog. Locksmith Horsforth

    ReplyDelete
  12. Borglocks offers high quality Hollow Metal Door Lock with fastest delivery and customer satisfaction. Due to the weight and hardiness of the steel doors, the keypad needs to be able to keep up so borglocks offers highest quality locks.

    ReplyDelete
  13. KEYINCODE growing range of electronic and mechanical access control products are designed to meet passage mode codes and standards for a range of security applications and needs.

    ReplyDelete
  14. Informative Blog on Door Lock. Thanks for sharing.
    Door Locks and Latches

    ReplyDelete
  15. Beautiful post. Thank you so much for sharing a Useful tips. Window Boarding Leeds

    ReplyDelete
  16. Great post. Thanks for sharing this blog with us. Locksmith Services in York

    ReplyDelete
  17. Thank you for sharing valuable post with us. It seems very informative for all readers. Thank you. Locksmith Los Angeles

    ReplyDelete
  18. Well done on creating such an amazing blog and thanks for sharing it with us. Locksmiths Break Into Your House

    ReplyDelete
  19. Thanks for sharing such a nice post with us. < ahref="https://www.drlocksltd.co.uk/home-security-get-your-home-secure-for-winter/"> Get Your Home Secure For Winter >

    ReplyDelete
  20. Thanks for sharing such a nice post with us. < a href="https://www.drlocksltd.co.uk/"> Locksmith York >

    ReplyDelete

Post a Comment

Popular posts from this blog

Three Wheeled Omnidirectional Robot : Motion Analysis

The move_base ROS node

Overview of ATmega328P