【编者按】:网学网自动化专业为您提供基于网络的远程温度检测系统设计参考,解决您在基于网络的远程温度检测系统设计学习中工作中的难题,参考学习。
论文编号:ZD1162 论文字数:26834,页数:57 附任务书,开题报告,文献综述,外文翻译
基于网络的远程温度检测系统设计
摘要
远程温度检测系统是一种不需人员到达现场就能完成远程温度监控的系统,它可以有效地解决传统人工检测存在的诸如效率低、成本高、错误率高的问题。
远程温度检测系统中最重要的部分就是数据传输方法的选择,根据现有的几种数据传输方法的优缺点,本文提出了一种基于以太网传输数据的远程温度检测系统方案。以太网具有不需单独布线,兼容性强,技术支持广泛的优点,采用以太网作为传输方法的远程温度检测系统有良好的发展前景。而且随着网络应用的普及,本方案只需要经过小量修改,则可应用到其他网络通信设计。具有较强的示范意义。
本系统分为三大模块,分别为数据采集模块,数据传输模块和上位机软件。数据采集模块通过8 位单片机ATmega32采集温度数据,将其储存到外围串行EEPROM中,防止意外断电造成数据丢失。数据传输模块分为以太网接口和ATmega32上的TCP/IP协议栈两部分。以太网接口硬件部分主要由ATmega32,以太网卡芯片Enc28j60组成,由于8 位单片机资源有限,ATmega32上的TCP / IP 协议栈只包含ARP,ICMP, IP, TCP 和UDP 协议,并且根据本系统需要实现的功能,这些协议经过了相应简化,例如,在ICMP 协议中仅实现了Ping 应答功能;在护协议中去掉了路由和数据报分片功能,仅实现数据报的发送和接收;在TCP 协议简化了状态机,滑动窗口和定时重传机制,减少了连接数。上位机软件利用VC++ 的SOCKET编程实现,具有测试连接,显示即时数据的功能。经过测试,本系统可以实现实时显示数据,与上位机进行通信,以及在上位机上实时查询数据的基本功能。
关键词:远程温度检测系统,以太网,TCP/IP协议
Abstract
The remote temperature reading system is a new mode in which temperature data can be read without people on the spot. It can effectively solve the problems such as low efficiency ,high cost and high error rate.
The data transmission is the most important part in a remote temperature reading system ,based on advantages and disadvantages of current data transmission methods, a remote temperature reading system in which data is transmitted based on Ethernet is presented. For Ethernet technology has many advantages such as good compatibility、 extensive technical support ,and the research in this field is significative.
This system consists of three main modules : data collection module.data transmission module and software on the computer. In data collection module, the 8-bit MCU ATmega32 is used to collect data and stored in EEPROM to avoid data lost cased by accidental power off.
the data transmission module consists of the Ethernet interface and simple TCP/IP protocol stack on ATmega32.The hardware part of the Ethernet interface is made up of ATmega32, Ethernet controller Enc28j60. For the limited resource of 8-bit MCU, TCP/IP protocol stack on ATmega32 only has protocols including ARP, ICMP, IP, TCP and UDP. In addition, these protocols are simple according to the functions this system need to have. In ICMP protocol, only Ping function is reserved. In IP protocol, the routing and packet segment function is cancelled, only packet send and receive function is reserved. In TCP protocol, the state machine, slip window mechanism and timing to retransmit mechanism are simple, and the number of connection is reduced. Software on the computer is realized in the environment of VC++, it has functions including connection test and instant data display. The testing result shows that this system has basic functions of temperature reading and data transmission.
Keywords: remote temperature reading system; Ethernet; TCP/IP protocols
摘要 I
Abstract II
1 引言 1
2 网络开发环境介绍 2
2.1控制芯片ATmega32 2
2.2 网络芯片Enc28j60 3
2.3开发软件 6
3 TCP/IP协议的简介与分析 7
3.1 TCP/IP协议及实现原理 7
3.2以太网协议分析 10
3.3本章小结 18
4 TCP/IP协议的实现 19
4.1单片机下TCP/IP协议栈中协议的选择 19
4.2 ARP协议的实现 20
4.3 IP协议的实现 22
4.4 ICMP协议的实现 25
4.5 UDP协议的实现 27
4.6 TCP协议的实现 30
4.7本章小结 33
5 实际应用——温度远程检测系统 34
5.1温度传感器DS18B20 34
5.2 远程温度监控系统的设计 37
5.3 监控系统实现情况 46
6总结 51
致谢 52
参考文献 53