宁夏大学新华学院 本科毕业设计
(2015届)
题目 基于ZigBee的温湿度传感器设计
系 别 信息与计算机科学系 专 业 电气工程及其自动化 年 级 2011级 学生学号 12011247112 学生姓名 刘培新 指导教师 刘大铭
2015 年 4月 23 日
0
摘 要
无线传感器网络(Wireless Sensor Network,WSN)是由大量无处不在的,具有通信与计算能力的微小传感器节点密集布设在无人值守的监控区域而构成的能够根据环境自主完成指定任务的“智能”自治测控网络系统。大量传感器节点通过相互之间的分工协作,可实时感知、监测和采集分布区域内的监测对象或周围环境的信息。无线传感器网络有着与传统网络明显不同的技术要求,前者以数据为中心,后者以传输数据为目的。随着传感器网络技术的逐步发展,它的应用也越来越广泛,无线传感器网络也被要求有更小功耗,更低成本,以及更方便使用的性能,在这种情况下,ZigBee技术应运而生。
ZigBee技术是一种短距离无线双向通信技术,该技术拥有协议简单、功耗低、组网能力强、网络容量大、时延短、安全、可靠及成本低等优点,具有路径选择、自动连结网络及自我恢复等功能。预计将在消费类电子设备、家庭智能化、工控、医用设备控制、农业自动化等领域获得广泛应用。
本文首先介绍了无线传感器网络的基础知识和研究现状;然后深入分析了ZigBee协议,给出了各层的功能;之后,设计了ZigBee节点模块和温湿度传感模块,并在此硬件基础上设计了具有基本功能的ZigBee协议栈,同时提出了一种基于ZigBee的组网算法,通过扫描信道、建立网络和建立节点间的关联三个步骤构建了一个简单的网络层,实现了无线传感器组网功能;在此基础上本文设计一个小型的温度湿度监控网络系统;最后,对论文进行总结,提出今后的研究工作方向。
关键字:ZigBee;温湿度传感器;无线通信;无线温湿度传感器系统
Abstract
Wireless sensor networks (Wireless Sensor Network, WSN) is composed of a large number of ubiquitous,tiny sensor nodes the monitored area unattended constituted able to complete the assigned tasks independently according to the environment \control network system. A large number of sensor nodes through the division of labor between them, real-time sensing, monitoring and gathering information on the distribution area of the object or the surrounding environment. Wireless sensor networks and traditional networks , cost, and performance is more convenient to use, in this case , ZigBee technology to be shipped born.
ZigBee technology is a short -range wireless two-way communication technology that , strong networking capabilities, network capacity, time is short , safe, reliable and low cost, with a path selection, automatic link networks and self-recovery capabilities. It is expected to be widely used in consumer electronic devices, intelligent , and other fields of agriculture. This paper introduces the basic knowledge and research of wireless sensor networks ; and in-depth analysis of the ZigBee protocol , given the function of each layer ; then designed ZigBee node module temperature and the basis of this ZigBee , by scanning channel , networking and the establishment of three steps associated nodes to build a simple network layer , to achieve a wireless sensor network function ; on this basis, we design a small temperature and
目 录
第1章 绪论 .............................................................................................. 4
1.1 引言 ................................................................................................ 4
.................................................................. 1.2 无线传感器网络的研究现状 2
.................................................................................. 1.2.1 国外现状 2
.................................................................................. 1.2.2 国内现状 3 ........................................................................ 1.3 无线传感器网络的特点 3 .......................................................................................... 1.4 研究内容 5 .......................................................................................... 1.5 论文结构 5 .......................................................................................... 1.6 本章小结 6
..................................................................... 第2章 ZigBee协议标准介绍 6
................................................................................. 2.1 ZigBee技术概述 6 ........................................................................ 2.1.1 ZigBee主要特性 6
.................................................................. 2.1.2 ZigBee网络拓扑结构 7
.................................................................. 2.1.3 ZigBee网络工作模式 8 ................................................................................. 2.2 ZigBee协议架构 8
2.2.1 物理层(PHY) .......................................................................... 9
............................................................. 2.2.2 媒体访问控制层(MAC) 11 2.2.3 网络层(NWK) ......................................................................... 13 .......................................................................... 2.2.4 ZigBee应用层 14
......................................................................................... 2.3 本章小结 16 ........................................... 第3章 ZigBee温湿度传感器硬件平台的设计 16
......................................................................................... 3.1 硬件设计 16
....................................................................... 3.1.1 CC2530芯片介绍 17 ........................................................................... 3.1.2 射频模块电路 20
......................................................................................... 3.2 主控电路 22
........................................................................... 3.2.1 串口通信电路 22
................................................................................. 3.2.2 电源模块 25 ................................................................................. 3.2.3 存储模块 26 ......................................................................................... 3.4 本章小结 28 ............................................ 第4章 无线传感器网络通信系统的软件设计 29
................................................................................... 4.1 系统总体构成 29
.......................................................................... 4.2 进行开发的软件介绍 29 ...................................................................................... 4.3 程序流程图 29
...................................................................................... 4.4 系统的实现 31
.......................................... 4.4.1 通过初始化、信道扫描等措施建立网络 31
............................................................... 4.4.2 传感器各节点加入网络 31
......................................................................................... 4.5 本章小结 32
................................................................................... 第5章 总结与展望 33 ................................................................................................... 参考文献 34
.......................................................................................................... 致谢 35 .......................................................................................................... 附录 36
第1章 绪论
1.1 引言
信息的生成、获取、存储、传输、处理及其应用是现代信息科学的六大组成部分,其中信息的获取是信息技术产业链上重要的环节之一,没有它就没有信息的传输、处理和应用,信息化也成为了无水之源、无本之木。随着现代微电子技术、微电机系统MEMS(Micro-Electro-Mechanism System),片上系统SOC(System-On-Chip)、纳米材料、无线通信技术、信号处理技术、计算机网络技术等的进步以及互联网的迅速发展,传统的传感器信息获取技术从独立的单一化模式向集成化、微型化,进而向智能化、网络化方向发展,成为信息获取最重要和最基本的技术之一。无线传感器网络是由大量无处不在的,具有通信与计算能力的微小传感器节点密集布设在无人值守的监控区域而构成的能够根据