基于AT89C51的远程抄表系统设计
摘 要
介绍了一种崭新的以AT89C51单片机为核心器件,结合外部元件设计的远程抄表系统设计方案。并介绍了具备远程数据采集功能和数据通信功能的系统的硬件设计和软件设计。经投入使用,表明该系统的各种功能都能达到预期效果,效果较好。另外还进行了抗干扰分析,并从硬件和软件上进行了抗干扰设计,对印制电路板的电磁兼容问题给了一些相应的解决措施,并在ansoft中进行了性能仿真。从而使系统抗干扰性能有了明显的提高。该课题对电力系统中电能管理有一定的适用价值,同样还可以推广到其他相关的一些行业,有较高的社会推广价值。本文对整个抄表系统进行了较为全面的设计,着重对系统底层的能耗数据的采集和集中、数据通信网络和通信方式等做了较为详细的设计。在硬件上对CPU数据存储及其监控电路、数据传输、通信标准、时钟电路、串口扩展、电能采集和显示电路都做了详细的论述。并且广泛应用的RS-485电气接口的串行通讯技术作为通讯方式。在软件上对数据进行采集、通信、显示子程序、校验子程序等做了详细的说明。该远程抄表系统实现了多用户的电能信息的远程自动抄表,能够实现住宅能耗计量的高质量和高效率管理。
关键词: 远程抄表; AT89C51单片机; RS 2485
精选文档
Design of remote meter reading system based
on AT89C51
Abstract
Using AT89C51 single-chip microcomputer as the core device, combined with external components , the design of a remote meter reading system is presented in this paper. The hardware and software systems which possess the remote data collecting and date communication functions are also designed in this paper. The system has been used in practice, The results show that the various features of the system achieved the desired results and good effects. In addition, anti-interruption performance and adopt according the precaution based on the hardware and the software, to improve the system's reliability. Give some
methods to solve the EMI/EMC problem of the printed circuit. Emulate the EMI/EMC performance of the printed circuit in the ansoft software. Generally, the study on the topic will develop a high level on the electrical power system management. And it is very worthy of generalization and application. The article gives an all-round design of this system. It expatiates on detail designs of data capturing and collecting, data communication network and mode. In this thesis, about the hardware, a particular explanation of the choice of CPU、inspect circuit、data memory etc were given. And it uses asynchronous serial communication technology based on RS-485 electric interface as communication means. The software, we give the program of impulse collection、communication、display and so on. This Long-distance meter reading system realizes the multi-user power information remote automatic transcribing, can realize residential energy consumption of high quality and high efficiency metrology management.
精选文档
Key words : remote meter reading ; AT89C51 single-chip microcomputer ; RS2485
精选文档
1. 绪论 ............................................................................................................................................................ 1
1.1 远程抄表系统的国内外概况 .......................................................................................................... 1
1.1.1 上层星型通信方案 ............................................................................................................... 2 1.1.2 底层总线型通信 ................................................................................................................... 3 1.2本课题研究的背景,目的和意义 ................................................................................................... 5 1.3 远程抄表系统 .................................................................................................................................. 6
1.3.1 抄表系统的选型及其特点 ................................................................................................... 6 1.3.2 远程抄表系统构成 ............................................................................................................... 6 1.4 本文所做的工作 ............................................................................................................................ 7 2. 抄表系统的模块功能设计 ........................................................................................................................ 8
2.1 抄表系统的整体结构 ...................................................................................................................... 8 2.2 抄表系统的各功能模块设计 .......................................................................................................... 9
2.2.1 CPU的选型 ........................................................................................................................... 9 2.2.2 外围存储及其监控电路模块 ............................................................................................. 11 2.2.3 数据的上传模块 ................................................................................................................. 15 2.2.4 时钟模块 ............................................................................................................................. 19 2.2.5 电能的采集和计数模块 ..................................................................................................... 21 2.2.6 显示电路 ............................................................................................................................. 23 2.3 本章小结 ........................................................................................................................................ 24 3. 抄表系统的软件设计 .............................................................................................................................. 25
3.1 软件设计要求 ................................................................................................................................ 25
3.3.1 易理解性,易维护性 ......................................................................................................... 25 3.1.2 实时性能 ............................................................................................................................. 26 3.1.3 可测试性 ............................................................................................................................. 26 3.1.4 准确性 ................................................................................................................................. 26 3.1.5 可靠性 ................................................................................................................................. 26 3.2 主程序的软件设计 ........................................................................................................................ 27 3.3 子程序设计 .................................................................................................................................... 27
精选文档
3.3.1 清零子程序的设计 ............................................................................................................. 29 3.3.2 接受数据与通信的程序设计 ............................................................................................. 29 3.3.3 数据采集子程序 ................................................................................................................. 30 3.3.4 脉冲采集程序 ..................................................................................................................... 31 3.3.5 显示子程序 ......................................................................................................................... 32 3.3.6 校验子程序 ......................................................................................................................... 33 3.3.7 数据传送子程序 ................................................................................................................. 34 3.4 硬件电路驱动 ................................................................................................................................ 36
3.4.1 数据存储芯片 X5405 ........................................................................................................ 36 3.4.2 时钟芯片 DS1302 .............................................................................................................. 36 3.4.3 数据上传 MAX232芯片 ................................................................................................... 36
结论 ............................................................................................................................................................... 37
致谢 ............................................................................................................................................................... 38 参考文献 ....................................................................................................................................................... 39
精选文档
基于AT89C51的远程抄表系统设计



