Comprehensive course design of electronic password lock based on 51 single chip microcomputer

Publisher:skyshoucangLatest update time:2020-01-06 Source: 51hei Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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:


Peripheral IC and MCU interface comparison table

74HC165

Parallel-in Serial-out Latch

CLOCK

P3.6

74HC595

Serial-in-parallel-out latch

MISO

P3.4 (with short-circuit cap)

INDAT

P1.7 (with short-circuit cap)

SCK

P3.6

SH/LD

P1.6

RCK

P3.5

74HC138

138 decoder

A

P2.2

DS1302

Real Time Clock

SCK

P3.6

B

P2.3

I/O

P3.4 (with short-circuit cap)

C

P2.4

RST

P3.5

AT24C02

EEPROM

SCL

P2.1

PCF8591

Digital to Analog/Analog to Digital Conversion

SCL

P2.1

SDA

P2.0

SDA

P2.0

Relay


P1.4 (with short-circuit cap)

buzzer


P1.5 (with short-circuit cap)

Infrared receiver


P3.2 (with short-circuit cap)

temperature check


P3.7

Stepper Motor


P1.0-P1.3

Serial communication


P3.0 P3.1

1602/12864/color screen 8-bit data interface


P0.0-P0.7

NE555

555 Timer


P3.5 (with short-circuit cap)

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.

[1] [2] [3] [4] [5]
Reference address:Comprehensive course design of electronic password lock based on 51 single chip microcomputer

Previous article:51 MCU PWM speed and dimming program
Next article:51 single chip microcomputer displays any Chinese characters and characters on OLED

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号