摘 要
本文论述的基于单片机的电集中抄表是在感应式电能表的基础上将其改装成为具有自动抄表和远程数据传输的新型的抄表形式。基于这种技术,文中将详细地介绍该电集中抄表系统的可行性,市场前景,硬件设计,软件设计,以及调试方法等。整个系统包括抄表模块和数据传输模块两大部分电路。抄表模块完成的是脉冲转换,电流检测,报警和自动断电的功能。数据传输模块负责抄表系统与PC机控制中心的连接,实现控制中心对用电户进行同一抄表和统一收费的管理模式。应用该系统可以改变传统的抄表模式节省了人力,实现小区的智能化管理。文章的最后还总结了一些设计过程中遇到的问题以及解决方法。
关键词:AT89C51单片机;光电转换;电能表;防盗电;CAN总线
Abstract
This article elaborates copies the table based on the monolithic integrated circuit electricity centralism is re-equips into in the induction-type electrical energy table foundation it has copies automatically the table and the long range data transmission new copies the table form. Based on this kind of technology, in the article in detail introduced this electricity centralism copies the table system the feasibility, the market prospect, the hardware design, the software design, as well as debugging method and so on. The overall system including copies the table module and the data transmission module two major part electric circuits. Copies the table module to complete is the pulse transforms, the electric current examination, reports to the police with the automatic power failure function. The data transmission module copies the table system and the PC machine control center connection responsibly, the realization control center to uses electricity the household to carry on identical copies the table and the unification charge management pattern. Might change the tradition using this system to copy the table pattern to save the manpower, realized the plot intellectualized management. The article finally also summarized the question as well as the solution which in some design process meets.
Key word:AT89C51 monolithic integrated circuit;Photoelectricity transformation;
Electrical energy table;Security electricity;CAN main line
目 录
引言………………………………………………………………………………… 1
- 集中抄表系统的发展及概况……………………………………………… 1
1.1 电集中抄表系统…………………………………………………………………1
1.2国内外发展的概况………………………………………………………………2
1.3 住宅抄表自动化系统应用条件…………………………………………………3
2.方案论证与比较……………………………………………………………… 3
2.1抄表部分…………………………………………………………………………3
2.1.1方案1……………………………………………………………………………3
2.1.2方案2……………………………………………………………………………3
2.1.3方案3……………………………………………………………………………3
2.2数据传输部分……………………………………………………………………4
2.2.1方案1………………………………………………………………………… 4
2.2.2方案2………………………………………………………………………… 4
2.2.3方案3………………………………………………………………………… 4
2.3设计内容………………………………………………………………………… 4
2.4技术路线………………………………………………………………………… 5
2.5方案论证与比较…………………………………………………………………5
3.系统硬件设计………………………………………………………………… 5
3.1电能表模块电路设计……………………………………………………………5
3.1.1AT89C51介绍………………………………………………………………… 6
3.1.2固态继电器……………………………………………………………………9
3.1.3光电转换电路设计………………………………………………………… 11
3.1.4电流检测电路……………………………………………………………… 11
3.1.5单片机系统电路…………………………………………………………… 12
3.2 CAN总线接口电路的设计…………………………………………………… 13
3.2.1CAN总线概况…………………………………………………………………13
3.2.2SJA1000介绍…………………………………………………………………13
3.2.3与PCA82C200兼容性……………………………………………………… 16
3.2.4PCA82C250/251收发器………………………………………………………17
3.2.5RS-232标准 …………………………………………………………………18
3.2.6MAX232 芯片简介…………………………………………………………… 21
3.2.7CAN总线接口电路……………………………………………………………22
3.2.8硬件电路
3.2.8硬件电路…………………………………………………………………… 23
4.软件设计……………………………………………………………………… 24
4.1主程序设计流程图如图4.1所示………………………………………………25
4.2抄表模块软件设计………………………………………………………………25
4.3CAN总线程序设计………………………………………………………………27
4.3.1初始化程序流程图……………………………………………………………27
4.3.2接收程序流程图………………………………………………………………27
5.系统调试……………………………………………………………………… 28
5.1调试需要的工具……………………………………………………………… 28
5.2硬件调试……………………………………………………………………… 29
5.2.1电路通电前检查…………………………………………………………… 29
5.2.2电路通电观察……………………………………………………………… 29
5.2.3功能模块调试……………………………………………………………… 29
5.2.4系统连调…………………………………………………………………… 29
5.3软件调试……………………………………………………………………… 30
6.总结…………………………………………………………………………… 30
6.1技术优点及缺点……………………………………………………………… 30
6.2提高测量精度的几项措施…………………………………………………… 30
6.3问题及解决方法……………………………………………………………… 30
6.4测试结果……………………………………………………………………… 31
6.5系统使用说明………………………………………………………………… 31
谢辞……………………………………………………………………………… 32
参考文献………………………………………………………………………… 33
附录1系统原理图及PCB图………………………………………………………34
附录2 CAN总线下位机PCB图……………………………………………………34
附录3 系统PCB图…………………………………………………………………35
附录4抄表系统程序………………………………………………………………35
附录5 CAN总线上位机程序………………………………………………………40