Design of electronic mechanical lock for fingerprint recognition based on ATmega162

Source: Internet
Author: User
Tags administrator password

0 Introduction

With the improvement of living standards, people's demand for material life is more and more high, especially the housing safety. With the development of biometric recognition technology,Fingerprint IdentificationTechnology has gradually entered the realm of people's lives, fingerprint locks into people's families. Common fingerprint lock, need Administrator fingerprint or administrator password, can do fingerprint and password add and delete operation. The design of this paperElectronic Mechanical Lock, with the above functions, you can also use the correct Key management fingerprint and password.

The common fingerprint lock is equipped with a mechanical lock that can be opened with a common correct key, a lower level of security, and is easily cracked by professionals. This paper designed based on PIC16F72 mechanical lock, supporting the key built-in coding chip, can set the correct key and send key code information, only with the correct key to open, can not be wire or other illegal keys open, security greatly improved. In the case of illegal door opening, the mechanical lock sends alarm information.

1 system Design Scheme

Electronic Mechanical Lock, which is divided into two parts: Electronic lock and mechanical lock. Electronic lock with single chip microcomputerATmega162As the core, throughFingerprint Identificationmodule, completed the operation of the fingerprint management, through the keyboard to complete the operation of password management, through the Heterodyne receiver module, can receive the key code from the mechanical lock information, complete the communication with the mechanical lock.

The mechanical lock takes pic single chip microcomputer pic16f72 as the core, obtains the key code information, sends through the Heterodyne transmission module. Heterodyne transmit and receive module operating frequency in the 433 MHZ,PCB cabling attention to the Heterodyne module, away from other devices, otherwise it will affect the system's working state. In addition, the system requires small size, convenient power supply, the entire system of power consumption should be as low as possible.

1. 1 Electronic Lock block diagram

The main body of electronic lock is AVR single chip microcomputerATmega162Fingerprint Identificationmodule, heterodyne receiver module, 1 v Electronic lock driver, door lock, keyboard, key and LED, etc. Fingerprint Identification Module Model: TFS-M12, using TI DSP chip tms320vc5501, fingerprint algorithm using TFS-9. Stable and fast chip and excellent fingerprint algorithm not only improve the whole system recognition rate and shorten the recognition time, but also greatly shorten the development time of the whole system.

The electronic lock is in a sleep state when it is not in use. When the user opens the metal dust cover on the fingerprint identification module, the wake-up signal is generated and the electronic lock enters the normal working state.

Under normal working condition, the electronic lock supports two kinds of open door modes: fingerprint door opening and entering password. Fingerprint acquisition head of the input fingerprint, fingerprint identification module will be the current fingerprint and the existing fingerprint comparison, single-chip microcomputer ATmega162 received the comparison results, if the correct generation of open-door signal, by the E-lock drive, open the door lock. Keyboard input password, single-chip microcomputer ATmega162 the current input password and the user set the correct password to compare, if the correct generation of open-door signal, by the E-lock drive, open the door lock. The chance to enter the fingerprint and password is 3 times, if 3 times are wrong, the system goes to sleep state.

1. 2 Mechanical lock block diagram

Mechanical lock Body for PIC microcontroller pic16f72, Heterodyne transmission module, set key, LED, etc., 2. Set the correct key step: Press the setting key, the indicator light is always on, insert the key that needs to be set, wait for the light to blink regularly 3, set the success, open 1 times with the correct key after setting up, return to normal use state. When inserting an illegal key such as a faulty key or a wire, the indicator light flashes quickly and sends an alarm message via the Heterodyne transmit module.

In order to reduce the power consumption of the whole system, the mechanical lock is in a non-working state when not in use. When the mechanical lock is installed, a metal-to-interface is installed in the lock core of the mechanical lock, the metal-to-wire interface is connected with the dust cover of the electronic lock, turning the metal-to-wire interface, not only to the mechanical lock power to enter the normal working state, but also wake the electronic lock, let the electronic lock into normal operation Turn the metal turn interface, also make the electronic lock in the microcontroller ATmega162 4th Port 5th place (that is, P4. 5) into a high level, the electronic lock only handles the information from the mechanical lock.

Mechanical lock normal operation state, insert the key, SCM PIC16F72 will identify the key code, if correct, open the valve on the lock core, you can turn the key to open the door, if the error is sent wrong key information, lock the valve is still closed, can not open the door, thereby ensuring that the user's safety.

1. 3 Communication of electronic locks and mechanical locks

The communication between the electronic and mechanical locks is done through the Heterodyne transmit and receive modules. The mechanical lock sends the information shown in 3, each data width is 1 ms. Due to the influence of the noise, the single-chip microcomputerATmega162It can only be received by query mode.

The preamble is made up of 23 bits of data. The data code consists of a FAH code, an address code, and a key code, each of which has 10 bits, consisting of 8 bits of data, a starting bit (1) and an end bit (0), respectively.

Address code is the identification code of the mechanical lock, the identification code is unique, each time you read the key code, will be the current address code and stored address code to compare, if the same to read the key code, so will not receive from other users of the lock sent information.
Key code is the key coding, each key code is unique, so you can record the user's family members open the door information, user-friendly query.Electronic Mechanical LockApplication in the office, if theft occurs, you can check the recent opening information to determine the suspect, you can also inquire about the special key door, such as the specific time of the nanny work. If an illegal open door, the key code is 0x00, received the key code, generates an alarm signal.

2 fingerprint recognition algorithm principle

2. 1Fingerprint IdentificationAlgorithm

Fingerprint IdentificationIt is divided into the following 4 steps 4.

The preprocessing of fingerprint image is the most important step, which is related to the correctness of the feature points extracted later.

Because of the imperfections of the fingerprint acquisition equipment, for dry, wet, dirty, aging, wear fingerprints, often difficult to capture a clear image, so the need for image enhancement, fingerprint image preprocessing is an important step, the use of Gabor filter to complete. According to the pattern distribution of local area of fingerprint image, the corresponding Gabor band-pass filter is designed to modify and filter the fingerprint effectively in the local area with a stable direction and frequency. The Gabor function is the only function that can reach the lower bound of the time-frequency uncertainty relation, and the two-dimensional expression is:

The Gabor function is the translation function of the Ivigos function in the spatial frequency domain, and the σx,σy is the angular frequency translation parameter corresponding to the x direction and y direction. The real and imaginary parts of the two-dimensional Gabor function can be represented as a function, called even gahor and the odd Gabor function respectively. The even Gahor function is suitable for enhancing the target object, while the odd Gabor function is suitable for enhancing the edge of the object.
The Gabor filter coefficient component is:

In the formula: X=mcosφ+nsinφ;y=-msinφ+ncosφ; (i,j) is the coordinates of the current point, φ is the direction of the current point (block), F is the frequency of the sine plane wave of the current block (whole), and (M,n) the range of values is the same as the coordinates (I,J) of the fingerprint image. Σx,σy increase, the ability to adapt to noise is enhanced, but it is possible to generate pseudo-lines, reduce the effect of noise reduction.

For each point, the Gabor filter coefficients are calculated according to their direction and frequency, and then the values of the current point filter are computed according to the formula (3):

From Figure 5 It is obvious that after Gabor filtering, the image contrast is enhanced, the texture is clear and the features are obvious, which improves the accuracy of the subsequent extraction of fingerprint feature points.


2. 2 Communication protocol for fingerprint identification module

Fingerprint identification module as slave device, through the serial port, by the main chipATmega162Send the relevant command to control it.
Command interface: 19200b/s 1 start bit 1 stop bit (no check bit).

The main chip sends the command and the Fingerprint module response data length is 8 B, the data format is as follows:

CMD: Command/response type; P1. P2,P3: Command parameters; q1,q2,q3: reply parameter; CHK: Checksum, which is the 2nd byte to 6th byte XOR value, Q3 is used to return the validity information of the operation, whether the operation is successful, the data exists, the acquisition fingerprint timeout, and so on.

3 Programming

When the system starts from sleep, the system initializes and then goes to the normal operating state, as shown in 6.

Rotating the mechanical lock of the metal interface will change the microcontrollerATmega162The P4. 5 of the state. Turn on the metal interface, single-chip microcomputerATmega162Processing information from a mechanical lock, turning off the metal-to-wire interface, single-chip microcomputerATmega162Processing from the electronic lockFingerprint IdentificationThe module or keyboard information.

The system also turns on two interrupts: setting interrupts and matching interrupts. A matching interrupt is an electronic lock that matches a specified mechanical lock, receiving only information from a specified mechanical lock, and setting interrupts is the management of fingerprints and passwords.

3. 1 Matching interrupts

Matching interrupts are linked multiple featuresElectronic Mechanical LockTwo-part premise, initial installationElectronic Mechanical LockA matching interrupt must be made. The correct key must not be placed before the interrupt is opened. The matching interrupt is an external interrupt, which is shown by pressing the matching key on the control system module and entering match interrupt 7.


3. 2 Setting interrupts

There are two modes of setting up interrupts: Normal mode and special mode. The special mode is to use the correct key to manage fingerprints and passwords, as shown in 8.

Multi-FeatureElectronic Mechanical LockThe ability to manage fingerprint and password is added, and the current fingerprint lock does not have this feature. When there is no administrator fingerprint, and the password forget the case, the lock can use the correct key to the fingerprint and password to add and delete, to the user to bring convenience.

4 Experimental results and analysis

The communication between the Heterodyne sending and receiving modules, due to the external noise and the system itself, is not able to receive 3 of the information each time, there may be a communication error situation, for this reliability test experiment.

Using the oscilloscope to accurately measure the timing of the waveform on the Heterodyne receiver module, adjust the code so that the detection point falls in the middle of the high level, carefully calculate the delay function, to ensure the accuracy of time. In the actual commissioning process, carried out 5 groups of experiments, each group of test conditions are different, such as temperature, environmental noise, each group test 100 times, a total of 500 tests, only 2 times did not correctly identify the key situation, the reliability of 99. 6%, with practical application value.

5 Conclusion

This paper designs the electronic mechanical lock, cleverly utilizes the Heterodyne send and receive module, the two relatively independent parts link up. The whole system is based on single chip microcomputer ATmega162 as the core, direct controlFingerprint IdentificationModules and keyboards, and indirectly control the mechanical lock section through the Heterodyne transmit and receive modules. Multi-feature electronic mechanical lock can not only use the administrator fingerprint and password to manage user information, but also use the correct key to manage user information, the current market does not have the function of the lock appears. The locking function is powerful, which brings convenience and rapidity to the user, and the security is greatly improved.

Design of electronic mechanical lock for fingerprint recognition based on ATmega162

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.