摘要随着我国科技水平和综合国力的大力提高,水力资源在国民经济建设中体现出其越来越重要的地位,我国对水利工程建设上也加大了投资力度,合理充分地利用水力资源显得越来越重要,水闸作为水利资源调动中不可缺少的一个重要部分,水闸的自动化改造的重要性就显得尤为突出。
基于单片机的闸门控制系统中PC机通过上位机控制14个闸门,每个闸门由一个下位机控制,上位机和下位机通过RS485总线通信。
下位机AT89S52单片机中选择超声波水位传感器T40、R40测量水位,闸位传感器ROQ425测量闸位,传感器芯片ADXL250测量加速度,来判断闸门卡滞、飞车和下滑,检测信号进行处理后送入下位机,经下位机处理分析后存储显示并输出控制信号来控制电机正反转,从而改变水闸的开度以精确控制水闸。
当出现异常现象时喇叭及LED灯发光二极管形成声光报警,应用HD7279A将键盘及显示电路连接在一起,时钟芯片采用PCF8563,存储芯片采用FM24C16,电源电路设计保证了该监控终端既能由AC220V供电,亦可由电池作为供电电源。
上位机采用有两个通信口的单片机W77E58,分别连接下位机和PC机,扬声器及LED灯组成上位机声光报警电路。
中小水电站的闸门控制系统是应用先进技术,配置计算机监控装置,来提升中、小水电站现代化水平,确保水电站的效益和安全,提高水电站自动化程度和经济效益,提高对电网的响应速度和安全生产水平,增加其运行的可靠性与稳定性。
关键词:单片机;数据采集;水闸控制系统;数据通信AbstractAlong with the science and technology level and improve the comprehensive national strength, reflects its in the construction of hydropower resources in the national economy more and more important position, also for water conservancy engineering construction in our country increased investment, reasonable make full use of water resources is more and more important, locks as water resource to mobilize an indispensable an important part, the importance of the floodgate automation transformation is particularly outstanding.Gate control system based on single chip microcomputer in 14 PC by PC control gate, each gate is controlled by a lower place machine and superordination machine and lower machine through the RS485 bus communication under a AT89S52 single chip select ultrasonic water level sensor T40 R40 measuring water level, gate position transducer ROQ425 measuring brake and acceleration sensor chip ADXL250 measurement, to judge the gate binding speed and decline, after the detection signal processing to lower place machine and the lower machine processing analysis after the store display and output control signal to control motor and reversing, and the change of gate opening to precisely control lock. When appear abnormal phenomenon horn and LED light emitting diode formed sound and light alarm, and application of HD7279A connect the keyboard and display circuit, clock chip PCF8563, memory chip adopts FM24C16, power circuit design to ensure the monitoring terminal can not only by AC220V power supply, can also by a battery as a power supply. Upper machine adopts two communication port of the microcontroller W77E58, respectively connected to the lower machine and PC, the speaker PC sound and light alarm circuit and LED lights.Gate control system of small and medium-sized hydropower station is the application of advanced technology, the configuration of computer monitoring device, to improve the modernization level, small hydropower station, ensure security and the benefit of the hydropower station, improve the hydropower plant automation degree and economic benefit, improve the response speed and security of power grid production levels, increase its operation reliability and stability.Key words:Single chip microcomputer; Data acquisition; Sluice control system; Data communication目录第1章绪论 (1)1.1题目研究背景及意义 (1)1.2研究现状及发展趋势 (2)1.3论文主要内容 (3)第2章方案论证 (4)2.1控制方案的选择 (4)2.2系统总体方案设计 (5)第3章硬件设计 (8)3.1下位单片机设计 (8)3.1.1 下位单片机选型 (8)3.1.2 下位机扩展电路设计 (9)3.2下位机水位测量模块设计 (10)3.2.1 超声波传感器 (10)3.2.2 超声波传感器发射电路 (12)3.2.3 超声波传感器检测接收电路 (12)3.2.4 温度补偿设计 (13)3.3下位机闸位检测模块设计 (15)3.3.1 闸位传感器 (15)3.3.2 闸位传感器数据采集电路设计 (17)3.4下位机加速度测量模块设计 (17)3.4.1 加速度计设计 (18)3.4.2 加速度计标定电路设计 (18)3.4.3 加速度计滤波电路设计 (19)3.4.4 A/D转换电路设计 (20)3.5下位机时钟模块设计 (22)3.6下位机存储模块设计 (23)3.7下位机键盘显示模块设计 (24)3.7.1 状态显示 (24)3.7.2 键盘、显示组合接口电路设计 (26)3.8下位机报警模块设计 (28)3.8.1 报警电路设计 (28)3.9下位机电机控制模块设计 (29)3.10下位机通信模块设计 (30)3.10.1 通信方式的选择 (30)3.10.2 通信电路设计 (30)3.11上位机模块设计 (31)3.11.1 上位单片机选型 (32)3.11.2 上位机存储电路设计 (33)3.11.3 上位机报警电路设计 (34)3.11.4 上位机通信电路 (34)3.12电源电路设计 (35)3.12.1 5V稳压电源模块设计 (35)3.12.2 15V稳压电源模块设计 (35)第4章软件设计 (37)4.1下位机主程序设计 (37)4.1.1 下位机中断子程序 (38)4.2下位机计时显示子程序 (38)4.3下位机显示状态子程序 (40)4.4下位机水位检测子程序 (41)4.5下位机闸位检测子程序 (41)4.6下位机加速度检测子程序 (42)4.7通信子程序 (43)第5章结论 (45)参考文献 (46)致谢 (48)附录I (49)附录II........................................................................................... 错误!未定义书签。
附录III.. (61)第1章绪论1.1题目研究背景及意义中国是一个水利资源蕴藏十分丰富的国家。
河流众多,水系庞大而复杂,众多水系构成中国水力资源蛛网密布的格局。
三级梯形地形造成中国众多河流具有水电开发的潜力。
不论是水能资源蕴藏量,还是可能开发的水能资源,中国在世界各国中均居第一位。
新中国成立50年来,我国水电建设事业取得了飞速发展,特别是实行改革开放以来,随着广蓄、天生桥(高坝)、小浪底、二滩、三峡等一批世界级水电站的建设,中国已逐步进入世界水电建设前列。
我国水电资源十分丰富,而发展水电对于环境保护、经济持续发展具有重要意义。
我国水电站自动控制系统应用已经逐渐成熟。
随着水电的发展,开发经济实用的中小型水电自动控制系统很有必要。
但是近年来随着我国经济的迅速发展,对水的需求量也大幅度增长,如今中国北方很多省份已经出现了缺水现象,专家们己经做了估计,按照现在中国经济发展的速度,如果不采取合理回收、利用水资源的有效手段,不提高广大民众珍惜水的观念,那么到2010年中国将成为下个严重缺水的国家,水短缺将会制约我国国民经济的进一步发展,严重影响我国民众的日常生活。