成都理工大学工程技术学院毕业论文
火灾自动报警系统设计
作者姓名:徐 何 爱
专业名称:电子信息科学与技术
指导教师:石 坚 讲师
火灾自动报警系统设计
摘要
随着“信息时代”的到来,作为获取信息的手段——传感器技术得到了显著的进步,其应用领域越来越广泛,对其要求越来越高,需求越来越迫切。传感器技术已成为衡量一个国家科学技术发展水平的重要标志之一。因此,了解并掌握各类传感器的基本结构、工作原理及特性是非常重要的。
为了提高对传感器的认识和了解,尤其是对烟雾传感器的深入研究以及其用法与用途,基于实用、广泛和典型的原则而设计了本系统。本文利用单片机结合传感器技术而开发设计了这一烟雾监控系统。
本论文以电阻式烟雾传感器和单片机技术为核心并与其他电子技术相结合,设计出一种技术水平较好的烟雾报警器。其中选用MQ-2型半导体可燃气体敏感元件烟雾传感器实现烟雾的检测,具有灵敏度高、响应快、抗干扰能力强等优点,而且价格低廉,使用寿命长。选用的AT89S52单片机,其整合了A/D转换、硬件乘法器、硬件脉宽调制器等资源,具有高速、低功耗、超强抗干扰等优点,是目前同类技术中性价比较高的产品。
以AT89S52单片机和MQ-2型半导体电阻式烟雾传感器为核心设计的烟雾报警器可实现报警、故障自诊断、浓度级别显示、报警限设置、温度显示及与温度报警值设定等功能。是一种结构简单、性能稳定、使用方便、价格低廉、智能化的烟雾报警器。具有一定的实用价值。
关键词:烟雾 报警器 AT89S52
I
火灾自动报警系统设计
Abstract
With the arrival of the \technology has been significant progress, its application field is more and more widely, the requirement is more and more high, demand more and more urgent. The sensor technology has become one of the important sign of weighing a national science and technology development level. Therefore, understanding and it is very important to master all kinds of sensor's structure, working principle and characteristics.
In order to improve the awareness and understanding of the sensor, especially for the smoke sensor research and its usage and the use, utility, extensive and typical principles on the design of the system. In this paper, with the sensor technology development and design of the smoke control system using single chip microcomputer.
In this thesis, resistance type smoke sensor and single-chip microcomputer as the core technology and electronic technology, design technology level is good smoke alarm. Choose which detect the smoke of MQ-2 type semiconductor gas sensitive element smoke sensor, has the advantages of high sensitivity, fast response, strong anti-interference ability, and the price is low, the service life is long. The selection of AT89S52 microcontroller, which integrates A/D conversion, hardware multiplier, hardware resources such as pulse width modulator, has high speed, low power, strong anti-jamming and other advantages, is similar in cost-effective high technology products.
Based on AT89S52 microcontroller and MQ-2 type semiconductor resistance type smoke sensor as the core design of the smoke alarm can alarm, fault self diagnosis, concentration level display, alarm limit setting, temperature display and temperature alarm value setting and other functions. The smoke alarm is a simple structure, stable performance, convenient operation, low price, intelligent. It has certain practical value.
Keywords: smog alarm AT89S52
II
火灾自动报警系统设计
目录
摘要 ................................................................................................................................................................ I Abstract ...................................................................................................................................................... II 目录 ............................................................................................................................................................. III 1 绪论 ........................................................................................................................................................... 1
1.1论文研究来源 ................................................................................................................................. 1 1.2烟雾报警器的国内外现状 ............................................................................................................. 1 1.3本论文主要任务 ............................................................................................................................. 1
1.3.1基本部分 .............................................................................................................................. 1 1.3.2扩展部分 .............................................................................................................................. 2
2烟雾检测报警器的方案设计 .................................................................................................................... 3
2.1烟雾检测报警器设计思路 ............................................................................................................. 3 2.2烟雾传感器的选型 ......................................................................................................................... 3
2.2.1烟雾传感器介绍 .................................................................................................................. 3 2.2.2烟雾传感器的选定 .............................................................................................................. 4 2.2.3 MQ-2型烟雾传感器的工作原理 ....................................................................................... 4 2.2.4 MQ-2型传感器的特性及主要技术指标 ........................................................................... 5 2.3烟雾检测报警器整体设计方案 ..................................................................................................... 5
2.3.1烟雾检测报警器工作原理 .................................................................................................. 5 2.3.2烟雾检测报警器的结构 ...................................................................................................... 5 2.3.3烟雾检测报警器的功能 ...................................................................................................... 6 2.3.4烟雾检测报警器的主要技术指标 ...................................................................................... 7 2.4本章小结 ......................................................................................................................................... 7 3 系统设计 ................................................................................................................................................... 8
3.1系统功能 ......................................................................................................................................... 8 3.2单片机的介绍 ................................................................................................................................. 8 3.3 DS18B20的介绍 .......................................................................................................................... 10
3.3.1 DS18B20的简单介绍 ....................................................................................................... 10 3.3.2 DS18B20温度传感器与单片机的接口电路 ................................................................... 12 3.3.3 DS18B20的控制方法 ....................................................................................................... 12 3.3.4 DS18B20的复位时序 ....................................................................................................... 13 3.3.5 DS18B20的读时序 ........................................................................................................... 13 3.3.6 DS18B20的写时序 ........................................................................................................... 14 3.4 LCD显示器 .................................................................................................................................. 14
3.4.1 LCD主要技术参数 ........................................................................................................... 14 3.4.2 1602LCD的基本参数及引脚功能 ................................................................................... 15 3.4.3引脚功能说明 .................................................................................................................... 15
4.硬件设计 ................................................................................................................................................. 17
4.1 DS18B20测温电路 ...................................................................................................................... 17 4.2报警电路 ....................................................................................................................................... 17 4.3 LCD显示器显示电路 .................................................................................................................. 17 4.4报警温度设定按键电路 ............................................................................................................... 18
III
火灾自动报警系统设计
4.5烟雾传感器转换电路 ................................................................................................................... 19 5. 软件设计 ............................................................................................................................................. 20
5.1主程序设计及流程图 ................................................................................................................... 20 5.2主程序初始化流程图 ................................................................................................................... 21 5.3中位值平均滤波法数字滤波子程序设计及流程图 ................................................................... 21 5.4插值法线性化处理子程序设计及流程图 ................................................................................... 22 5.5烟雾浓度显示子程序设计及流程图 ........................................................................................... 24 5.6报警子程序设计及流程图 ........................................................................................................... 24 5.7控制按键设计子程序及流程图 ................................................................................................... 25 5.8本章小结 ....................................................................................................................................... 25 结 论 ........................................................................................................................................................... 26 参考文献 ..................................................................................................................................................... 27 附录 ............................................................................................................................................................. 28
附录一 程序源代码: ....................................................................................................................... 28 附录二 电路图 ................................................................................................................................... 41
IV