共 72 页第1 页 毕业设计任务书 一、设计题目:烟雾报警器设计 二、设计目的 设计一个由单片机控制的烟雾报警器,可以对房间的烟雾浓度进行检测,如果超过设定浓度,可以进行声、光报警。通过设计,掌握数据采集系统的工作原理、掌握计算机控制系统的设计原理、设计步骤,进一步提高综合运用知识的能力。 三、设计容和要求 (1)选择传感器,设计接口电路,要求烟雾浓度的围。 (2)设计声光报警电路,要求达到设定浓度就进行报警。 (3)烟雾报警器的信号采集模块设计; 烟雾报警器的报警模块设计;烟雾报警器的软件设计。 四、设计工作任务进度 第一周:查阅资料、调研、确立设计方案;选择器件。 第二周:系统总体方案和硬件的设计。 第三周:系统软件的设计,并加以完善整个设计。 第四周:修改整个设计,最后进行答辩。 共 72 页第2 页
摘要 随着社会和经济的发展,防火工作越来越重要,但是目前国的许多研发都侧重于大型场所的火灾报警。因此,我们就有必要研制一种结构简单、经济实用的家庭烟雾报警器以适应市场的需求。基于供家庭使用的烟雾报警器应该具备的基本要求和功能,文章设计了一种比较适合的烟雾报警器。 本设计以传感器和单片机作为烟雾报警器设计的核心器件,配合其它器件即可实现声光报警、自动排烟换气和消防灭火等功能。设计中单片机选用AT89C51作为控制器件,传感器选用QM-N5型气体传感器实现对烟雾的检测。烟雾报警器主要由烟雾信号采集及前置放大电路、模数转换电路、单片机控制电路、显示电路、声光报警电路和安全保护电路构成,设计合理、简单易懂、价格低廉,使单片机在烟雾报警系统的控制中得到充分应用,具有一定的实用价值。论文主要针对烟雾报警系统中的各个组成部分及功能进行了详细的介绍和说明,并对其主控电路和外围设备电路之间的接口连接方式,以及系统软件设计进行了重点的分析和讲解。 关键词:烟雾报警器;单片机;传感器 共 72 页第3 页
Abstract With the development of social and economic,the prevention of fire are more and more important.However, in the present, most of research and development of fire alarm systems only focus on large sites. Therefore, it is necessary to design a simple, economical and practical family Smoke Alarm to meet the market demand. Taking both the basic requirement and the function of family Smoke Alarms should have into account, thesis designs a suitable smoke alarm for household using. Which the sensor and the microcontroller of the design is the most important part of alarm devices, with other devices can achieve alarming with sound and light, automatically reducing smoke and fighting fire ,etc. IN design, microcontroller used AT89C51 and select QM-N5 Gas Sensor to detect smoke. Smoke alarm mainly by the signal acquired circuit, A/D converted circuit, 共 72 页第4 页
MCU controlled circuit,displayed circuit and alarming with sound and light circuit,reasonable design, simple structure, easy to use, inexpensive. As a result, the microcontroller in the control of the smoke alarm system is fully applied. Therefore, this design about smoke alarm has practical value. Thesis give detailed introduction for the function and theory of the various component parts of the alarm system, focus on the interface technology between its main controlled circuit and peripheral circuit, also give explanation of the software . Key words :Smoke Alarm;MCU; sensor
目 录 前言 ······················································ 3 第1章 报警器的概述 ······································ 4 1.1 设计烟雾报警器的目的及意义·························· 4 共 72 页第5 页
1.2 火灾报警器的现状及特点······························ 4 1.3 火灾报警器的发趋势································· 5 第2章 系统的总方案设计··································· 6 2.1 烟雾报警器的工作结构和原理·························· 6 2.2 烟雾传感器的选型···································· 7 2.2.1 烟雾传感器的介绍·································· 7 2.2.2 MQ-5半导体气体烟雾传感器·························10 2.3 单片机的选型········································· 11 2.3.1 AT89C51部结构及功能····························12 2.3.2 中断与定时系统··································· 14 2.3.3 单片机外围电路的扩展····························· 15 2.3.4 时钟电路和复位电路······························· 16 2.4 A/D转换器的选型····································18 2.5 显示器的选择······································· 21 2.6 放大器的选型······································· 22 2.7 烟雾报警器的主要功能设计··························· 22 第3章 系统的硬件设计····································· 24 3.1 系统电源电路········································ 24 3.2 AT89C51的时钟电路和复位电路························ 24 3.3 信号采集及前置放大电路······························ 25 3.4 A/D转换电路········································ 26 3.5 声音报警及消音键电路································ 27 共 72 页第6 页
3.6 字符显示电路········································ 27 3.7 状态指示电路········································ 28 3.8 安全保护电路········································ 28 3.9 报警故障自诊断电路···································29 3.10 烟雾报警器硬件总电路································ 29 第4章 系统的软件设计····································· 31 4.1 系统主程序设计及流程图······························ 31 4.2 主程序初始化流程图·································· 32 4.3 报警子程序设计及流程图······························ 32 4.4 按键输入设计子程序流程图···························· 34 附录 ······················································ 35 总结 ·······················································39 参考文献···················································40