42- Design of electronic code lock based on 51 single chip microcomputer

Specific realization function

 

The system consists of AT89S52 single-chip microcomputer + AT24C02 data storage module + button module + LCD1602 display + alarm module and so on.

Specific functions:

1. Enter the password, and the entered password is displayed on the LCD screen;

2. After pressing "DorBell", the door bell will ring;

3. The initial password is "1234". After the input is correct, "OK" is displayed, and the LED light flashes, indicating that the door is open;

4. When the password is entered incorrectly, "Eror" will be displayed, and an alarm will be issued after three incorrect entries;

5. Press "DELE" to clear the entered password.

design background

Electronic code locks are widely used in the current market. They mainly control the system or circuit by inputting an external code, and further control the operation of the system's mechanical switches. Related electronic products can be controlled by system programming in the form of electronic code locks to achieve system switching, especially for mechanical products, which have high security and reliability. The design of the electronic code lock system proposed in this paper is mainly based on the AT89S52 single-chip microcomputer. The main system is composed of matrix keyboard, LCD display, buzzer, diode and other components. The system is convenient to design and program, has strong operability, high practicability, and low energy consumption, and has a wide range of applications in the market.

This design uses the AT89C51 single-chip electronic lock system to initialize the settings and start the password lock function. The password input display screen uses a seven-segment digital tube semiconductor light-emitting device. The system control instructions are realized by the single chip microcomputer, and the single chip microcomputer allocates the work content of the components according to the actual operating conditions, and the program is highly operable, convenient and simple. When the user enters the password, the single-chip microcomputer will use the matrix button layout mode to record the current input password and compare the password with the system setting password. If the password matches, the password lock will be turned on. If the password is wrong, the user needs to press the delete button. Please re-enter password. When the user enters the wrong password more than 3 times, the electronic password lock will be automatically locked. The user needs to switch the administrator mode and enter the administrator password to unlock the current state, and re-enter the unlock password.

hardware design

The hardware design is mainly composed of the following parts: AT89S52 single-chip microcomputer minimum system, AT24C02 data storage module, button module, LCD1602 display + alarm module design and implementation, and circuit board welding. The main work includes circuit diagram design, PCB diagram design, circuit board welding and testing, etc.

software design

After writing the C language program, we put the program into the KEIL software for debugging, and use the software to burn the C code into the single-chip minimal control system.

The following programming ideas for this program design:

(1) Define the value type, call the delay program, and define the data sending position;

(2) Key scan program;

(3) Password matching and alarm procedure.

 

Schematic diagram

The system schematic design adopts Altium Designer19, as shown in the figure.

program

This design uses KEIL5 software to realize the program design, as shown in the figure.

Simulation implementation

This design uses protues8.7 software to realize the simulation design, as shown in the figure.

All information

All materials include programs (notes), AD schematics, PCB source files, protues simulation, reference papers, program explanations, simulation explanations, simulation videos, schematic explanations, introductions to the use of materials, etc., the most complete network!

For information, please follow the WeChat public account "Electronic Engineer Growth Diary", and reply the key word: "Information"!

Guess you like

Origin blog.csdn.net/weixin_41017942/article/details/115145367