摘 要
在现代社会中,电梯已经成为人类必不可少的垂直运输交通工具。但是很多的电梯还依旧是直上直下式的,不能够最快捷的到达所选楼层,这样很不方便,且浪费资源。
为了改善电梯运行的模式,本设计利用89C51单片机为核心,配合外围电路来组成的电梯自动控制系统。通过对各楼层的按键检测,按照程序设定的模式,发出对LED及数码管的调节,从而控制步进电机的运转来带动电梯模型来实现电梯的上下行。
本文主要介绍电梯自动控制系统的关键技术点,系统需求分析,系统的设计与实现,详细的说明了本系统的组成原理及工作原理。
关键词:单片机,步进电机,自动控制
Design and Implementation of Automatic Control System of Elevator Based on MCU
Abstract
In modern society, Elevator vertical transportation has become essential to human transport. But lots of elevators are still straight up and down.It could’t be the quickest to reach the selected floor, so inconvenient and a waste of resources.
In order to improve the elevator operation mode, this design uses 89C51 microcontroller as the core, the automatic control system of the elevator with the external circuit to form. The floor buttons detection, in accordance with the procedures set out in the model, and digital tube LED regulation, so as to control the stepper motor operation to drive the elevator model to realize the up and down the elevator.
This article describes the elevator key technical points of the automatic control system, system requirements analysis, system design and implementation, detailed description of the principle of the system components and working principle.
Key words: Single Chip Microcomputer, Stepper Motor, Auto-control
摘 要……………………………………………………………………………………………………………………… I
Abstract…………………………………………………………………………………………………………. II
第1章 绪 论………………………………………………………………………………………………….. 1
1.1 课题研究背景与意义…………………………………………………………………………………….. 1
1.2 课题研究内容与方法…………………………………………………………………………………….. 1
1.3 课题研究现状…………………………………………………………………………………………………. 1
第2章 关键技术介绍………………………………………………………………………………… 3
2.1 28BYJ-48步进电机的使用…………………………………………………………………………….. 3
2.2 数码管的显示…………………………………………………………………………………………………. 4
2.3 键盘接口技术…………………………………………………………………………………………………. 5
第3章 系统需求分析………………………………………………………………………………… 7
3.1 系统设计目标…………………………………………………………………………………………………. 7
3.2 系统功能需求…………………………………………………………………………………………………. 7
3.3 系统开发环境…………………………………………………………………………………………………. 8
3.4 系统可行性分析…………………………………………………………………………………………….. 8
3.4.1 技术可行性……………………………………………………………………………………………….. 8
3.4.2 经济可行性……………………………………………………………………………………………….. 8
第4章 系统设计………………………………………………………………………………………….. 9
4.1 系统设计指导原则…………………………………………………………………………………………. 9
4.1.1先进性……………………………………………………………………………………………………….. 9
4.1.2可靠性及安全性…………………………………………………………………………………………. 9
4.2 体系结构设计…………………………………………………………………………………………………. 9
4.3 硬件设计………………………………………………………………………………………………………….. 9
4.3.1 STC89C52RC 单片机…………………………………………………………………………………. 9
4.3.2电机模块设计…………………………………………………………………………………………… 11
4.3.3显示模块设计…………………………………………………………………………………………… 13
4.3.4按键模块设计…………………………………………………………………………………………… 14
4.3.4 LED灯电路设计……………………………………………………………………………………….. 14
4.3.5蜂鸣器电路设计……………………………………………………………………………………….. 15
4.4 软件设计………………………………………………………………………………………………………… 15
4.4.1 主流程设计……………………………………………………………………………………………… 15
4.4.2 按键查询设计………………………………………………………………………………………….. 16
第5章 系统实现………………………………………………………………………………………… 18
5.1环境配置………………………………………………………………………………………………………… 18
5.2功能模块实现………………………………………………………………………………………………… 18
5.2.1楼层择优选择的实现………………………………………………………………………………… 18
5.2.2电机模块实现…………………………………………………………………………………………… 19
第6章 系统测试………………………………………………………………………………………… 21
6.1 测试概述………………………………………………………………………………………………………… 21
6.2 测试用例………………………………………………………………………………………………………… 21
6.2.1 步进电机的运转时间……………………………………………………………………………….. 21
6.2.2 按键测试…………………………………………………………………………………………………. 22
第7章 结 论……………………………………………………………………………………………… 23
参考文献……………………………………………………………………………………………………………. 24
致 谢…………………………………………………………………………………………………………………… 25
附录A…………………………………………………………………………………………………………………. 26