Design of electronic code lock based on STC12C5A60S2 single chip microcomputer

With Shenzhen Hongjing Company STC12C5A60S2 as the main control chip, combined with digital display, keyboard, alarm system and other peripheral circuits and machine parts, through the c language programming program, designed an electronic password lock with unlocking, modifying passwords, alarms and other functions. It has the characteristics of low power consumption, simple structure, complete functions, safety and stability.

1 Introduction

In the past, the preservation of personal data, the department file file used mechanical locks, a key lock, need to carry a lot of keys, inconvenient to use. With the development of science and technology, people are increasingly demanding security and security. Traditional mechanical keys have been unable to meet people's daily needs due to poor safety, portability, and inconvenience. These drawbacks of mechanical locks are a new type of lock, the electronic code lock, which provides a lot of room for development. The electronic code lock is a mechatronics high-tech product integrating computer technology, electronic technology and digital cryptography. It has the advantages of high security and convenient use.

With the development of integrated circuit technology, the advent of single-chip microcomputers, and then there have been many electronic code locks with microprocessors, which effectively break through the shortcomings of mechanical lock codes and poor security, making the locks in technology and performance. It has a great improvement, and it also has the advantages of simple operation, low power consumption and low cost, which makes the electronic code lock become the mainstream product on the market.

Based on the above ideas, this product uses the STC12C5A60S2 single-chip microcomputer of Hongjing Technology Co., Ltd. to design an electronic password lock, which has the following functions: It can set up to 20 passwords, the password is imported through the keyboard, the digital tube displays the prompt, and the user can modify the settings by himself. The password is written into the flash memory area of ​​the STC12C5A60S2 by the program, which effectively prevents the electronic password lock from losing the password, thus enhancing the security of the password lock. In addition, the electronic lock has three password error alarms and locks. Features.

2, system structure

The electronic code lock system of this design mainly includes STC12C5A6S2 single chip microcomputer, alarm circuit, matrix keyboard, display circuit and so on. The main components of the circuit are shown in Figure 1.

Design of electronic code lock based on STC12C5A60S2 single chip microcomputer

Figure 1 system composition diagram

3, hardware circuit design 3.1 STC12C5A6S2 microcontroller

The designed electronic password lock is based on the single-chip STC12C5A6S2. The STC12C5A6S2 is a 60K flash program storage area and 1280B static random storage area, high-performance microprocessor, high-speed, low-power, super anti-interference enhancement. Type 8051 MCU, the instruction code is fully compatible with the traditional 8051, but the speed is 8~12 times faster. STC12C5A6S2 has the following features: 40 pins, 60K on-chip program memory, 1280 bytes of static random access data memory, P0, P1, P2, P3 four I/O ports, 16-bit timers, ISP/IAP There is no need for a dedicated emulator to download the user program directly through the serial port. It can be completed in a few seconds. The MAX810 dedicated reset circuit is integrated (when the external crystal is below 12M, the reset pin can directly be 1K resistor to ground), and the external detection circuit [4].

3.2 keyboard circuit design

This product uses a keyboard control circuit, the principle is shown in Figure 2. Each horizontal line intersects with the vertical line through a button. With the determinant matrix structure, four row lines and three column lines are required to form a keyboard of 3&TImes; four buttons. In the figure, the four lines of the half-time machine connected to the line are used as the output, and the other three interfaces are used as the input. When the button is pressed, the output of the input line is low. If no button is pressed, all the inputs are It is high level, indicating no key press.

Design of electronic code lock based on STC12C5A60S2 single chip microcomputer

Figure 2 3 & TImes; 4 matrix keyboard principle

3.3 display circuit design

This system adopts LM016L liquid crystal module to generate 5&TImes through 7-bit character code of CGROM through the I/O port of P0 end of single chip microcomputer; 7 kinds of dot matrix characters 160 and 5 & TImes; 10 dot matrix characters 32 kinds, 8-bit character code and character The corresponding relationship realizes the display function of the password lock, and the signal output from the P0 port is sent to the shift register, and under the action of the shift pulse, the input data is moved to realize the dynamic display input of the password.

3.4 circuit control machine part

As shown in Fig. 3, the base current of the Q1 triode is amplified by a triode amplifier circuit to drive the electromagnetic relay to make it a physical lock switch, realize a small current circuit to control the high current circuit, and complete the electronic password lock switch function.

Design of electronic code lock based on STC12C5A60S2 single chip microcomputer

Figure 3 circuit control machine part

4, software design

The software part of the system is written in C51 MCU language, including main program and subprogram design. The main program completes the main information interaction and logic function. The specific implementation of the function is completed by the subroutine. The main program calls the subroutine to complete all functions [6]. The program functions include: system prompt, keyboard input, password judgment, alarm function after three errors, and unlocking the drive part after completing the password verification. The program flow chart is shown in Figure 4.

Design of electronic code lock based on STC12C5A60S2 single chip microcomputer

Figure 4 program flow chart

Outdoor Antenna

With the rapid development of mobile communication equipment, in the mobile communications network engineering design, according to the requirements of the network coverage, traffic distribution, anti-interference requirements and network service quality and so on the actual situation to select the base station antenna, the communication base station antenna is currently on the market work the characteristics of the narrow frequency band, such as directional literal outdoor antenna, The operating frequency band is 860~960Mhz. Those multi-band antennas have the characteristics of high manufacturing cost and complex structure. With the development of communication technology, especially the popularization of 3G communication technology, such antennas are difficult to meet the market requirements. Therefore, to avoid the above problems, it is necessary to provide a base station antenna that is simple to manufacture, low cost, and reliable in performance to overcome the alleged defects in prior art.

Outdoor Antenna for TV,Outdoor Antenna for WiFi,Outdoor Antenna for Booster,Outdoor Antenna for Router,Waterproof outdoor Antenna

Yetnorson Antenna Co., Ltd. , https://www.yetnorson.com

Posted on