This is my final project of single-chip microcomputer.
The principle is relatively simple. It mainly uses 80C51 single-chip microcomputer and adds an LCD screen.
Summary
In daily life and work, the safety of residences and the protection of documents and data all need to be guaranteed by locks. Traditionally, mechanical keys are often used to open locks, but the loss of keys will greatly reduce the safety of the locks. With the continuous development of science and technology, electronic password locks have emerged, and password locks also have the advantages of high security, low cost, low power consumption, and easy operation.
This design is based on 51 single chip microcomputer, combined with LCD1602, matrix keyboard input, reset, power supply and other circuits. The system can complete basic functions such as unlocking and changing passwords. The whole design is developed in Keil environment, and the control program of the main control chip is written in C language to realize a multifunctional electronic password lock.
1. Introduction
1.1 Background of electronic combination lock
As society continues to progress and people's living standards continue to improve, safety has become one of the most concerned issues for modern residents. From ancient times to the present, locks have always been an indispensable tool for protecting people's property. At present, the most commonly used lock is the pin lock with a cylindrical pin. It has a simple structure, is easy to use, and is cheap, but it has many disadvantages in use: 1. It is easy to open; 2. The internal mechanical structure is complex and the failure rate is high; 3. It is troublesome to change the lock; 4. The mutual opening rate is high; 5. It is easy to be damaged; 6. The trouble of carrying keys; 7. The trouble of opening the door with keys.
An electronic password lock is an electronic product that controls the circuit or chip by inputting a password, thereby controlling the closing of a mechanical switch and completing the task of unlocking and locking. There are many types of electronic password locks, including simple circuit products and cost-effective products based on chips. The most widely used electronic password locks are based on chips and are implemented through programming. Their performance and security have greatly exceeded those of mechanical locks. Therefore, studying electronic password locks is in line with the current mainstream development trend, has great research significance and practical significance, and is also economically feasible.
1.2 Characteristics of electronic password locks
1. Good confidentiality, more code, much larger than pin lock. Random unlocking success rate is almost zero.
2. Password changeability: Users can change passwords frequently to prevent password theft and avoid the security level of the lock being lowered due to personnel changes.
3. Wrong code input protection: When the wrong password is entered multiple times, the alarm system will automatically start.
4. The electronic combination lock is simple and easy to operate, and you can learn it in one go.
5. Interference code function. You can enter any code before entering the correct password.
6. Security function: If you enter the wrong password 4 times in a row, the power will be automatically cut off for 3 minutes.
7. Panic Open function. When leaving, no other operations are required. Just one movement of the handle can mechanically open the door, so the door can be opened quickly and safely in emergency situations such as fire.
8. Intrusion sensing function: When the door is locked and someone breaks in, a strong alarm sound will be emitted.
9. Fire alarm function: If the indoor temperature reaches about 75°, a strong alarm sound will be issued and the lock will automatically open.
10. Double locking function. External forced locking: It cannot be opened from the inside, suitable for preventing intrusion when going out. Internal forced locking: It cannot be opened from the outside, making you feel more at ease and safe at home.
11. Weak battery reminder function. When the battery is low, a beautiful music will play when you start to open the door to remind you to replace the battery in time.
12. Automatic locking function. With a fully automatic lock core, the door will automatically lock within 6 seconds after it is closed, making it safer to go out.
13. External display function. When the password is entered incorrectly, the lock tongue is not locked properly, the room is locked, or the power is weak, there is an external prompt function.
1.3 Design significance of electronic password lock
The single-chip microcomputer is a typical embedded microcontroller (Microcontroller Unit), which consists of an arithmetic unit, a controller, a memory, an input and output device, etc. It is equivalent to a microcomputer. Compared with the general-purpose microprocessor used in personal computers, it emphasizes self-supply (no external hardware) and cost saving. Its biggest advantage is that it is small in size and can be placed inside the instrument, but it has a small storage capacity, a simple input and output interface, and low functionality. Due to its rapid development, the old definition of single-chip microcomputers can no longer meet the requirements, so it is called a wider range of microcontrollers in many applications; from the 1980s, the 4-bit and 8-bit single-chip microcomputers at that time have developed to the current 32-bit 300M high-speed single-chip microcomputers.
A single-chip microcomputer is equivalent to a microcomputer (minimum system). Compared with a computer, a single-chip microcomputer lacks peripheral devices. In summary: a chip becomes a computer. It is small in size, light in weight, cheap in price, and provides convenient conditions for learning, application and development. At the same time, learning to use a single-chip microcomputer is the best choice to understand the principles and structure of computers. It was first used in the field of industrial control.
In many ways, microcontrollers are more suitable for embedded systems than dedicated processors, so they are widely used. In fact, microcontrollers are the most numerous processors in the world. With the development and growth of the microcontroller family, the development of microcontrollers and dedicated processors has parted ways.
Almost every electronic device used in modern human life has a single-chip microcomputer integrated in it. Mobile phones, telephones, calculators, household appliances, electronic toys, PDAs, mice and other electronic products all contain single-chip microcomputers.
The design of electronic password lock based on single chip microcomputer only needs to connect simple interface circuit to the periphery of single chip microcomputer, and the core part can be programmed manually. This is not only easy to operate, but also can greatly reduce the product cost and is easy to upgrade and improve. This kind of electronic password lock design method is reasonable, simple and easy to operate, low cost, meets people's needs, and has certain commercial value and market promotion.
2. Experimental Principle
2.1 Introduction to the main hardware of the MCU development system
The hardware of the MCU development system is the HC6800EM3 MCU development tester of Puzhong Technology, which is a new generation of MCU development system with the multi-functions of "experiment, programming, ISP download line". The 51 MCU learning experiment board supports the experiment and programming functions of STC's enhanced 51 MCU, and is also compatible with the burning and experiment of AVR series MCU.
Hardware Layout
2. Experimental board port resources
The whole board adopts a functional modular design, that is, each functional module is independent and the ports are not connected. Therefore, when doing experiments, learners need to design and connect the hardware circuits themselves. For details, see the experimental board schematics and the contents of each experiment. The following table is a comparison table of some pins and peripheral IC interfaces:
2.2 Introduction to MCU Development Software
Introduction to KeilC51 Software Development System
In addition to the necessary hardware, software is also indispensable in the development of single-chip microcomputers. There are two ways to convert assembly language source programs into machine codes that can be executed by the CPU. One is manual assembly and the other is machine assembly. Manual assembly is rarely used nowadays.
After so many years of development, various compiler software has emerged. Keil C51 is a 51 series compatible MCU C language software development system produced by Keil Software in the United States. It is the mainstream tool for developing 51 series MCU. Compared with assembly language, C language has obvious advantages in function, structure, readability and maintainability, so it is easy to learn and use. After using assembly language, you will have a deeper understanding of C development.
C is a general-purpose programming language that provides efficient code, structured programming, and rich operators. C is not a large language, not designed for any particular application area, and it is generally less restrictive and can provide convenient and efficient programming for a variety of software tasks. Many applications are more convenient and effective to program in C than in other languages.
Previous article:51 MCU PWM speed and dimming program
Next article:51 single chip microcomputer displays any Chinese characters and characters on OLED
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Here is the camera information on the national competition list
- RF Components Test Technology Seminar for 5G - You are invited to attend!
- Has anyone designed this power supply?
- Network Control of ROS Melodic
- Let’s take a look at how this overvoltage protection circuit can be optimized?
- Inverter and Motor Control
- 【ST NUCLEO-H743ZI Review】(2) First experience with Ethernet testing
- Disassembling a common fire emergency light
- [NXP Rapid IoT Review] Mobile APP connection finally succeeded
- Buy an oscilloscope and get the essential analysis software 5-PWR for power engineers