1、 I 摘 要 本文介绍一种基于单片机的火灾报警系统设计实例。 分别说明了系统的硬件电路 设计、软件设计、系统的通讯方式及软件的设计思想。该系统具有误报率低、性能稳 定、传输距离远、实用性强等特点。同国外相比,国内在智能型火灾报警系统的研究 上还是有一定的差距的。 我国的智能型火灾报警系统还是存在诸如可靠性、 稳定性差: 探测器信号处理方法单一,智能化程度低:未能很好解决探测器灵敏度和误报率之间 矛盾等问题。基于火灾报警系统在国内外的的发展状况,这是一项迫切而有意义的设 计。 关键词:关键词:单片机 火灾报警 传感器 II Abstract It is a design of a fire al
2、arm system based on single chip.It shows the system hardware circuit design, software design, communication systems and the thoughts of software design Respectively. The system has low false positive, stable performance, transmission distance, practical and so on. Compared with other devoloped count
3、ries, domestic fire alarm system in the intelligent of research have some distance. Our intelligent fire alarm system still exist, such as reliability, poor stability: a single detector signal processing, low level of intelligence: not well resolved, and the false alarm rate detector sensitivity and
4、 other issues between the contradictions. B Based on the development of both domestically and internationally of the fire alarm system , this is an urgent and meaningful design. Keywords: Keywords: microcontroller, fire alarm, sensor. III 目 录 第 O 章 引言 . 1 第一章 方案论证 . 1 1.1 系统的主要技术参数 1 1.2 单片机的功能比较 1
5、1.3 方案的确定 1 第二章 前向通道的设计 2 2.1 检测元件的选择 2 2.1.1 温度传感器 . 2 2.1.2 TG202 烟雾传感器 . 3 2.2 A/D 转换 4 2.2.1 A/D 转换器的技术指标 . 4 2.2.2 ADC0816 介绍 . 4 第三章 单片机控制系统硬件设计 . 5 3.1 处理器 AT 89C51 介绍 . 5 3.1.1 AT89C51 的主要性能 . 5 3.1.2 AT89C51 硬件结构及引脚 . 6 3.2 时钟电路 8 3.2.1 内部时钟方式 . 8 3.2.2 外部时钟方式 9 3.3 复位电路 . 9 3.3.1 DS1232 的结
6、构 9 3.3.2 DS1232 的功能 . 10 3.4 AT89C51 单片机的系统扩展 11 3.4.1 程序存储器的扩展 11 3.4.2 数据存储器的扩展设计 12 第四章 人机通道配置及接口 14 4.1 键盘及显示接口 . 14 4. 2 显示器与显示电路 14 4.3 8155 的原理介绍 . 14 4.3.1 8155 的引脚及功能介绍 . 14 4.3.2 8155 的 RAM 和 I/O 口地址编码 . 16 4.3.3 8155 的工作方式与基本操作. 16 IV 4.3.4 8155 与单片机 AT89C51 的接口. 19 第五章 相互通道配置与接口技术 - 21 - 5.1 相互通道 . - 21 - 5.2 通讯接口.- 21 - 第六章 系统的软件设计 23 6.1 下位机系统软件设计 . 23 6.1.1 主程序设计 23 6.2 子程序模块设计 26 6.2.1 模数转换中断服务程序 26 6.2.2 键盘扫描子程序: 27 6.2.3 8155 动态显示程序设计 . 29 结束语 31 参考文献 32 - 1 - 概概 述述 第第0