您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > 基于单片机的电表抄表系统
1基于单片机的电表抄表系统摘要自动抄表是指采用通信和计算机网络等技术自动读取和处理表计数据。发展电能自动抄表技术是提高用电管理水平的需要,也是网络和单片机技术迅速发展的必然。采用自动抄表技术,不仅能节约人力资源,更重要的是可提高抄表的准确性,减少因估计或誊写而造成账单出错,使供用电管理部门能及时准确获得数据信息。本例中介绍的抄表方案可方便移植到煤气表、水表等各种智能抄表系统。本例抄表系统主要由主站端数据采集计算机、客户端基于单片机的抄表模块、计量电表三部分组成。客户终端单片机模块和数据采集计算机通过RS-485串行通信口连接,实现数据传输。本例中被测量的电表为威胜3型电表。本例主要介绍客户端基于单片机的电表抄表终端的设计和实现方案在设计本例抄表系统时,以上功能均需要满足,其中主要部分是供电方式设计、数据掉电保护。功能设计、终端抄表模块与数据采集计算机通信协议设计、实时时钟功能设计。其中终端单片机抄表模块主要功能如下:采用三相四线(3x220/380V)供电方式,在三相交流电压断一相或二相的条件下,交流电源能维持终端正常工作,并且系统具有备用电池供电功能;具有实时测量用户用电电量功能;具有掉电数据保护功能,能保存用户用电电量信息。支持DL/T—645电表通信规约。终端和数据采集计算机通过RS-485通信,终端和主站通信具备数据完整性认证机制以保。终端具有实时时钟功能,并且有对时功能。关键词:单片机;抄表系统;串行通信;目录摘要Abstract1绪论··········································································································31.1本课题的研究背景······················································································31.2电表抄表系统的国内外研究动态····································································11.3电表抄表系统的目的及意义··········································································32系统的总体设计···························································································52.1系统的组成·······························································································422.2电表抄表系统的功能说明及论文要求·······························································42.3电表抄表的关键问题····················································································53系统的电路设计····························································································63.1单片机简介·······························································································63.2技术方面具体体现·······················································································63.3RS-232和RS-485穿行通信设计···································································143.3.1串行通信的作用······················································································143.3.2技术方案·······························································································153.4通信协议设计··························································································153.4.1通信协议的作用······················································································153.4.2技术方案······························································································163.5抄表系统电路图······················································································194软件的实现·······························································································204.1串行通信的基础知识··················································································204.1.1串行通信的数据传输················································································204.1.2串行通信的数据转换················································································204.1.3串行通信协议·························································································224.2RS-232和RS-485串行通信设计···································································234.3系统通讯方式实现·····················································································264.4掉电数据保护的软件实现············································································274.5数传终端的软件实现··················································································274.5.1AT指令的调试························································································264.5.2程序的设计····························································································275结论·········································································································32参考文献附录致谢1基于单片机的电表抄表系统1绪论1.1本课题的研究背景目前,我国用户都是人工抄表。这种方式消耗了大量的人力、物力。因此,国家有关部门规定以后将逐步以计算机为基础的自动抄表系统取代传统的人工抄表,即实现远程集中自动抄表。[1]电能表远程抄表系统就是利用这种新型的智能化信息管理方式,设计为小区、公寓的智能化管理系统的子系统。但是由于各个厂家生产的电能表的差异性,所以该系统不可能支持目前市场上的所有电能表,目前只支持太原市特普高电子科技有限公司生产的“多用户多功能电能表”[2]1.2电表抄表系统的国内外研究动态由于电能计量和管理的需要以及电子技术的发展,使电子式电度表在20世纪70年代就已出现。随着数字电子技术的飞速进步,电子式电度表的功能逐渐增多并日臻完善。电子式电度表一般由电能测量机构和数据处理机构两部分组成,根据电能测量机构的不同,又分为机电脉冲式电度表和全电子式电度表两大类。机电脉冲式电度表沿用感应系电度表的测量机构,其数据处理机构则由电子电路和计算机控制系统实现,因而,机电脉冲式电度表是一种电子线路与机电转换单元相结合的半电子式电度表全电子式电度表是由又被称为“静止式电度表”或“固态电度表”。近年来,各种新型电子式电度表不断推出,型号各异乘法器完成对电功率的测量。由于它没有传统电度表上的旋转机构,因而功能众多,但其基本原理相需量计量和预付费等;保护功能,包括过电流、过电压保护与防窃电等;通信功能,可以是红外通同,主要功能可归为三个方面:计量、计费功能,包括分时计量、最大需量计量和预付费等;保护功能,包括过电流、过电压保护与防窃电等;通信功能,可以是红外通信、无线电通信或载波通信等。常见的自动抄表通信方式:(1)按信道介质分,常见的自动抄表通信有载波通信,电话线通信和无线三种方式。a、光纤通信具有频带宽、传输速率高、传输距离远和抗干扰能力强等特点,非常适合上层通信网的要求。随着光纤技术的发展和广泛应用,自动抄表系统中将更多地使用光纤。b、由于电话在城镇的迅速普及,利用现有电话网进行数据通信是一个经济有效的方案。利用电话网通信,只需在数据集中器和工作主站处加装调制解调器即可,其传输速率可达56Kbps。但电话线通信的线路接通时间较长,一般要几秒到十几秒。而且,我国的部分乡村、小城镇还没普及电话c、对于分布分散的集中器,利用无线方式进行数据通信是一种较好的选择。目前4我国已有车载无线通信自动抄表系统投入运行。但无线通信方式需要慎重选择频点,并需申请频点使用权。[3](2)若按连接方式分,则自动抄表系统的通信方式主要有星型和总线型连接方式。a、星型连接通信是以工作主站为中心,以星型发散的形式分别通过通信信道与分散于各地的集中器连接,形成1对N的连接形式。这种方式下信道通信数据量大,要求有一定的传输速率和频宽。b、总线型通信以一条串行总线连接各分散的采集器或电度表,实行各节点的互连。这种方式下信道上节点多,传输速率也不会很高,一般用于底层的电能数据的采集。常见的有RS-485总线网和低压电力线载波通信网。由于电力线完全由电力部门控制,如果用电力线实施载波通信,不需要再投资铺设通信线路,不仅可大大节约资金投入,且还具有维护量小的特点;而且,用低压电力线作通信信道可以实现灵活的“即插即用”。尤其是近年来扩频通信技术的成功应用,使得低压电力线载波通信越来越多地用于自
本文标题:基于单片机的电表抄表系统
链接地址:https://www.777doc.com/doc-6112220 .html