Lemontree

Electronic code lock design (schematic diagram + program)

 
Overview

Electronic combination lock
1. Circuit schematic diagram
2. Hardware connections on the system board (1). Connect P0.0/AD0 in the "MCU System" area to the SPKIN terminal in the "Audio Amplification Module" area with a wire; (2). Connect the SPK OUT terminal in the "Audio Amplification Module" area to the speaker; (3). Connect P2.0/A8-P2.7/A15 in the "MCU System" area to any ABCDEFGH terminal in the "Four Static Digital Display" area with an 8-core cable; (4). Connect P1.0 in the "MCU System" area to the L1 terminal in the "Eight-way LED Module" area with a wire; (5). Connect P3.6/WR and P3.7/RD in the "MCU System" area to the SP1 and SP2 terminals in the "Independent Keyboard" area with wires;
3. Programming content (1). Password setting, in this program, the password is fixed in the program memory ROM. It is assumed that the default password is "12345", a total of 5 digits. (2). Password input problem: Since two keys are used to complete the password input, one of the keys is a function key and the other is a numeric key. During the input process, first enter the length of the password, then enter the number of digits of the password according to the length of the password, until all password lengths have been entered; or the password input process can be completed only after the confirmation function key is entered. Enter the password judgment and comparison processing status and give the corresponding processing process. (3). Key disable function: During initialization, the key is allowed to enter the password. When a button is pressed and the key recognition state begins, the key disable function is activated, but the activated state occurs when the password is entered incorrectly three times.
4. C language source program #includeunsigned char code ps[]={1,2,3,4,5};unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f, 0x……

 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-24 09:13:07

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

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号