Knock detecting door lock.




                 Group members

                 D.G.U.I Wickramarathna 100590G

                 D.G.C.D Wijerathna     100596F

                 Y.M.S.N Wijayarathna   100597J

                 W.M.N.C Wijebandara    100598M
Abstract

The project idea was to build a knock detecting       In building knock detecting door lock we used
door lock which can identify the specific knocking    micro controllers, pattern detecting algorithms,
pattern and unlock the door if the pattern is         touch sensor circuit and password detect system.
correct. This door locking system provides much       At the first we use a Guitar Pick (microphone
security than systems which are currently using.      used in guitars) and detect the sound appears
When there are many users who use the door,           when knocking the door, but later we change it so
problems may occur because there is only one key      it detect pattern by touch sensing.
to open the door. But here in this door locking
system this kind of problems may not occur
because the users who know the knocking pattern
can open the door any time without a key.



Introduction

Background
                                                      Problem
Door lock is use in doors to lock the door, it is a
security strategy use for avoiding to open the        Key door lock is the most common door lock we
door. Only rightful person can open the door.         see in homes and many other buildings. Mostly
There are many type of door locks currently use       one key is use for one door so when many users
in the world. Key door lock is the most common        use door problems may occurs. And also
one among them. In high security systems it uses      security problems may occur if the keys can be
electronic door locks. Electronic door lock is        duplicated.If the key is lost door can’t be opened
locking device which operate with the means of        by the user and it can be found by someone else.
electricity. More often electronic door locks are     And also door opening should be very simple
connected to an access control.The advantages         and user doesn’t like to spend more time in front
of an electric lock connected to an access control    of the door opening the door. So face
system include: key control, where keys can be        recognition, eye detecting door lock also have
added and removed without re-keying the lock          some problems. Passcode door locks have
cylinder; fine access control, where time and         security problems in if someone can fetch the
place are factors; and transaction logging, where     password by looking user typing the password.
activity is recorded. Numerical codes,
passwords, passphrase, Security tokens,               Objective
biometrics, Finger prints, Face recognition etc.      We thought about the above mentioned problem
are some types of electronic locks.                   and try to find a solution and a way to improve
                                                      the security. So knock detecting door lock is the
                                                      idea we came up. Here door user can assign
                                                      specific knocking pattern to the door lock (can
                                                      be a music pattern of a song or a simple pattern)
                                                      so only the person who know the pattern and
                                                      who can knock that pattern in certain accuracy
                                                      can open the door. So only having one key
trouble may not occur with this door lock.             Research
    Because any user who use the door should know
    the knocking pattern and they can open the door        As mentioned in Introduction first we identified
    any time they want. Further development and            the need of a door locking system that reacts to
    higher security we thought about having a              knocking.
    password or face recognition. But it will take         In our research period first we studied about
    much money for the equipment so we decide
                                                           how to get sound of knocking. Getting noise free
    only to build the knock detecting part. And also       sound, how to recognize patterns using suitable
    we thought about farther development by                algorithms, connecting system with users mobile
    connecting the door lock with a mobile phone           phone via internet, Arduino Programming are
    via blue tooth. It increase the security and if user   the thing we researched in this period in purpose
    forgot the knock pattern only the specific user is     of coming up with a better solution for the
    able to connect the door lock.                         problem we identified.

                                                           Then we identified the most suitable way to
    Methods                                                reach our solution.

              march      April      May         June

              1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4

Identifyin                                                 Design
g the
Project                                                    The first design we came up with is to identify
Research                                                   correct knock by identifying sound made at the
                                                           knock. This is the design we came up to give
Making                                                     that kind of solution.
the project
Proposal
and cost
                                                            Microphone
estimation
Design
                                                                          Signal
Making                                                                   Amplifier
Prototype
Implement                                                                            Analog to
ation                                                                                 Digital
                                                                                     Converter
Testing
and Finish                                                                                         Signal
Project                                                                                          Processing
                                                                                                    Unit
Document
ation
                                                                                                              Door Lock
In this first design we used a guitar pick-             output will be send in to the door lock which
up(microphone used in guitars) (Figure 1) as the        will be opened only if the knock has accepted.
microphone. We used it because it can be
attached to wood, here to door so it only get the       There were few drawbacks of this design.
sound come along the timber without any noise.              1. The PIC we planned to use 16F877A
This microphone doesn’t accept any sound other                 has less performance than we expected.
than sound of knocking.
                                                            2. Pattern recognition algorithms are too
                                                               much complex.
                                                            3. Even though we use a Guitar
                                                               Microphone which reduces the noise,
                                                               noise still have a big impact on results.

                                                        Because of these issues we had to go to an
                                                        alternate solution to the problem.

                                                        To avoid these problems we do certain changes
                                                        in our design. We decided get pattern of the
                                                        knock by using touch sensing other than getting
                                                        sound input. This avoids problems occurred due
                                                        to noise.
             Figure 1 :Guitar pick-up
                                                        We replaced PIC with an Arduino Mega 2560
From microphone we get a current signal that is
                                                        development kit. Since it has more processing
proportional to the energy of the sound wave
                                                        power and memory, we could solve the
received by the microphone.
                                                        problems occurred due to law performance of
Then this signal is send to the signal amplifier.       PIC.

This circuit amplifies the weak signal from                        Touch-
                                                                  triggered
microphone so it can be used in processing.                         switch

Then the amplified signal is send into the                                      Signal
Analog to Digital Converter circuit. In that part                             Processing
                                                                                 Unit
analog signal is sampled at foscillator/64 rate. Then
average voltage of each sample is compared
                                                                                           Door Lock
with reference voltage and output 1 or 0 for each
sample. Then the output from ADC is a 1, 0 bit
pattern.                                                Implementation
This bit stream is send into the processing unit.       Touch triggering switch
In processing unit this bit pattern is compared
with the saved bit pattern, which is                    Touch-triggering switch is a circuit which gives
corresponding to the correct knock. If the              digital output, it returns +5V when touch is
difference between 2 bit patterns is less than pre-     present and 0V when no touch present. So the
defined percentage, the knock is accepted as            output of this part will be a digital signal
correct. Otherwise it is considered as wrong. An        depending on knock.
We identified three types of touch switches.         We identified that this type of switch is more
                                                     suitable for our device so we designed a switch
       Resistance touch switch                      using this type.
       Hum touch switch
       Capacitive touch switch                      So we used ne555 touch circuit which is a type
                                                     of Hum touch switch also have some deviation
Resistance touch switch (Figure 2) is the most       from it.
basic type of touch switch it is based on the fact
that human tissues,have a great amount of water      This circuit returns a digital signal
and salt, something that makes it conductive.        corresponding to the knock made. This signal is
                                                     send into the signal processing unit.




   Figure 2 :Resistance touch switch

This is not very flexible design and it needs two
electrodes, and not suitable for exposed to
environment very much because it can make a
conductivity between two electrodes with the
time.                                                Figure 4 : ne555 touch circuit

Hum touch switch(figure 3) is An Hum touch
sensor uses a high gain amplifier such as a
Darlington pair to amplify this parasitic voltage.
Here is a basic circuit with such a sensor:




Figure 3: Hum touch switch
Signal Processing Part




                                                     is given a priority value according to how many
                                                     saved patterns it matched with. If it is a correct
                                                     knock it is saved with its priority value. So when
                                                     number of times knocks has made is increased,
                                                     the accuracy of the algorithm will also increase.



                                                     Door lock

                                                     Electronic door locks use magnets, solenoids
Figure 4 : Circuit Schematic diagram                 and motors to actuate the lock by either
                                                     supplying or removing power. Operating the
                                                     lock can be as simple as using a switch, for
                                                     example an apartment intercom door release, or
In signal processing unit, digital signal            as complex as a biometric based access
corresponding to knock made at door is               control system.
compared with knock patterns which are saved.
                                                     In Magnetic Lock a large electro-magnet is
Signal processing is done by ATMEGA328               mounted on the door frame and a corresponding
micro controller. We used Arduino Uno circuit        armature is mounted on the door. When the
which ATMEGA328 is connected.                        magnet is powered and the door is closed, the
                                                     armature is held fast to the magnet. Mag locks
Programming
                                                     are simple to install and are very attack resistant.
Arduino board was programmed using C                 But the problem with this lock is this needs a
language.                                            large current and it cannot be supplied by a
                                                     battery. This current has to be given in main
In the program, first we save 3 sample knocks in     supply, and when there is a power cut this lock
processing unit. We have to knock 3 times while      will not work.
pressing a button, so 3 knocks will be saved.
What is saved here is the time gaps between two      In our design we used motor actuated door lock.
+5V pulses in the signal. It is a quality depends    In this door lock there is a motor which can
on the pattern of the knock. When somebody           rotate both ways. The lock is connected via a
knocks the door its pattern is compared with         lever to this motor. When motor is rotated to a
these saved patterns. If it is matched with any of   one side, door lock locks and when motor
the saved patterns it will be considered as a        rotated to other side it will unlock.
correct knock and signal is send to lock to open.
                                                     Here we used a servo motor for the door lock.
Even though in beginning there are only 3
samples, when times goes on number of samples
is increased up to 20. When door knock occur it
Bluetooth module

                                                       We used Blue tooth module in order to advance
                                                       the security of the door lock. Here a specific
                                                       person can unlock the door using his phone. This
                                                       facility can be provided as the interest of the
                                                       customer. If it is very high security door , door is
                                                       unlock when the both knock pattern is correct
                                                       and correct phone is near the door. And also it
                                                       can be provided as if the specific person forgot
                                                       the knock pattern he can unlock the door using
                                                       his phone.

                                                       Phone has a specific Bluetooth app and it sends
                                                       serial data which attach the MAC address of the
Figure 5: Servo motor
                                                       phone and receiving the data Bluetooth module
                                                       check that MAC address with saved MAC
                                                       address if both are the same door will be
Power Supply                                           unlocked.

Power is supplied to the system is by a 12V
power pack. And also here we have used a
backup power plan that will work under a power
cut using a 9V rechargeable battery.




                                                       Figure 7: Bluetooth module
                 Figure 6                              Results

                                                       Knock detecting door lock is an advance door
Here 12V supply and 9V supply has connected via 2      lock which can identify specific knock pattern
diodes. When 12V supply is present D2 will reverse     and figure out it is correct or not. If the knock
biased and no current will be taken from battery. D2   pattern is correct lock will be opened. Specific
will be forward biased only when 12V power supply      knock pattern is assigned by the user.
is unavailable and then current will be taken from
battery.                                               There is a metal plate in the door where we
                                                       should knock and only the finger should use to
                                                       knock because as earlier mentioned in the
                                                       methods when the finger touches the metal small
                                                       current is grounded through the body and it is
                                                       appears as a digital 1 voltage.
User can press and hold the assign button and       hand. If the knock is made by wood or any
knock the door in whatever pattern he likes and     insulator it won’t work properly.
it should be remembered very carefully by all
users who use the door. It is very hard to knock    Also user has to make knock on the circuit part,
in specific pattern 100% exactly twice. So we       if it is made on wrong place of the door it won’t
have to save same knock pattern 3 times. Those      recognize as a knock. There is an advantage of
are three sample patterns.. That knocking pattern   this also. Unauthorized person who is trying to
will be saved in the EEPROM. Saved pattern          open the door must know the correct place of the
will not be erased even the power is not in the     door to know with the correct knock pattern.
system. And we use the concept of learning          In the earlier design with knock detection by
algorithm. When the user knocks the door it is      sound, these problems were not present.
compare with the saved samples and calculate
the similarity percentage if it is more than 95%
user can open the door. And that knock pattern
will be saved as a sample pattern so when this
implement door lock pattern is adopt to the users
pattern changes. And these changes are not big
differences with the original samples but very
small changes which can’t be figure by ears.

Discussion

We thought about how to develop this door lock
with more features. For farther security here we
can assign more than one knock pattern so every
member who use the door has specific knock
pattern for each of them. And there may have a
main user. Each member should well remember
there knock pattern and they can open the door.
When someone opens the door automatically
SMS is sent to the main user’s mobile phone via
a GSM module informing which user opens the
door at the time. And also we can assign a
password for the user so he have to knock the
door correctly and if it is accepted SMS is sent
to particular user’s mobile phone requesting the
password , user have to give the correct
password to open the door. This will increase the
security level much high.

There are few limitations of this design too.

Touch triggered switch is working by leaking
some current through human body. So to proper
working, knock should be only made by human
Acknowledgment

First on foremost, we would like to thank Miss. Ashanthi Maxworth who guided us through doing this
project. Provided important advices, helped us in difficult periods and giving us necessary information.
And motivate us to do the project well.

And honorable thanks to Prof. (Mrs.) Indra Dayawansa for spend her valuable time forguide us to
improve the device and solving its problems. Provide important advices.

We also thank Mr. ArunaUpul Undergraduate at Department of Electronic and Telecommunication
Engineering for helping us with his knowledge to successfully finish our project.

Also an honorable mention goes to our families and friends for their understandings and supports on us in
completing this project. Without helps of the particular that mentioned above, we would face many
difficulties while doing thisAt last but not in least we would like to thank all who helped and motivated
us.



Reference

http://en.wikipedia.org/wiki/Touch_switch

http://www.arduino.cc/en/Main/ArduinoBoard
Mega2560

http://en.wikipedia.org/wiki/Servo_motor

Knock detecting door lock research paper

  • 1.
    Knock detecting doorlock. Group members D.G.U.I Wickramarathna 100590G D.G.C.D Wijerathna 100596F Y.M.S.N Wijayarathna 100597J W.M.N.C Wijebandara 100598M
  • 2.
    Abstract The project ideawas to build a knock detecting In building knock detecting door lock we used door lock which can identify the specific knocking micro controllers, pattern detecting algorithms, pattern and unlock the door if the pattern is touch sensor circuit and password detect system. correct. This door locking system provides much At the first we use a Guitar Pick (microphone security than systems which are currently using. used in guitars) and detect the sound appears When there are many users who use the door, when knocking the door, but later we change it so problems may occur because there is only one key it detect pattern by touch sensing. to open the door. But here in this door locking system this kind of problems may not occur because the users who know the knocking pattern can open the door any time without a key. Introduction Background Problem Door lock is use in doors to lock the door, it is a security strategy use for avoiding to open the Key door lock is the most common door lock we door. Only rightful person can open the door. see in homes and many other buildings. Mostly There are many type of door locks currently use one key is use for one door so when many users in the world. Key door lock is the most common use door problems may occurs. And also one among them. In high security systems it uses security problems may occur if the keys can be electronic door locks. Electronic door lock is duplicated.If the key is lost door can’t be opened locking device which operate with the means of by the user and it can be found by someone else. electricity. More often electronic door locks are And also door opening should be very simple connected to an access control.The advantages and user doesn’t like to spend more time in front of an electric lock connected to an access control of the door opening the door. So face system include: key control, where keys can be recognition, eye detecting door lock also have added and removed without re-keying the lock some problems. Passcode door locks have cylinder; fine access control, where time and security problems in if someone can fetch the place are factors; and transaction logging, where password by looking user typing the password. activity is recorded. Numerical codes, passwords, passphrase, Security tokens, Objective biometrics, Finger prints, Face recognition etc. We thought about the above mentioned problem are some types of electronic locks. and try to find a solution and a way to improve the security. So knock detecting door lock is the idea we came up. Here door user can assign specific knocking pattern to the door lock (can be a music pattern of a song or a simple pattern) so only the person who know the pattern and who can knock that pattern in certain accuracy can open the door. So only having one key
  • 3.
    trouble may notoccur with this door lock. Research Because any user who use the door should know the knocking pattern and they can open the door As mentioned in Introduction first we identified any time they want. Further development and the need of a door locking system that reacts to higher security we thought about having a knocking. password or face recognition. But it will take In our research period first we studied about much money for the equipment so we decide how to get sound of knocking. Getting noise free only to build the knock detecting part. And also sound, how to recognize patterns using suitable we thought about farther development by algorithms, connecting system with users mobile connecting the door lock with a mobile phone phone via internet, Arduino Programming are via blue tooth. It increase the security and if user the thing we researched in this period in purpose forgot the knock pattern only the specific user is of coming up with a better solution for the able to connect the door lock. problem we identified. Then we identified the most suitable way to Methods reach our solution. march April May June 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 Identifyin Design g the Project The first design we came up with is to identify Research correct knock by identifying sound made at the knock. This is the design we came up to give Making that kind of solution. the project Proposal and cost Microphone estimation Design Signal Making Amplifier Prototype Implement Analog to ation Digital Converter Testing and Finish Signal Project Processing Unit Document ation Door Lock
  • 4.
    In this firstdesign we used a guitar pick- output will be send in to the door lock which up(microphone used in guitars) (Figure 1) as the will be opened only if the knock has accepted. microphone. We used it because it can be attached to wood, here to door so it only get the There were few drawbacks of this design. sound come along the timber without any noise. 1. The PIC we planned to use 16F877A This microphone doesn’t accept any sound other has less performance than we expected. than sound of knocking. 2. Pattern recognition algorithms are too much complex. 3. Even though we use a Guitar Microphone which reduces the noise, noise still have a big impact on results. Because of these issues we had to go to an alternate solution to the problem. To avoid these problems we do certain changes in our design. We decided get pattern of the knock by using touch sensing other than getting sound input. This avoids problems occurred due to noise. Figure 1 :Guitar pick-up We replaced PIC with an Arduino Mega 2560 From microphone we get a current signal that is development kit. Since it has more processing proportional to the energy of the sound wave power and memory, we could solve the received by the microphone. problems occurred due to law performance of Then this signal is send to the signal amplifier. PIC. This circuit amplifies the weak signal from Touch- triggered microphone so it can be used in processing. switch Then the amplified signal is send into the Signal Analog to Digital Converter circuit. In that part Processing Unit analog signal is sampled at foscillator/64 rate. Then average voltage of each sample is compared Door Lock with reference voltage and output 1 or 0 for each sample. Then the output from ADC is a 1, 0 bit pattern. Implementation This bit stream is send into the processing unit. Touch triggering switch In processing unit this bit pattern is compared with the saved bit pattern, which is Touch-triggering switch is a circuit which gives corresponding to the correct knock. If the digital output, it returns +5V when touch is difference between 2 bit patterns is less than pre- present and 0V when no touch present. So the defined percentage, the knock is accepted as output of this part will be a digital signal correct. Otherwise it is considered as wrong. An depending on knock.
  • 5.
    We identified threetypes of touch switches. We identified that this type of switch is more suitable for our device so we designed a switch  Resistance touch switch using this type.  Hum touch switch  Capacitive touch switch So we used ne555 touch circuit which is a type of Hum touch switch also have some deviation Resistance touch switch (Figure 2) is the most from it. basic type of touch switch it is based on the fact that human tissues,have a great amount of water This circuit returns a digital signal and salt, something that makes it conductive. corresponding to the knock made. This signal is send into the signal processing unit. Figure 2 :Resistance touch switch This is not very flexible design and it needs two electrodes, and not suitable for exposed to environment very much because it can make a conductivity between two electrodes with the time. Figure 4 : ne555 touch circuit Hum touch switch(figure 3) is An Hum touch sensor uses a high gain amplifier such as a Darlington pair to amplify this parasitic voltage. Here is a basic circuit with such a sensor: Figure 3: Hum touch switch
  • 6.
    Signal Processing Part is given a priority value according to how many saved patterns it matched with. If it is a correct knock it is saved with its priority value. So when number of times knocks has made is increased, the accuracy of the algorithm will also increase. Door lock Electronic door locks use magnets, solenoids Figure 4 : Circuit Schematic diagram and motors to actuate the lock by either supplying or removing power. Operating the lock can be as simple as using a switch, for example an apartment intercom door release, or In signal processing unit, digital signal as complex as a biometric based access corresponding to knock made at door is control system. compared with knock patterns which are saved. In Magnetic Lock a large electro-magnet is Signal processing is done by ATMEGA328 mounted on the door frame and a corresponding micro controller. We used Arduino Uno circuit armature is mounted on the door. When the which ATMEGA328 is connected. magnet is powered and the door is closed, the armature is held fast to the magnet. Mag locks Programming are simple to install and are very attack resistant. Arduino board was programmed using C But the problem with this lock is this needs a language. large current and it cannot be supplied by a battery. This current has to be given in main In the program, first we save 3 sample knocks in supply, and when there is a power cut this lock processing unit. We have to knock 3 times while will not work. pressing a button, so 3 knocks will be saved. What is saved here is the time gaps between two In our design we used motor actuated door lock. +5V pulses in the signal. It is a quality depends In this door lock there is a motor which can on the pattern of the knock. When somebody rotate both ways. The lock is connected via a knocks the door its pattern is compared with lever to this motor. When motor is rotated to a these saved patterns. If it is matched with any of one side, door lock locks and when motor the saved patterns it will be considered as a rotated to other side it will unlock. correct knock and signal is send to lock to open. Here we used a servo motor for the door lock. Even though in beginning there are only 3 samples, when times goes on number of samples is increased up to 20. When door knock occur it
  • 7.
    Bluetooth module We used Blue tooth module in order to advance the security of the door lock. Here a specific person can unlock the door using his phone. This facility can be provided as the interest of the customer. If it is very high security door , door is unlock when the both knock pattern is correct and correct phone is near the door. And also it can be provided as if the specific person forgot the knock pattern he can unlock the door using his phone. Phone has a specific Bluetooth app and it sends serial data which attach the MAC address of the Figure 5: Servo motor phone and receiving the data Bluetooth module check that MAC address with saved MAC address if both are the same door will be Power Supply unlocked. Power is supplied to the system is by a 12V power pack. And also here we have used a backup power plan that will work under a power cut using a 9V rechargeable battery. Figure 7: Bluetooth module Figure 6 Results Knock detecting door lock is an advance door Here 12V supply and 9V supply has connected via 2 lock which can identify specific knock pattern diodes. When 12V supply is present D2 will reverse and figure out it is correct or not. If the knock biased and no current will be taken from battery. D2 pattern is correct lock will be opened. Specific will be forward biased only when 12V power supply knock pattern is assigned by the user. is unavailable and then current will be taken from battery. There is a metal plate in the door where we should knock and only the finger should use to knock because as earlier mentioned in the methods when the finger touches the metal small current is grounded through the body and it is appears as a digital 1 voltage.
  • 8.
    User can pressand hold the assign button and hand. If the knock is made by wood or any knock the door in whatever pattern he likes and insulator it won’t work properly. it should be remembered very carefully by all users who use the door. It is very hard to knock Also user has to make knock on the circuit part, in specific pattern 100% exactly twice. So we if it is made on wrong place of the door it won’t have to save same knock pattern 3 times. Those recognize as a knock. There is an advantage of are three sample patterns.. That knocking pattern this also. Unauthorized person who is trying to will be saved in the EEPROM. Saved pattern open the door must know the correct place of the will not be erased even the power is not in the door to know with the correct knock pattern. system. And we use the concept of learning In the earlier design with knock detection by algorithm. When the user knocks the door it is sound, these problems were not present. compare with the saved samples and calculate the similarity percentage if it is more than 95% user can open the door. And that knock pattern will be saved as a sample pattern so when this implement door lock pattern is adopt to the users pattern changes. And these changes are not big differences with the original samples but very small changes which can’t be figure by ears. Discussion We thought about how to develop this door lock with more features. For farther security here we can assign more than one knock pattern so every member who use the door has specific knock pattern for each of them. And there may have a main user. Each member should well remember there knock pattern and they can open the door. When someone opens the door automatically SMS is sent to the main user’s mobile phone via a GSM module informing which user opens the door at the time. And also we can assign a password for the user so he have to knock the door correctly and if it is accepted SMS is sent to particular user’s mobile phone requesting the password , user have to give the correct password to open the door. This will increase the security level much high. There are few limitations of this design too. Touch triggered switch is working by leaking some current through human body. So to proper working, knock should be only made by human
  • 9.
    Acknowledgment First on foremost,we would like to thank Miss. Ashanthi Maxworth who guided us through doing this project. Provided important advices, helped us in difficult periods and giving us necessary information. And motivate us to do the project well. And honorable thanks to Prof. (Mrs.) Indra Dayawansa for spend her valuable time forguide us to improve the device and solving its problems. Provide important advices. We also thank Mr. ArunaUpul Undergraduate at Department of Electronic and Telecommunication Engineering for helping us with his knowledge to successfully finish our project. Also an honorable mention goes to our families and friends for their understandings and supports on us in completing this project. Without helps of the particular that mentioned above, we would face many difficulties while doing thisAt last but not in least we would like to thank all who helped and motivated us. Reference http://en.wikipedia.org/wiki/Touch_switch http://www.arduino.cc/en/Main/ArduinoBoard Mega2560 http://en.wikipedia.org/wiki/Servo_motor