毕业设计(论文)
题 目 基于单片机的智能火灾报警系统
姓 名 卢志祥
学 号 28100102029
专业班级 自动化08B(本)
所在学院 机电工程学院
指导教师(职称) 彭芳(讲师)
二○一二年5月5日
基于单片机的智能火灾报警系统
摘 要
随着科学技术的迅速发展,人们进入了信息时代,作为获取信息手段的传感器技术得到了显著的进步,其应用领域越来越广泛,对其要求越来越高,需求越来越迫切。随着电子产品在人类生活中的广泛使用,由此引起的火灾也越来越多,在我们生活的四周到处潜伏着火灾隐患。为了避免火灾以及减少火灾造成的损失,我们有必要完善火灾自动报警系统,并广泛应用在生活中,将火灾消灭在萌芽状态,最大限度地减少社会财富的损失。
本系统以电阻式烟雾传感器和温度传感器以及单片机技术为核心并与其他电子技术相结合,设计出一种技术水平较好的火灾报警器。其中选用MQ-2型半导体可燃气体敏感元件烟雾传感器实现烟雾的检测,具有灵敏度高、响应快、抗干扰能力强等优点,而且价格低廉,使用寿命长。选用DS18B20温度传感器作为温度检测。选用的AT89S52单片机,其整合了A/D转换、硬件乘法器、硬件脉宽调制器等资源,具有高速、低功耗、超强抗干扰等优点,是目前同类技术中性价比较高的产品。
以AT89S52单片机和MQ-2型半导体电阻式烟雾传感器以及DS18B20温度传感器为核心设计的火灾报警器可实现声光报警、数据显示、报警限设置功能。是一种结构相对较简单、性能较稳定的智能化烟雾报警器。
关键词:传感器;火灾报警;自动采集;自动报警;单片机
I
The System of Intelligent Fire Alarm
Based on SCM
Abstract
The rapid development of Science and technology leads people to the information era.The senior technology has got remarkable progress as a means of obtaining information. It’s application fields become more and more widely,and the requirement of it is becoming higher and higher,and the demand is urgent . As electronic products are widely used in human life, the resulting fire was also more and more.The fire potential safety problems lurk in our life around. In order to avoid the fire and reduce the loss caused by fire, it’s time for used to perfect the system of automatic fire alarm, and widely used it in our daily life, will the fire nipped in the time of bud.It can minimize the loss of wealth of society.
This paper designs a better level of fire alarm technology, using a widely used microcontroller technology and resistive smoke sensor and temperature sensor as the core,and with other electronic technology combined. Use the MQ-2 type semiconductor gas sensitive element smoke sensor to achieve smoke detection, which has high sensitivity, fast response, strong anti-interference ability,and the price is low, service life long. Use the DS18B20 temperature sensor for temperature detection. The selection of AT89S52 chip, which is a integration of the A / D conversion, hardware multiplier, hardware pulse width modulator and other resources,has high speed, low power, strong anti-interference and other advantages, is of similar technology neutral higher cost-effective products.
The smoke alarm, designs with AT89S52 MCU and MQ-2 type semiconductor resistor type smoke sensor and temperature sensor-DS18B20 as the core, can achieve the function that sound-light alarm, data display, alarm limit setting,is a intelligent smoke alarm that a kind of simple structure, stable performance.
Keyword:sensor; Fire alarm; Automatic acquisition; Automatic alarm; Single-chip microcomputer
II
目 录
1 绪 论 .................................................................... 1 1.1 报警器论文研究背景 .................................................... 1 1.2 本设计的应用及意义 .................................................... 1 1.3 论文主要工作 .......................................................... 1 2 系统方案设计 .............................................................. 2 2.1 系统总体规划 .......................................................... 2 2.2 单片机内部结构及接口描述 .............................................. 2 2.3 主要元件的选型 ........................................................ 4
2.3.1 AT89S52单片机 ................................................. 4 2.3.2 集成温度传感器DS18B20 ......................................... 5 2.3.3 气体传感器MQ-2 ................................................ 7 2.3.4 数码管驱动芯片74HC245 ......................................... 7 2.3.5 模数转换芯片ADC0832 ........................................... 8
3 系统硬件设计 .............................................................. 9 3.1 AT89S52复位电路 ...................................................... 9 3.2 温度传感器电路 ........................................................ 9 3.3 MQ-2烟雾感器电路 .................................................... 10 3.4 A/D转换ADC0832电路 ................................................. 10 3.5 报警器电路 ........................................................... 11 3.6 七段数码管显示电路 ................................................... 11 3.7 状态指示灯、控制键电路 ............................................... 12 4 系统软件设计 ............................................................. 13 4.1 主函数的程序 ......................................................... 13 4.2 中断服务的程序 ....................................................... 14 4.3 数据处理的程序 ....................................................... 14 4.4 数据显示的程序 ....................................................... 15 4.5 报警的程序 ........................................................... 16 4.6 报警值设置的程序 ..................................................... 18 4.7 精确值显示的程序 ..................................................... 19 5 系统程序调试 ............................................................. 22 5.1调试的步骤 ........................................................... 22 5.2调试过程中遇到的问题及解决方法 ....................................... 22 6 总结与展望 ............................................................... 24 参考文献 ................................................................... 25
III
附录 ....................................................................... 26 附录1报警器仿真图 ....................................................... 26 附录2 报警器实物图 ...................................................... 26 附录3 报警器元件清单 .................................................... 27 附录4 系统程序代码 ...................................................... 27 致 谢 ..................................................................... 42
IV