供热网计量管理及控制系统设计
摘 要 我国城市供热计量方式十分落后,长期以来实行“包烧制”,采用按建筑面积进行热量结算,造成能源的浪费。对于我国这样一个资源紧张的国家,供热计量收费已势在必行。本设计是一个以ATMEL89C51单片机为核心的热量计量系统,通过传感器采集的进水温度,出水温度,累计流量计算出实际热量。温度传感器采用单总线式温度传感器DS18B20。计时采用独立的串行时钟芯片DS1302,并能对具有特殊意义的时间点进行记录,如开阀日期、掉电日期。本系统采用IC卡进行管理,IC卡和单片机之间进行交换的信息被存储在E²PROM—X25045内。显示部分采用LCD液晶显示器,并且采用24键键盘作为用户的简单信息输入。 本设计还包含一个利用Visual Basic编程的数据库,用以实现信息添加、更新、删除、查找等简单操作,作为本设计的辅助部分。 关键词:热量计量;单片机;数据库;温度采集 ABSTRACT The metering method of urban heating of our country is very backward, implement " wrapping up and firing " for a long time, adopt and carry on heat to calculate according to the floor area, cause the waste of the energy. To the in short country of a resource such as our country, it has been already imperative that the heating measured and charged. It is that a heat taking ATMEI 89C51 one-chip computer as the core measures the system , enter water temperature through what the sensor is gathered to originally design, surface temperature, flow totally calculates out actual heat. The temperature sensor adopts single bus type temperature sensor DS18B20. Time and adopt the independent serial clock chip DS1302, and can carry on the record to some of time with special significance , such as opening valve date, losing electric date. This system adopts the IC card to manage, the IC card and information which the one-chip computers exchange are stored in E² In PROM-X25045. Show that adopts LCD liquid crystal display partly, and adopt 24 key keyboards to input as users' simple information. Originally design and still include a database which utilizes Visual Basic programming , is used to realize information is added , upgraded , deleted , found out etc. and operated briefly, as the auxiliary part that is originally designed. Key words:the calories calculate;singlechip;database;the temperature collect 目 录 第1章 绪论 1 1.1 我国供热计量管理现状 1 1.2设计内容概述 2 第2章 硬件电路设计 3 2.1系统原理图 3 2.2系统功能简述 3 2.3芯片简介及电路设计 4 2.3.1 ATMEL 89C51 4 2.3.2时钟电路 8 2.3.3存储器电路 10 2.3.4传感器采集电路 13 2.3.5液晶显示电路 14 2.3.6键盘电路 15 2.3.7中断扩展电路 17 2.3.8自锁电路 17 2.4本章小结 17 第3章程序设计 18 3.1 温度采集模块 19 3.1.1 DS18B20 与主机之间的通信协议 19 3.1.2温度采集模块程序流程图 21 3.2存储器数据交换模块 23 3.2.1 X25045 的操作时序 23 3.2.2 X25045的读写程序流程图 25 3.3系统时间模块 25 3.3.1 DS1302与主CPU的通信协议 25 3.3.2读写系统时间程序流程图 28 3.4 键盘操作模块 28 3.4.1HD7279A的指令系统 28 3.4.2串行接口的时序关系 30 3.4.3按键功能分配 31 3.5液晶显示器模块 32 3.5.1LCD与主CPU的通信协议 32 3.5.2显示程序流程图 34 3.6中断模块 34 3.7电机控制模块 35 3.8热量及余额计算模块 36 3.9总程序框图 37 3.10本章小结 38 第四章 用户热量管理数据库 40 4.1MICROSOFT ACCESS 和VISUAL BASIC6.0简介 40 4.2数据库功能和数据库结构 41 4.2.1数据库功能 41 4.2.2数据库的结构。 41 4.3数据库实现及程序 42 4.3.1利用Microsoft Access建立数据库 42 4.3.2利用Visual Basic6.0建立数据库应用程序 44 4.3.2.1建立窗体 44 4.3.3.2对记录集的操作 45 4.4本章小结 48 结论 49 参考文献 51 致谢 52 第1章 绪论 1.1 我国供热计量管理现状 自建国以来我国城市供热计量方式一直十分落后,供热企业与热用户根本没有计量仪表,按传统的落后的根据建筑面积进行热量结算收费。此种计算方法既不科学又不合理。现在,全国城市集中供热面积达8.6亿多平方米,已形成一定的规模,因此,城市供热不实行计量,就会造成能源浪费,投资增多,供热企业技术与管理水平差,供热效果不好。 城市居民住房改革成功,为供热计量收费改革创造了十分有利的条件,住房使用权和所有权归个人所有,其附属设施水、电、气早已按供需双方直接交易计量收费,唯有供热还保留着福利“包烧制”按面积收费,已经到了非改不可的程度。 建设部《建筑节能“九.五”计划和2010年规划》的发展目标中明确指出:“对集中供暖的民用建筑安设热表及有关调节设备并按表计量收费的工作,1998年通过试点取得成效,开始推广;2000年在重点城市成片推行;2010年基本完成”。对中国来说,供暖计量收费势在必行。 |